-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from NASA-IMPACT/feature/uhoh
Restructure error pages
- Loading branch information
Showing
13 changed files
with
172 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
APP_TITLE=Dashboard Delta | ||
APP_DESCRIPTION=Earth changing dashboard | ||
APP_CONTACT_EMAIL=[email protected] | ||
|
||
# If the app is being served in from a subfolder, the domain url must be set. | ||
# For example, if the app is served from /mysite: | ||
|
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
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
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,25 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
type EffectPreviousCb<T> = (previous: T, mounted: boolean) => void | (() => void) | ||
|
||
/** | ||
* Same behavior as React's useEffect but called with the values for the | ||
* previous dependencies and with a flag tracking whether or not the component | ||
* is mounted | ||
* @param {func} cb Hook callback | ||
* @param {array} deps Hook dependencies. | ||
*/ | ||
export function useEffectPrevious<T extends React.DependencyList>(cb: EffectPreviousCb<T> , deps: T) { | ||
const prev = useRef<React.DependencyList>(); | ||
const mounted = useRef(false); | ||
const unchangingCb = useRef<EffectPreviousCb<React.DependencyList>>(cb); | ||
unchangingCb.current = cb; | ||
|
||
useEffect(() => { | ||
const r = unchangingCb.current(prev.current, mounted.current); | ||
prev.current = deps; | ||
if (!mounted.current) mounted.current = true; | ||
return r; | ||
/* eslint-disable-next-line react-hooks/exhaustive-deps */ | ||
}, deps); | ||
} |