-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ [open-formulieren/open-forms#4929] Move cosign start and done page…
…s to routes object State/props are moved into a context provider that wraps around the outlet, taking care of the data loading. Once we're no longer the <Routes> approach, we can investigate what we can do with loaders to pass information/state around.
- Loading branch information
1 parent
51028bb
commit d0399cf
Showing
6 changed files
with
78 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, {useContext} from 'react'; | ||
|
||
const CosignContext = React.createContext({ | ||
reportDownloadUrl: '', | ||
}); | ||
|
||
CosignContext.displayName = 'CosignContext'; | ||
|
||
const CosignProvider = ({reportDownloadUrl = '', children}) => ( | ||
<CosignContext.Provider | ||
value={{ | ||
reportDownloadUrl, | ||
}} | ||
> | ||
{children} | ||
</CosignContext.Provider> | ||
); | ||
|
||
CosignProvider.propTypes = { | ||
reportDownloadUrl: PropTypes.string, | ||
}; | ||
|
||
const useCosignContext = () => useContext(CosignContext); | ||
|
||
export {CosignProvider, useCosignContext}; |
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,6 +1,7 @@ | ||
import CoSignOld from './CoSignOld'; | ||
import Cosign from './Cosign'; | ||
import CosignDone from './CosignDone'; | ||
import cosignRoutes from './routes'; | ||
|
||
export default CoSignOld; | ||
export {Cosign, CosignDone}; | ||
export {Cosign, CosignDone, cosignRoutes}; |
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,15 @@ | ||
import CosignDone from './CosignDone'; | ||
import CosignStart from './CosignStart'; | ||
|
||
const routes = [ | ||
{ | ||
path: 'start', | ||
element: <CosignStart />, | ||
}, | ||
{ | ||
path: 'done', | ||
element: <CosignDone />, | ||
}, | ||
]; | ||
|
||
export default routes; |