Skip to content

Commit

Permalink
Add ExitConfirmationModal and other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thepuja committed Aug 14, 2024
1 parent 284d0dc commit 435ecb2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions nepalingo-web/src/components/header/ExitConfirmationModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react"
interface ExitConfrimationModalProps {
show: boolean;
onConfirm: (confirm: boolean) => void;
}
const ExitConfrimationModal: React.FC<ExitConfrimationModalProps> = ({

Check failure on line 6 in nepalingo-web/src/components/header/ExitConfirmationModal.tsx

View workflow job for this annotation

GitHub Actions / test_build

'ExitConfrimationModal' is assigned a value but never used
show,
onConfirm

Check failure on line 8 in nepalingo-web/src/components/header/ExitConfirmationModal.tsx

View workflow job for this annotation

GitHub Actions / test_build

'onConfirm' is defined but never used
}) => {
if (!show) return null;

function confirmExit(arg0: boolean): void {

Check failure on line 12 in nepalingo-web/src/components/header/ExitConfirmationModal.tsx

View workflow job for this annotation

GitHub Actions / test_build

'arg0' is defined but never used
throw new Error("Function not implemented.");
}

return (
<div className="fixed inset-0 bg-black-600 bg-opacity-50 flex items-center justify-center">
<div className=" bg-red p-6 rounded shadow-lg text-center">
<p className="mb-4">Are you sure you want to exit?</p>
<div className="flex justify-center space x-6">
<button className="bg-red-600 text-white p-2 rounded hover:bg-red-700"
onClick={() => confirmExit(true)}>
Yes
</button>
<button className="bg-green-600 text-white p-2 rounded hover:bg-green-700"
onClick={() => confirmExit(false)}>
No

</button>
</div>
</div>
</div>
);
};
export default ExitConfirmationModal;

0 comments on commit 435ecb2

Please sign in to comment.