-
Notifications
You must be signed in to change notification settings - Fork 207
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
playground: enable Swap
in preview
#1136
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
type EnvironmentKey = (typeof ENVIRONMENT)[keyof typeof ENVIRONMENT]; | ||
|
||
export const ENVARS: Record<EnvironmentKey, string | undefined> = { |
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.
ENVARS sounds so evil.
Can we call it in a diffeerent way?
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.
renamed to ENVIRONMENT_VARIABLES
(full name) if thats better 🤔
@@ -94,7 +95,9 @@ function SwapComponent() { | |||
token={usdcToken} | |||
type="to" | |||
/> | |||
<SwapButton disabled={true} /> | |||
<SwapButton | |||
disabled={ENVARS[ENVIRONMENT.ENVIRONMENT] != 'development'} |
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.
btw, what you are looking is VERCEL_ENV === 'preview'
which is different from NEXT_PUBLIC_VERCEL_ENV
.
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.
We use this trick here for example https://github.com/coinbase/onchainkit/blob/main/playground/nextjs-app-router/next.config.mjs
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 - yep it's preview
not development
however NEXT_PUBLIC
prefix should work
Swap
in developmentSwap
in preview
What changed? Why?
ENVIRONMENT_VARIABLES
mapSwapButton
only onproduction
deployments (i.e. onchainkit.xyz/playground)we can swap on preview deployments off PRs since they are behind authentication
Notes to reviewers
How has it been tested?
can swap on preview deployment attached to this PR