-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Handle Mobile and Desktop Specific routes #394
Conversation
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.
As mentioned yesterday we won't follow this approach.
695beeb
to
2d173ed
Compare
thegraph: ["the-graph"], | ||
trading: ["market", "trading-video", "economic-calendar"], | ||
verasity: ["verasity", "verasity-source"], | ||
vitalikbuterin: ["vitalki-buterin"], |
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.
typo
packages/frontend/src/routes.ts
Outdated
@@ -40,6 +40,8 @@ export interface IRoute { | |||
component: typeof ErrorPage | typeof PreloaderPage | typeof DashboardPage; | |||
exact?: boolean; | |||
isFullsize?: boolean; | |||
redirectTo?: string; | |||
type: "regular" | "redirect"; |
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.
note that this definition is inconsistent to the mobile route definition, and using a union type for type
doesn't allow for runtime casting
packages/frontend/src/App.tsx
Outdated
key={route.path} | ||
path={route.path} | ||
exact={route.exact} | ||
to={route.redirectTo ?? EDesktopRoutePaths.Base} |
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.
if the route is of type redirect
, the redirectTo
field shouldn't be optional (relates to my other comment on type definition).
packages/frontend/src/MobileApp.tsx
Outdated
const { IS_DEV } = CONFIG; | ||
const { IS_DEV, BOARDS } = CONFIG; | ||
|
||
const BoardRoutesHandler = ( |
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.
A function name which is not a react FC should never start with an uppercase. I keep telling you this, Charles. You are no longer a junior dev, you should pay more attention to coding style.
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.
Thanks @Xavier-Charles
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.
This looks good to me @Xavier-Charles
Thanks
In this PR View routes like
/b/aave
are resolved to search Routes using the board-slug map in the boards config.Also routes that contain
/superfeed
are rerouted to/
on desktop instead of 404