mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
🎨 styles: drawer comon
:%s
This commit is contained in:
36
src/components/common/DrawerCommon/DrawerCommon.tsx
Normal file
36
src/components/common/DrawerCommon/DrawerCommon.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import React, { useRef } from 'react';
|
||||
import s from './DrawerCommon.module.scss';
|
||||
import classNames from 'classnames';
|
||||
import { IconClose } from 'src/components/icons';
|
||||
|
||||
interface Props {
|
||||
visible: boolean
|
||||
title?: string
|
||||
children?: React.ReactNode
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
const DrawerCommon = ({ title, visible, children, onClose }: Props) => {
|
||||
return (
|
||||
<div className={classNames({
|
||||
[s.drawerCommon]: true,
|
||||
[s.hide]: !visible
|
||||
})}>
|
||||
<div className={s.inner}>
|
||||
<div className={s.top}>
|
||||
<h4 className={s.heading}>
|
||||
{title}
|
||||
</h4>
|
||||
<div className={s.iconClose} onClick={onClose}>
|
||||
<IconClose />
|
||||
</div>
|
||||
</div>
|
||||
<div className={s.content}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DrawerCommon;
|
Reference in New Issue
Block a user