Skip to content

Commit

Permalink
Bug fix.magazine banner fix (#198)
Browse files Browse the repository at this point in the history
* fix. delete useMemo magazine banner

---------

Co-authored-by: Junseo <[email protected]>
  • Loading branch information
doyupK and blan19 authored Sep 16, 2023
1 parent ea61d8d commit 2811d75
Show file tree
Hide file tree
Showing 2 changed files with 1,243 additions and 1,284 deletions.
27 changes: 13 additions & 14 deletions apps/web/src/components/magazine/magazineList/magazineList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ const MagazineList = () => {
const { data: magazine } = useMagazine({ page, keyword });
const { push } = useRouter();
const isMagazine = magazine && magazine.data.length > 0;
const newMagainze = React.useMemo(() => {
if (isMagazine) return magazine.data[0];
return null;
}, []);
// const newMagainze = React.useMemo(() => {
// if (isMagazine) return magazine.data[0];
// return null;
// }, []);

return (
<Container display="flex" flexDirection="column" alignItems="center">
{isMagazine ? (
<>
{newMagainze && (
<Link
href={`/magazine/${magazine.data[0].id}`}
style={{
cursor: 'pointer',
}}
>
<MagazineBanner initialData={newMagainze} />
</Link>
)}
<Link
href={`/magazine/${magazine.data[0].id}`}
style={{
cursor: 'pointer',
}}
>
<MagazineBanner initialData={magazine.data[0]} />
</Link>

<Wrapper
css={css`
width: 880px;
Expand Down
Loading

0 comments on commit 2811d75

Please sign in to comment.