-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit and update feature has been added
- Loading branch information
1 parent
07937ad
commit 48ab867
Showing
25 changed files
with
762 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
import {createContext} from "react"; | ||
|
||
const AuthContext = createContext({ | ||
userId : null, | ||
isLoggedIn : false, | ||
|
||
login : () => {}, | ||
logout : () => {} | ||
}) | ||
|
||
export default AuthContext; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
|
||
import React from "react"; | ||
|
||
const ConfirmationModal = ({ isOpen, title, message, onConfirm, onCancel }) => { | ||
if (!isOpen) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-gray-900 bg-opacity-50"> | ||
<div className="bg-white w-1/3 p-6 rounded shadow-lg"> | ||
<div className="mb-4"> | ||
<h2 className="text-lg font-bold">{title}</h2> | ||
<p className="text-gray-700">{message}</p> | ||
</div> | ||
<div className="flex justify-end"> | ||
<button | ||
className="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 mr-2 rounded focus:outline-none focus:shadow-outline" | ||
onClick={onConfirm} | ||
> | ||
Confirm | ||
</button> | ||
<button | ||
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" | ||
onClick={onCancel} | ||
> | ||
Cancel | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConfirmationModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
const ErrorModal = ({ isOpen, message, onClose }) => { | ||
return isOpen ? ( | ||
<div className="fixed inset-0 flex items-center justify-center"> | ||
<div className="fixed inset-0 bg-gray-900 opacity-50"></div> | ||
<div className="bg-white p-2 rounded-lg z-10 flex flex-col "> | ||
<span className=" self-end cursor-pointer text-5xl" onClick={onClose}> | ||
× | ||
</span> | ||
<p className="text-red-600 text-lg">{message}</p> | ||
</div> | ||
</div> | ||
) : null; | ||
}; | ||
|
||
export default ErrorModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
|
||
|
||
const getDate = () => { | ||
const currentDate = new Date(); | ||
|
||
const options = { | ||
day: '2-digit', | ||
month: '2-digit', | ||
year: 'numeric', | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
hour12: true // Use AM/PM format | ||
}; | ||
|
||
const formattedDateTime = currentDate.toLocaleString('en-GB', options); // 'en-GB' represents the format dd-mm-yyyy | ||
console.log(formattedDateTime); // Output: 11-04-2024, 05:03 PM | ||
return formattedDateTime; | ||
} | ||
|
||
export default getDate; |
Oops, something went wrong.