-
Notifications
You must be signed in to change notification settings - Fork 6
Fix tutorial journey and typos #71
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,34 @@ | ||
| import React from 'react'; | ||
| import PathMap from './PathMap'; | ||
| import { Routes, Route, HashRouter as Router } from 'react-router-dom'; | ||
| import { | ||
| Routes, | ||
| Route, | ||
| BrowserRouter as Router, | ||
| createBrowserRouter, | ||
| RouterProvider, | ||
| createRoutesFromElements, | ||
| } from 'react-router-dom'; | ||
| import UserMessage from './UserMessage'; | ||
|
|
||
| export function UserMessageSection({ setjsonPathMap, jsonPathMap }) { | ||
| return ( | ||
| <Router> | ||
| <Route | ||
| render={({ location }) => ( | ||
| <Routes location={location}> | ||
| <Route | ||
| // pathId - URL param for directly accessing particular path. | ||
| path='/:pathId?' | ||
| component={({ match }) => ( | ||
| <div className={'fade-in-to-right'}> | ||
| <UserMessage | ||
| pathId={match.params.pathId} | ||
| setjsonPathMap={(json) => setjsonPathMap(json)} | ||
| jsonPathMap={jsonPathMap} | ||
| /> | ||
| </div> | ||
| )} | ||
| /> | ||
|
|
||
| <Route path='/map' component={PathMap} /> | ||
| </Routes> | ||
| )} | ||
| /> | ||
| </Router> | ||
| const router = createBrowserRouter( | ||
| createRoutesFromElements( | ||
| <> | ||
| <Route path="/map" element={PathMap} /> | ||
| <Route | ||
| path="/AdventureSite" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might need some clarification here, from |
||
| element={ | ||
| <div className={'fade-in-to-right'}> | ||
| <UserMessage | ||
| setjsonPathMap={(json) => setjsonPathMap(json)} | ||
| jsonPathMap={jsonPathMap} | ||
| /> | ||
| </div> | ||
| } | ||
| /> | ||
| </> | ||
| ) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original implementation was giving an error that complained |
||
| ); | ||
|
|
||
| return <RouterProvider router={router} />; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { PATH_ID_QUERY_PARAM } from '../../consts/URLConsts'; | ||
|
|
||
| export default function createPathIdQuery(paramValue) { | ||
| return PATH_ID_QUERY_PARAM + paramValue; | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I wanted to avoid making huge underlying changes I've made the existing |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const PATH_ID_QUERY_PARAM = '?pathId='; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,19 @@ | ||
| import ContributionResources from "."; | ||
|
|
||
| export default { | ||
| 'user-responses': [ | ||
| { | ||
| name: 'How to work with Git?', | ||
| link: 'http://learngitbranching.js.org/', | ||
| }, | ||
| { | ||
| name: 'How to work with forks?', | ||
| link: 'https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/working-with-forks' | ||
| }, | ||
| { | ||
| name: 'Done. What else should I know about?', | ||
| child: ContributionResources, | ||
| }, | ||
| ], | ||
| 'gooey-response': { | ||
| gooey: 'New to Git / GitHub? Check this out.', | ||
| 'user-responses': [ | ||
| { | ||
| name: 'How to work with Git?', | ||
| link: 'http://learngitbranching.js.org/', | ||
| }, | ||
| }; | ||
|
|
||
| { | ||
| name: 'How to work with forks?', | ||
| link: 'https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/working-with-forks', | ||
| }, | ||
| { | ||
| name: 'Done. What else should I know about?', | ||
| jump: 'u0u2u0u0', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This particular component was causing a circular dependency problem that crashed the app on startup as it referred to the |
||
| }, | ||
| ], | ||
| 'gooey-response': { | ||
| gooey: 'New to Git / GitHub? Check this out.', | ||
| }, | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell in the previous implementation I'm guessing
pathIdis used as a search parameter. Inreact-router-domv6 the new way to get search parameters isuseSearchParamsso I updated the code to use this to fetch the actual 'pathId' value