diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-12-19 15:57:42 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-12-19 15:57:42 +0100 |
| commit | fc77c0a7e9c81f5bc1a69dee945ce71b9511b3cc (patch) | |
| tree | 37678bd2f673b95444a755f4f2efd8dd081ed8f1 /src/components/atoms/overlay/overlay.tsx | |
| parent | 5e5cb43a5fdd0c37f7acd5b5f4ba5f6675fb6b22 (diff) | |
fix(components): make navbar usable with javascript disabled
Diffstat (limited to 'src/components/atoms/overlay/overlay.tsx')
| -rw-r--r-- | src/components/atoms/overlay/overlay.tsx | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/components/atoms/overlay/overlay.tsx b/src/components/atoms/overlay/overlay.tsx index 7dd7446..e8945a8 100644 --- a/src/components/atoms/overlay/overlay.tsx +++ b/src/components/atoms/overlay/overlay.tsx @@ -4,7 +4,6 @@ import { type HTMLAttributes, type ReactNode, } from 'react'; -import { useScrollLock } from '../../../utils/hooks'; import styles from './overlay.module.scss'; export type OverlayProps = HTMLAttributes<HTMLDivElement> & { @@ -12,27 +11,13 @@ export type OverlayProps = HTMLAttributes<HTMLDivElement> & { * The elements to display in front of the overlay. */ children: ReactNode; - /** - * Should the overlay be visible? - * - * Use it if you want an animated overlay instead of mounting/demounting it. - * - * @default true - */ - isVisible?: boolean; }; const OverlayWithRef: ForwardRefRenderFunction<HTMLDivElement, OverlayProps> = ( - { children, className = '', isVisible = true, ...props }, + { children, className = '', ...props }, ref ) => { - const overlayClass = [ - styles.overlay, - styles[isVisible ? 'overlay--visible' : 'overlay--hidden'], - className, - ].join(' '); - - useScrollLock(isVisible); + const overlayClass = [styles.overlay, className].join(' '); return ( <div {...props} className={overlayClass} ref={ref}> |
