Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 소식페이지에서 응원 이후 해당 기록 상세 페이지로 이동 #382

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion features/news/components/atoms/cheer-up-button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'use client';

import { useRouter } from 'next/navigation';

import { Button } from '@/components/atoms';
import { CheerBottomSheet, CheerProgress } from '@/components/molecules';
import { useCheerBottomSheet } from '@/hooks';
Expand All @@ -9,6 +13,7 @@ interface CheerUpButtonProps {
}

export const CheerUpButton = ({ memoryId, nickname }: CheerUpButtonProps) => {
const router = useRouter();
const {
cheerList,
selectedCheerItem,
Expand All @@ -22,6 +27,11 @@ export const CheerUpButton = ({ memoryId, nickname }: CheerUpButtonProps) => {
memoryId,
});

const handleChangeOpen = (isOpen: boolean) => {
handleChangeSelectedItem(isOpen);
router.push(`/record-detail/${memoryId}`);
};

return (
<>
<Button
Expand All @@ -34,7 +44,7 @@ export const CheerUpButton = ({ memoryId, nickname }: CheerUpButtonProps) => {
{/* NOTE: 응원 Progress 모달 */}
<CheerProgress
isOpen={Boolean(selectedCheerItem)}
onChangeOpen={handleChangeSelectedItem}
onChangeOpen={handleChangeOpen}
authorName={nickname}
cheerItem={selectedCheerItem}
/>
Expand Down
Loading