From f861e6a269ba9f62700776d3cd13b644a9e836d4 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 20 Sep 2023 16:38:54 +0200 Subject: refactor: use named export for everything except pages Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements. --- src/components/organisms/toolbar/toolbar.tsx | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/components/organisms/toolbar/toolbar.tsx') diff --git a/src/components/organisms/toolbar/toolbar.tsx b/src/components/organisms/toolbar/toolbar.tsx index 339dec4..218b4fb 100644 --- a/src/components/organisms/toolbar/toolbar.tsx +++ b/src/components/organisms/toolbar/toolbar.tsx @@ -1,9 +1,8 @@ import { FC, useState } from 'react'; -import useOnClickOutside from '../../../utils/hooks/use-on-click-outside'; -import useRouteChange from '../../../utils/hooks/use-route-change'; -import MainNav, { type MainNavProps } from '../toolbar/main-nav'; -import Search, { type SearchProps } from '../toolbar/search'; -import Settings, { type SettingsProps } from '../toolbar/settings'; +import { useOnClickOutside, useRouteChange } from '../../../utils/hooks'; +import { MainNav, type MainNavProps } from './main-nav'; +import { Search, type SearchProps } from './search'; +import { Settings, type SettingsProps } from './settings'; import styles from './toolbar.module.scss'; export type ToolbarProps = Pick & @@ -23,7 +22,7 @@ export type ToolbarProps = Pick & * * Render the website toolbar. */ -const Toolbar: FC = ({ +export const Toolbar: FC = ({ ackeeStorageKey, className = '', motionStorageKey, @@ -49,18 +48,18 @@ const Toolbar: FC = ({ return (
setIsNavOpened(!isNavOpened)} className={styles.modal} + isActive={isNavOpened} + items={nav} ref={mainNavRef} + setIsActive={() => setIsNavOpened(!isNavOpened)} /> setIsSearchOpened(!isSearchOpened)} className={`${styles.modal} ${styles['modal--search']}`} + isActive={isSearchOpened} ref={searchRef} + searchPage={searchPage} + setIsActive={() => setIsSearchOpened(!isSearchOpened)} /> = ({
); }; - -export default Toolbar; -- cgit v1.2.3