Skip to content

Commit

Permalink
fix(perf): logo svgを外部参照方式に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
sor4chi committed Apr 14, 2024
1 parent bd9e286 commit f4dcd4b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const config = {
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],
core: {
builder: '@storybook/builder-vite',
},
Expand Down
File renamed without changes
8 changes: 4 additions & 4 deletions packages/components/src/header/Header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ const NAVIGATIONS = [

export const Light = () => (
<Container theme="light">
<Header navigations={NAVIGATIONS} />
<Header navigations={NAVIGATIONS} iconSrc="/logo.svg" />
</Container>
);

export const Dark = () => (
<Container theme="dark">
<Header navigations={NAVIGATIONS} />
<Header navigations={NAVIGATIONS} iconSrc="/logo.svg" />
</Container>
);

export const DropdownOpenLight = () => (
<Container theme="light">
<Header navigations={NAVIGATIONS} dropdownOpen>
<Header navigations={NAVIGATIONS} iconSrc="/logo.svg" dropdownOpen>
<Button leftIcon={<User />} variant="tertiary" />
<Button leftIcon={<Menu />} variant="tertiary" />
</Header>
Expand All @@ -80,7 +80,7 @@ export const DropdownOpenLight = () => (

export const DropdownOpenDark = () => (
<Container theme="dark">
<Header navigations={NAVIGATIONS} dropdownOpen>
<Header navigations={NAVIGATIONS} iconSrc="/logo.svg" dropdownOpen>
<Button leftIcon={<User />} variant="tertiary" />
<Button leftIcon={<Menu />} variant="tertiary" />
</Header>
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ArrowUpRight, X } from 'react-feather';
import { Button } from '../button';

import styles from './Header.module.scss';
import logo from './logo.svg';

type NavigationItem = {
name: string;
Expand All @@ -31,6 +30,7 @@ export interface HeaderProps {
navigations: NavigationItem[];
children?: React.ReactNode;
link?: LinkComponent;
iconSrc: string;
dropdownOpen?: boolean;
dropdownChildren?: React.ReactNode;
onDropdownClose?: () => void;
Expand All @@ -40,6 +40,7 @@ export const Header = ({
navigations,
children,
link,
iconSrc,
dropdownOpen,
dropdownChildren,
onDropdownClose,
Expand All @@ -54,7 +55,7 @@ export const Header = ({
<div className={styles.headerInner}>
<nav className={styles.nav}>
<Link to="/" href="/" className={styles.logoLink}>
<img className={styles.logo} src={logo} alt="Maximum Logo" />
<img className={styles.logo} src={iconSrc} alt="Maximum Logo" />
</Link>
<ul className={styles.navList}>
{navigations.map((nav) => (
Expand Down

0 comments on commit f4dcd4b

Please sign in to comment.