Skip to content

Commit

Permalink
Converted all the css into Tailwind css of Drawer component (#1745)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Holmberg <[email protected]>
Co-authored-by: Kyle Holmberg <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent ae8068c commit 5145d77
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 47 deletions.
15 changes: 9 additions & 6 deletions components/Drawer/Drawer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { node, string, bool } from 'prop-types';
import classNames from 'classnames';
import styles from './Drawer.module.css';

Drawer.propTypes = {
children: node.isRequired,
Expand All @@ -16,12 +15,16 @@ Drawer.defaultProps = {
function Drawer({ children, className, isVisible }) {
return (
<div
className={classNames(className, {
[styles.visible]: isVisible,
[styles.hidden]: !isVisible,
})}
className={classNames(
className,
'hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2]',
{
'-left-0': isVisible,
'-left-[100%]': !isVisible,
},
)}
>
<div className={styles.content}>{children}</div>
<div className="h-full w-full">{children}</div>
</div>
);
}
Expand Down
37 changes: 0 additions & 37 deletions components/Drawer/Drawer.module.css

This file was deleted.

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

exports[`Drawer should render with many props assigned 1`] = `
<div
className="test-class visible"
className="test-class hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2] -left-0"
>
<div
className="content"
className="h-full w-full"
>
Test
</div>
Expand All @@ -14,10 +14,10 @@ exports[`Drawer should render with many props assigned 1`] = `

exports[`Drawer should render with required props 1`] = `
<div
className="hidden"
className="hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2] -left-[100%]"
>
<div
className="content"
className="h-full w-full"
>
Test
</div>
Expand Down

2 comments on commit 5145d77

@vercel
Copy link

@vercel vercel bot commented on 5145d77 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5145d77 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.