forked from henb13/jre-missing
-
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.
replace conditional render with null returns
Showing
12 changed files
with
81 additions
and
67 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
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,13 @@ | ||
import { ReactComponent as AlertIcon } from "../icons/alertIcon.svg"; | ||
import styles from "./Error.module.css"; | ||
|
||
const Error = ({ error }) => { | ||
return ( | ||
<div className={styles.error}> | ||
<AlertIcon className={styles.icon} /> | ||
{error} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Error; |
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,11 @@ | ||
.error { | ||
display: flex; | ||
align-items: center; | ||
font-size: var(--font-size-medium); | ||
} | ||
|
||
.icon { | ||
margin-right: 1rem; | ||
width: 2.4rem; | ||
height: 2.4rem; | ||
} |
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
8 changes: 4 additions & 4 deletions
8
client/src/useMinLoadingTime.js → client/src/hooks/useMinLoadingTime.js
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,21 +1,21 @@ | ||
import { useState, useEffect } from "react"; | ||
|
||
const useMinLoadingTime = (minTime) => { | ||
const [minTimeElapsed, setMinTimeElapsed] = useState(true); | ||
const [minLoadingTimeElapsed, setMinLoadingTimeElapsed] = useState(true); | ||
|
||
useEffect(() => { | ||
setMinTimeElapsed(false); | ||
setMinLoadingTimeElapsed(false); | ||
|
||
const timer = setTimeout(() => { | ||
setMinTimeElapsed(true); | ||
setMinLoadingTimeElapsed(true); | ||
}, minTime); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [minTime]); | ||
|
||
return minTimeElapsed; | ||
return minLoadingTimeElapsed; | ||
}; | ||
|
||
export default useMinLoadingTime; |
File renamed without changes.