File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- interface ButtonSectionProps {
2- onAddTodo : ( text : string ) => void ;
3- }
1+ import { useRouter } from 'next/navigation' ;
42
5- const ButtonSection = ( { onAddTodo } : ButtonSectionProps ) => {
6- const handleAddClick = ( ) => {
7- const text = prompt ( '할 일을 입력하세요' ) ;
8- if ( text ) {
9- onAddTodo ( text ) ;
10- }
3+ const ButtonSection = ( ) => {
4+ const router = useRouter ( ) ;
5+ const handleNewPlan = ( ) => {
6+ router . push ( '/plans' ) ;
7+ } ;
8+ const handleNewWrite = ( ) => {
9+ router . push ( '/write' ) ;
1110 } ;
12-
1311 return (
1412 < div className = "flex w-full gap-6" >
1513 < button
1614 type = "button"
15+ onClick = { handleNewWrite }
1716 className = "bg-primary flex-1 rounded-xl py-4 text-center text-base font-semibold text-white shadow-sm transition hover:bg-violet-500 active:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-60"
1817 >
1918 새 TIL 작성
2019 </ button >
2120
2221 < button
2322 type = "button"
24- onClick = { handleAddClick }
23+ onClick = { handleNewPlan }
2524 className = "flex-1 rounded-xl border border-slate-300 bg-none py-4 text-center text-base font-semibold text-slate-700 transition hover:bg-slate-200 active:bg-slate-300 disabled:cursor-not-allowed disabled:opacity-60"
2625 >
2726 플랜 추가하기
You can’t perform that action at this time.
0 commit comments