-
Notifications
You must be signed in to change notification settings - Fork 218
feat: Migrate bridge to app router #2600
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bdb4705
to
0fbf360
Compare
return `/?${params.toString()}` | ||
} | ||
|
||
async function sanitizeAndRedirect(searchParams: { |
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 replaces our old getServerSideProps
(not supported in app router)
if (!fromChainId) { | ||
return NextResponse.json( | ||
{ message: 'fromChainId is required', data: null }, | ||
{ status: 400 } | ||
) | ||
} | ||
|
||
if (!toChainId) { | ||
return NextResponse.json( | ||
{ message: 'toChainId is required', data: null }, | ||
{ status: 400 } | ||
) | ||
} |
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.
Those two checks were added because of Typescript (but it does make sense to have them)
- Example - to set the value of `?amount=` in browser, simply use | ||
`const [, setQueryParams] = useArbQueryParams()` | ||
`setQueryParams(newAmount)` | ||
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 file was split, otherwise importing it on server-side would fail (use-query-params
doesn't support server side import)
import { getArbitrumNetwork } from '@arbitrum/sdk' | ||
import { sanitizeNullSelectedToken } from '../util/queryParamUtils' | ||
|
||
export { sanitizeNullSelectedToken } from '../util/queryParamUtils' |
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 export is to minimize the diff, we can change it in a later PR
b31586f
to
776c495
Compare
0fbf360
to
6c16e75
Compare
776c495
to
6a16891
Compare
6c16e75
to
f3e6fac
Compare
6a16891
to
45d0284
Compare
f3e6fac
to
9c0140a
Compare
45d0284
to
e7974e1
Compare
9c0140a
to
d1e4dcc
Compare
e7974e1
to
66c544d
Compare
66c544d
to
91f5f87
Compare
Deployment failed with the following error:
Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
91f5f87
to
2c890b8
Compare
Deployment failed with the following error:
Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
2c890b8
to
8808e98
Compare
83341b5
to
83fb6e0
Compare
14063a9
to
88f0521
Compare
Depends on #2595. This PR is part of a stack created with Aviator.
portal/03-portal
master
Summary
Steps to test