-
Notifications
You must be signed in to change notification settings - Fork 0
Error components for ViewActivities #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13321e5
Create Error components
keiffer01 af4ec41
Address Issue #74 by using the error components
keiffer01 edc125c
Move ErrorComponents to a separate directory
keiffer01 00f0945
Abstract error components into separate files
keiffer01 5546e38
Remove ErrorNotCollaborator and have the functionality handled by Err…
keiffer01 c11f9a2
Replace getUserUid with getCurUserUid
keiffer01 490b6de
Merge branch 'master' into viewactivities-auth-errors
keiffer01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 @@ | ||
| import React from 'react'; | ||
| import GoToTripsButton from './GoToTripsButton.js'; | ||
|
|
||
| /** | ||
| * Error component for any general error that occurs, such as failure fetching | ||
| * from Firebase. | ||
| */ | ||
| class ErrorGeneral extends React.Component { | ||
| /** @inheritdoc */ | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <p> | ||
| Oops, looks like something went wrong. Please wait a few minutes and | ||
| try again. | ||
| </p> | ||
| <GoToTripsButton /> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default ErrorGeneral |
This file contains hidden or 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,20 @@ | ||
| import React from 'react'; | ||
| import GoToTripsButton from './GoToTripsButton.js'; | ||
|
|
||
| /** | ||
| * Error component displayed when a nonexistent trip is queried for in the | ||
| * database. | ||
| */ | ||
| class ErrorTripNotFound extends React.Component { | ||
| /** @inheritdoc */ | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <p>Sorry, we couldn't find the trip you were looking for.</p> | ||
| <GoToTripsButton /> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default ErrorTripNotFound; |
This file contains hidden or 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,26 @@ | ||
| import React from 'react'; | ||
| import { useHistory } from 'react-router-dom'; | ||
|
|
||
| import Button from 'react-bootstrap/Button'; | ||
|
|
||
| import { VIEW_TRIPS } from '../../constants/routes'; | ||
|
|
||
| /** | ||
| * A simple Button component that redirects the user back to the VIEW_TRIPS page | ||
| * that is rendered with each of this file's error components. | ||
| */ | ||
| const GoToTripsButton = () => { | ||
| const history = useHistory(); | ||
|
|
||
| function goToTrips() { | ||
| history.push(VIEW_TRIPS); | ||
| } | ||
|
|
||
| return ( | ||
| <Button type='button' onClick={goToTrips} variant='primary' size='lg'> | ||
| Go Back to Your Trips | ||
| </Button> | ||
| ); | ||
| } | ||
|
|
||
| export default GoToTripsButton; |
This file contains hidden or 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,5 +1,9 @@ | ||
| import ErrorGeneral from './ErrorGeneral.js'; | ||
| import ErrorPageNotFound from './ErrorPageNotFound.js'; | ||
| import ErrorTripNotFound from './ErrorTripNotFound.js'; | ||
|
|
||
| export { | ||
| ErrorPageNotFound | ||
| } | ||
| ErrorGeneral, | ||
| ErrorPageNotFound, | ||
| ErrorTripNotFound | ||
| }; | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.