Skip to content

Commit

Permalink
feat: add onvoarding env config
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzkirstein committed Nov 25, 2024
1 parent 488948d commit 3d9434d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,7 @@ module.exports = {
faucet: {
enabled: process.env.NEXT_PUBLIC_FAUCET_ENABLED || 'false',
baseUri: 'https://faucet.api.pontus-x.eu'
}
},

showOnboardingModuleByDefault: process.env.NEXT_PUBLIC_SHOW_ONBOARDING_MODULE_BY_DEFAULT === 'true',
}
1 change: 1 addition & 0 deletions src/@context/MarketMetadata/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface AppConfig {
enabled: string
baseUri: string
}
showOnboardingModuleByDefault: boolean
}
export interface SiteContent {
siteTitle: string
Expand Down
6 changes: 2 additions & 4 deletions src/@context/UserPreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function UserPreferencesProvider({
const [chainIds, setChainIds] = useState(
localStorage?.chainIds || appConfig.chainIds
)
const { defaultPrivacyPolicySlug } = appConfig
const { defaultPrivacyPolicySlug, showOnboardingModuleByDefault } = appConfig

const [privacyPolicySlug, setPrivacyPolicySlug] = useState<string>(
localStorage?.privacyPolicySlug || defaultPrivacyPolicySlug
Expand All @@ -96,9 +96,7 @@ function UserPreferencesProvider({
)

const [showOnboardingModule, setShowOnboardingModule] = useState<boolean>(
localStorage?.showOnboardingModule === undefined
? false
: localStorage?.showOnboardingModule
localStorage?.showOnboardingModule ?? showOnboardingModuleByDefault
)

const [onboardingStep, setOnboardingStep] = useState<number>(
Expand Down

0 comments on commit 3d9434d

Please sign in to comment.