Skip to content

Converted all the css into Tailwind css of Badge component #1739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions components/Badge/Badge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { bool, element, oneOfType, string } from 'prop-types';
import classNames from 'classnames';
import styles from './Badge.module.css';

Badge.propTypes = {
className: string,
Expand All @@ -16,15 +15,20 @@ Badge.defaultProps = {

function Badge({ className, icon, isImageFirst, label }) {
return (
<figure className={classNames(styles.Badge, className)}>
<figure
className={classNames(
'flex flex-col justify-items-center place-content-start m-2 [&>img>svg]:fill-current [&>img>svg]:my-4 [&>img]:mx-0 [&>img]:h-24' [&>svg]:mx-0 [&>svg]:h-24',
className,
)}
>
{isImageFirst ? (
<>
{icon}
<figcaption className={styles.label}>{label}</figcaption>
<figcaption className="text-center whitespace-nowrap">{label}</figcaption>
</>
) : (
<>
<figcaption className={styles.label}>{label}</figcaption>
<figcaption className="text-center whitespace-nowrap">{label}</figcaption>
{icon}
</>
)}
Expand Down
19 changes: 0 additions & 19 deletions components/Badge/Badge.module.css

This file was deleted.

8 changes: 4 additions & 4 deletions components/Badge/__tests__/__snapshots__/Badge.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

exports[`Badge should render with many props assigned 1`] = `
<figure
className="Badge test-class"
className="flex flex-col justify-items-center place-content-start m-2 [&>img>svg]:fill-current [&>img>svg]:my-4 [&>img>svg]:mx-0 [&>img>svg]:h-24 test-class"
>
<svg />
<figcaption
className="label"
className="text-center whitespace-nowrap"
>
Badge Icon
</figcaption>
Expand All @@ -15,11 +15,11 @@ exports[`Badge should render with many props assigned 1`] = `

exports[`Badge should render with required props 1`] = `
<figure
className="Badge"
className="flex flex-col justify-items-center place-content-start m-2 [&>img>svg]:fill-current [&>img>svg]:my-4 [&>img>svg]:mx-0 [&>img>svg]:h-24"
>
<svg />
<figcaption
className="label"
className="text-center whitespace-nowrap"
>
Testing
</figcaption>
Expand Down