Skip to content

Commit

Permalink
✨ feat : svg ICON preloading
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Dec 1, 2023
1 parent bc4120c commit e4e5eae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface IconProps {
}

export function Icon({ icon, size = 24 }: IconProps) {
return <Image src={`/icons/${icon}.svg`} width={size} height={size} alt="icon" />;
return <Image src={`/icons/${icon}.svg`} width={size} height={size} alt="icon" priority />;
}

interface IconButtonProps {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Modal/BottomSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IconButton } from '../Button';
import { AnimatedPortal } from '@/components/Portal';
import { ICON } from '@/constants/icon';
import useBottomSheet from '@/hooks/useBottomSheet';
import { StrictPropsWithChildren } from '@/types';

Expand All @@ -18,7 +19,7 @@ export default function BottomSheet({ children }: StrictPropsWithChildren) {
>
<div className="fixed inset-x-0 bottom-0 z-30 mx-auto max-w-440 rounded-t-16 bg-white">
<div className="flex justify-end px-8 pt-12">
<IconButton icon="close" onClick={closeBottomSheet} />
<IconButton icon={ICON.close.black} onClick={closeBottomSheet} />
</div>
<div>{children}</div>
</div>
Expand Down

0 comments on commit e4e5eae

Please sign in to comment.