Repository navigation
feat(new-webui): Add support for page switching using react-router. #797
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
Changes from 20 commits
e7dce76
df9c602
3c475f6
e554796
976c889
1587060
2f3582c
2837d59
e4a4be6
25ce98a
712af39
f433ee7
d84bcf9
02bbfc7
c36902c
6acc4f9
240e4b8
4049669
2a9c75e
f8f176c
4d40764
748b3c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /** | ||
| * Presents compression statistics. | ||
| * | ||
| * @return | ||
| */ | ||
| const IngestView = () => { | ||
| return ( | ||
| <div> | ||
| <h1>Ingest View</h1> | ||
| <p>This is the Ingest view.</p> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
|
|
||
| export default IngestView; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /** | ||
| * Provides a search interface that allows users to query archives and visualize search results. | ||
| * | ||
| * @return | ||
| */ | ||
| const SearchView = () => { | ||
| return ( | ||
| <div> | ||
| <h1>Search View</h1> | ||
| <p>This is the Search view.</p> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
|
|
||
| export default SearchView; |
|
davemarco marked this conversation as resolved.
Resolved
Member
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.
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| import {createBrowserRouter} from "react-router"; | ||||||
|
|
||||||
| import MainLayout from "./components/Layout/MainLayout"; | ||||||
| import IngestView from "./pages/IngestPage"; | ||||||
| import SearchView from "./pages/SearchPage"; | ||||||
|
|
||||||
|
|
||||||
| const router = createBrowserRouter([ | ||||||
|
Member
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.
Suggested change
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 took this syntax from their docs. Unless u have strong opinions i would leave it to match
Member
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. we've been using SNAKE_CASE for global constants but i do get variables are mostly
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.
Member
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 discussed this offline with @kirkrodrigues and here're some consolidated thoughts (a copy of section https://www.notion.so/yscope/WIP-Coding-Guidelines-9a308b847a5343958ba3cb97a850be66?pvs=4#1cf04e4d9e6b80c7ac4fe69b846f5791) Naming convention for constants in JavaScript / TypeScriptJavaScript doesn't enforce deep immutability for
Additional Notes
Member
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. That said, let's make this object deeply frozen since the routes are not expected to be modified elsewhere. We will then rename the object and the filename to
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.
Member
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. sure. i just thought of another reason that we don't want to make it deeply frozen: if we are to support any plugins like an optional page. this is fine to leave then |
||||||
| { | ||||||
| path: "/", | ||||||
| Component: MainLayout, | ||||||
| children: [ | ||||||
| {path: "ingest", Component: IngestView}, | ||||||
| {path: "search", Component: SearchView}, | ||||||
| ], | ||||||
| }, | ||||||
| ]); | ||||||
|
|
||||||
|
davemarco marked this conversation as resolved.
Resolved
|
||||||
|
|
||||||
| export default router; | ||||||

Uh oh!
There was an error while loading. Please reload this page.