Skip to content

Commit

Permalink
fix: 경로 설정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gominzip committed Aug 27, 2024
1 parent efe57a0 commit 1ff05dc
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/components/home/homeRecentTales/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,23 @@ const Card = (props: CardProps) => {

const navigate = useNavigate();

const goTaleRead = (taleId: number) => {
navigate(`/readTale`, { state: { response: { taleId: taleId } } });
const goTaleRead = () => {
navigate(`/readTale`, { state: { response: { taleId: props.taleId } } });
};

const goTaleLearn = (taleId: number) => {
console.log("이동");
navigate(`/learnTale/pre`, { state: { taleId } });
const goTaleLearn = () => {
navigate(`/learnTale/pre`, { state: { taleId: props.taleId } });
};

const goTaleQuiz = (languageTaleId: number) => {
console.log("이동");
console.log(languageTaleId);
navigate(`/learnTale/quiz`, { state: languageTaleId });
const goTaleQuiz = () => {
navigate(`/learnTale/quiz`, { state: props.languageTaleId });
};

return (
<>
<S.CardContainer
onClick={() => {
goTaleRead(props.taleId);
goTaleRead();
}}
height={height}
backgroundColor1={backgroundColor1}
Expand All @@ -57,7 +54,7 @@ const Card = (props: CardProps) => {
<button
onClick={(e) => {
e.stopPropagation();
goTaleQuiz(props.languageTaleId);
goTaleQuiz();
}}
>
{props.btnText}
Expand All @@ -67,7 +64,7 @@ const Card = (props: CardProps) => {
<button
onClick={(e) => {
e.stopPropagation();
goTaleLearn(props.languageTaleId);
goTaleLearn();
}}
>
{props.btnText}
Expand Down

0 comments on commit 1ff05dc

Please sign in to comment.