Skip to content

Commit

Permalink
feat : update templates/mystoreTemplate/index.js (#83)
Browse files Browse the repository at this point in the history
페이지 버튼 추가
  • Loading branch information
JungYeonHwi committed Oct 18, 2023
1 parent 314cb7c commit 9d14d62
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions components/templates/mystoreTemplate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Router, { useRouter } from 'next/router';

import Text from '@components/atoms/text';
import Image from '@components/atoms/image';
import Button from '@components/atoms/button';

import { WholeDiv } from './style';

const MystoreTemplate = ({data}) => {
Expand All @@ -12,12 +14,32 @@ const MystoreTemplate = ({data}) => {
query: { id: data.storeId, storeName: data.name },
})
}

const router = useRouter();

const statisticsOnClick = () => {
router.push({
pathname: '/statistics',
query: { id: data.storeId },
})
}

const predictionOnClick = () => {
router.push({
pathname: '/predictio',
query: { id: data.storeId },
})
}

return (
<WholeDiv key={data.storeId} onClick={mystoreDetailButton}>
<Text className="mystoreName" text={data.name} />
<Text className="mystoreDes" text={data.description} />
<Image className="mystoreImage" src={data.thumbnail} />
<WholeDiv key={data.storeId}>
<div onClick={mystoreDetailButton}>
<Text className="mystoreName" text={data.name} />
<Text className="mystoreDes" text={data.description} />
<Image className="mystoreImage" src={data.thumbnail} />
</div>
<Button text="통계 내역" onClick={statisticsOnClick} />
<Button text="예측" onClick={predictionOnClick} />
</WholeDiv>
);
};
Expand Down

0 comments on commit 9d14d62

Please sign in to comment.