diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-29 12:13:34 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-29 18:30:05 +0200 |
| commit | 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 (patch) | |
| tree | bfc2b4a475cb06a787e2c4bdf284165644e82952 /src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx | |
| parent | 5324664e87bedfaa01ba62c0c847ef5b861e69b3 (diff) | |
chore: remove old pages, components, helpers and types
Since I'm using new components, I will also rewrite the GraphQL queries
so it is easier to start from scratch.
Diffstat (limited to 'src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx')
| -rw-r--r-- | src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx b/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx deleted file mode 100644 index 7ceb70d..0000000 --- a/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { CloseIcon, CogIcon, SearchIcon } from '@components/Icons'; -import { ForwardedRef, forwardRef, SetStateAction } from 'react'; -import { useIntl } from 'react-intl'; -import styles from '../Buttons.module.scss'; - -type ButtonType = 'search' | 'settings'; - -const ButtonToolbar = ( - { - type, - isActivated, - setIsActivated, - }: { - type: ButtonType; - isActivated: boolean; - setIsActivated: (value: SetStateAction<boolean>) => void; - }, - ref: ForwardedRef<HTMLButtonElement> -) => { - const intl = useIntl(); - const ButtonIcon = () => (type === 'search' ? <SearchIcon /> : <CogIcon />); - const btnClasses = isActivated - ? `${styles.toolbar} ${styles['toolbar--activated']}` - : styles.toolbar; - - return ( - <button - ref={ref} - className={btnClasses} - type="button" - onClick={() => setIsActivated(!isActivated)} - > - <span className={styles.icon}> - <span className={styles.front}> - <ButtonIcon /> - </span> - <span className={styles.back}> - <CloseIcon /> - </span> - </span> - {isActivated ? ( - <span className="screen-reader-text"> - {intl.formatMessage( - { - defaultMessage: 'Close {type}', - description: 'ButtonToolbar: Close button', - id: 'SWq8a4', - }, - { - type, - } - )} - </span> - ) : ( - <span className="screen-reader-text"> - {intl.formatMessage( - { - defaultMessage: 'Open {type}', - description: 'ButtonToolbar: Open button', - id: 'Z1eSIz', - }, - { - type, - } - )} - </span> - )} - </button> - ); -}; - -export default forwardRef(ButtonToolbar); |
