Skip to content

Commit 5145d77

Browse files
subhajit20kylemh
andauthored
Converted all the css into Tailwind css of Drawer component (#1745)
Co-authored-by: Kyle Holmberg <[email protected]> Co-authored-by: Kyle Holmberg <[email protected]>
1 parent ae8068c commit 5145d77

File tree

3 files changed

+13
-47
lines changed

3 files changed

+13
-47
lines changed

components/Drawer/Drawer.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { node, string, bool } from 'prop-types';
22
import classNames from 'classnames';
3-
import styles from './Drawer.module.css';
43

54
Drawer.propTypes = {
65
children: node.isRequired,
@@ -16,12 +15,16 @@ Drawer.defaultProps = {
1615
function Drawer({ children, className, isVisible }) {
1716
return (
1817
<div
19-
className={classNames(className, {
20-
[styles.visible]: isVisible,
21-
[styles.hidden]: !isVisible,
22-
})}
18+
className={classNames(
19+
className,
20+
'hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2]',
21+
{
22+
'-left-0': isVisible,
23+
'-left-[100%]': !isVisible,
24+
},
25+
)}
2326
>
24-
<div className={styles.content}>{children}</div>
27+
<div className="h-full w-full">{children}</div>
2528
</div>
2629
);
2730
}

components/Drawer/Drawer.module.css

Lines changed: 0 additions & 37 deletions
This file was deleted.

components/Drawer/__tests__/__snapshots__/Drawer.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
exports[`Drawer should render with many props assigned 1`] = `
44
<div
5-
className="test-class visible"
5+
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"
66
>
77
<div
8-
className="content"
8+
className="h-full w-full"
99
>
1010
Test
1111
</div>
@@ -14,10 +14,10 @@ exports[`Drawer should render with many props assigned 1`] = `
1414

1515
exports[`Drawer should render with required props 1`] = `
1616
<div
17-
className="hidden"
17+
className="hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2] -left-[100%]"
1818
>
1919
<div
20-
className="content"
20+
className="h-full w-full"
2121
>
2222
Test
2323
</div>

0 commit comments

Comments
 (0)