This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve headers for dialogs and drawers
- Loading branch information
Showing
10 changed files
with
125 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React, { FC } from 'react'; | ||
import classNames from 'classnames'; | ||
import css from './Dialog.module.css'; | ||
|
||
export interface DialogHeaderProps { | ||
children?: any; | ||
className?: string; | ||
showCloseButton?: boolean; | ||
onClose?: () => void; | ||
} | ||
|
||
export const DialogHeader: FC<Partial<DialogHeaderProps>> = ({ | ||
children, | ||
className, | ||
showCloseButton, | ||
onClose, | ||
}) => ( | ||
<header className={classNames(css.header, className)}> | ||
<h1 className={css.headerText}>{children}</h1> | ||
{showCloseButton && ( | ||
<button type="button" className={css.closeButton} onClick={onClose}> | ||
✕ | ||
</button> | ||
)} | ||
</header> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './Dialog'; | ||
export * from './useDialog'; | ||
export * from './DialogHeader'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React, { FC } from 'react'; | ||
import classNames from 'classnames'; | ||
import css from './Drawer.module.css'; | ||
|
||
export interface DrawerHeaderProps { | ||
children?: any; | ||
className?: string; | ||
showCloseButton?: boolean; | ||
onClose?: () => void; | ||
} | ||
|
||
export const DrawerHeader: FC<Partial<DrawerHeaderProps>> = ({ | ||
children, | ||
className, | ||
showCloseButton, | ||
onClose, | ||
}) => ( | ||
<header className={classNames(css.header, className)}> | ||
<h1>{children}</h1> | ||
{showCloseButton && ( | ||
<button type="button" className={css.closeButton} onClick={onClose}> | ||
✕ | ||
</button> | ||
)} | ||
</header> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './Drawer'; | ||
export * from './useDrawer'; | ||
export * from './DrawerHeader'; |