-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
194 additions
and
42 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
163 changes: 144 additions & 19 deletions
163
frontend/src/Components/Pages/Landing-Page/JoinWithCode.jsx
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,19 @@ | ||
import { toast } from 'react-hot-toast'; | ||
|
||
export const showLoadingToast = (promise, defaultMessages) => { | ||
return toast.promise( | ||
promise, | ||
{ | ||
loading: defaultMessages.loading, | ||
success: (data) => <b>{data.message || defaultMessages.success}</b>, | ||
error: (error) => <b>{error.message || defaultMessages.error}</b>, | ||
}, | ||
{ | ||
position: 'top-center', | ||
style: { | ||
background: 'white', | ||
color: 'black', | ||
}, | ||
} | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
const errorHadnler = (statusCode, message) => { | ||
const errorHandler = (statusCode, message, err = null) => { | ||
const error = new Error(); | ||
error.statusCode = statusCode; | ||
error.message = message; | ||
if (err) { | ||
error.stack = err.stack; | ||
} | ||
return error; | ||
}; | ||
|
||
module.exports = { errorHadnler }; | ||
module.exports = { errorHandler }; |