From 891441a76173c708c6604fa203b175aefa222333 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 9 Oct 2023 16:31:00 +0200 Subject: refactor(components): rewrite Branding component The component should only be responsible of the layout for the logo, the name and the optional baseline. Also, the homepage url could be different from `/` so the consumer should give the right url. --- src/utils/hooks/index.ts | 1 - src/utils/hooks/use-styles.tsx | 27 --------------------------- 2 files changed, 28 deletions(-) delete mode 100644 src/utils/hooks/use-styles.tsx (limited to 'src/utils/hooks') diff --git a/src/utils/hooks/index.ts b/src/utils/hooks/index.ts index f4357f2..47e90f1 100644 --- a/src/utils/hooks/index.ts +++ b/src/utils/hooks/index.ts @@ -20,5 +20,4 @@ export * from './use-route-change'; export * from './use-scroll-position'; export * from './use-settings'; export * from './use-state-change'; -export * from './use-styles'; export * from './use-update-ackee-options'; diff --git a/src/utils/hooks/use-styles.tsx b/src/utils/hooks/use-styles.tsx deleted file mode 100644 index a70087b..0000000 --- a/src/utils/hooks/use-styles.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { RefObject, useEffect } from 'react'; - -export type UseStylesProps = { - /** - * A property name or a CSS variable. - */ - property: string; - /** - * The styles. - */ - styles: string; - /** - * A targeted element reference. - */ - target: RefObject; -}; - -/** - * Add styles to an element using a React reference. - * - * @param {UseStylesProps} props - An object with property, styles and target. - */ -export const useStyles = ({ property, styles, target }: UseStylesProps) => { - useEffect(() => { - if (target.current) target.current.style.setProperty(property, styles); - }, [property, styles, target]); -}; -- cgit v1.2.3