-
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.
feat(client): include node in page urls
- Loading branch information
1 parent
d0e6eb3
commit c880fc2
Showing
8 changed files
with
100 additions
and
61 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,23 @@ | ||
import {useEffect} from "react"; | ||
import {useDispatch} from "react-redux"; | ||
import {Outlet, useParams} from "react-router-dom"; | ||
|
||
import {setNode} from "../../actions"; | ||
import {EPIVAR_NODES} from "../../config"; | ||
|
||
const DatasetPage = () => { | ||
const dispatch = useDispatch(); | ||
const {node} = useParams(); | ||
|
||
useEffect(() => { | ||
const decodedNode = decodeURIComponent(node); | ||
if (!EPIVAR_NODES.find((n) => n === decodedNode)) return; | ||
dispatch(setNode(decodedNode)); | ||
}, [dispatch, node]); | ||
|
||
return <div> | ||
<Outlet /> | ||
</div>; | ||
}; | ||
|
||
export default DatasetPage; |
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