aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-09 16:31:00 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commit891441a76173c708c6604fa203b175aefa222333 (patch)
tree27295311bb01a4e44dcc4f68422975cd705a24b8 /src/utils
parentf11a906420975e833f278a08470d8f9783c76f73 (diff)
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.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/hooks/index.ts1
-rw-r--r--src/utils/hooks/use-styles.tsx27
2 files changed, 0 insertions, 28 deletions
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<HTMLElement>;
-};
-
-/**
- * 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]);
-};