Skip to content

Commit

Permalink
Fix: WeeklyPopualarItem
Browse files Browse the repository at this point in the history
  • Loading branch information
cuconveniencestore authored and hookor committed May 31, 2024
1 parent 8a81b70 commit ac32fe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/components/home/WeeklyPopular.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import WeeklyPopularItem from '@/components/home/WeeklyPopularItem';
import { lazy } from 'react';
import { useGetPopularList } from '@/hooks/home/useGetPopularList';
import { TODAY_CAFFEINE_INFO_TEXTS } from '@/constants/home';
import { styled } from 'styled-system/jsx';
import { cx } from 'styled-system/css';
import { Grid } from '@/styles/layout';
import { SmStyle, SumTitle, MarginT12 } from '@/styles/styles';

const WeeklyPopularItem = lazy(
() => import('@/components/home/WeeklyPopularItem')
);
const { weeklyPopular } = TODAY_CAFFEINE_INFO_TEXTS;

const WeeklyPopular = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/home/WeeklyPopularItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const WeeklyPopularItem = ({
data: WeeklyPopularTypes;
idx: number;
}) => {
const icon = `/png/${data.brand}.png`;
const icon = data && `/png/${data?.brand}.png`;

return (
<Container className={Align}>
<span>{idx + 1}</span>
<BrandInfo className={Align}>
<BrandIcon
src={icon}
alt={data.brand}
alt={data?.brand}
/>
<span>{convertBrandName(data.brand)}</span>
<span>{convertBrandName(data?.brand)}</span>
</BrandInfo>
</Container>
);
Expand Down

0 comments on commit ac32fe4

Please sign in to comment.