@@ -13,7 +13,9 @@ const btnStyle = {
1313} ;
1414
1515const alertStyle =
16- 'text-black flex flex-col items-center justify-evenly h-56 w-56 fixed inset-1/2' ;
16+ 'text-white text-center flex flex-col items-center justify-evenly h-56 w-96 fixed top-2/3 inset-x-1/2 bg-black p-12' ;
17+
18+ const alertBtnStyle = 'hover:bg-white hover:text-black border-white p-4' ;
1719
1820const DeleteBtn : React . FC < { courseId : number } > = ( { courseId } ) => {
1921 const navigate = useNavigate ( ) ;
@@ -44,14 +46,11 @@ const DeleteBtn: React.FC<{ courseId: number }> = ({ courseId }) => {
4446 } ;
4547
4648 const handleClick = ( ) => {
47- console . log ( 'delete button clicked' ) ;
4849 // ask if sure!!!
4950 setAskIfSure ( true ) ;
5051 } ;
5152
52- useEffect ( ( ) => {
53- console . log ( 'askIfSure: ' , askIfSure ) ;
54- } , [ askIfSure ] ) ;
53+ // TODO: success message??
5554
5655 return (
5756 < div className = { btnStyle . box } >
@@ -61,9 +60,19 @@ const DeleteBtn: React.FC<{ courseId: number }> = ({ courseId }) => {
6160 { askIfSure && (
6261 < div className = { alertStyle } >
6362 < h2 > Are you sure you want to delete this course?</ h2 >
64- < div >
65- < button onClick = { ( ) => handleDelete ( courseId ) } > YES</ button >
66- < button onClick = { ( ) => setAskIfSure ( false ) } > CANCEL</ button >
63+ < div className = "flex flex-row justify-evenly w-full mt-4" >
64+ < button
65+ onClick = { ( ) => handleDelete ( courseId ) }
66+ className = { alertBtnStyle }
67+ >
68+ YES
69+ </ button >
70+ < button
71+ onClick = { ( ) => setAskIfSure ( false ) }
72+ className = { alertBtnStyle }
73+ >
74+ CANCEL
75+ </ button >
6776 </ div >
6877 </ div >
6978 ) }
0 commit comments