File tree Expand file tree Collapse file tree 8 files changed +40
-12
lines changed
Expand file tree Collapse file tree 8 files changed +40
-12
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import type { FeatureFlag } from ' ~/types/feature-flags'
3-
42const props = defineProps <{
53 feature: FeatureFlag ,
64}>()
Original file line number Diff line number Diff line change 1- import type { FeatureFlag } from '~/types/feature-flags'
1+ export type FeatureFlag
2+ = | 'feature-account_dashboards'
3+ | 'feature-product-landing'
4+ | 'feature-user_settings'
25
36export const useFeatureFlag = ( ) => {
4- type Environment = 'development' | 'production' | 'staging'
5-
6- const currentEnvironment = useRuntimeConfig ( ) . public . deploymentType as Environment
7+ const currentEnvironment = useRuntimeConfig ( ) . public . deploymentType
78 if ( ! currentEnvironment ) {
89 throw createError ( 'Environment variable `deploymentType` is not provided.' )
910 }
1011
11- const staging : FeatureFlag [ ] = [ ]
12+ const staging : FeatureFlag [ ] = [ 'feature-product-landing' ]
1213 const development : FeatureFlag [ ] = [
1314 ...staging ,
1415 'feature-account_dashboards' ,
1516 'feature-user_settings' ,
1617 ]
17- const featureCatalog : Record < Environment , FeatureFlag [ ] > = {
18+ const featureCatalog : Record < typeof currentEnvironment , FeatureFlag [ ] > = {
1819 development,
1920 production : [ ] ,
2021 staging,
Original file line number Diff line number Diff line change 1+ declare module 'nuxt/schema' {
2+ interface PublicRuntimeConfig {
3+ deploymentType ?: 'development' | 'production' | 'staging' ,
4+ }
5+ }
6+ export { }
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ </script >
3+
4+ <template >
5+ <div >
6+ <NuxtLayout name =" base" >
7+ Product Landing Page
8+ <div >
9+ <BaseButton >
10+ Get Started
11+ </BaseButton >
12+ </div >
13+ </NuxtLayout >
14+ </div >
15+ </template >
Original file line number Diff line number Diff line change 1+ export default defineNuxtConfig ( {
2+ $meta : {
3+ name : 'products' ,
4+ } ,
5+ } )
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ export default function ({
3838 return redirectToV1 ( '/' )
3939 case 'mobile' :
4040 return redirectToV1 ( '/mobile' )
41+ case 'p' :
42+ case 'product' :
43+ if ( ! has ( 'feature-product-landing' ) ) {
44+ return abortNavigation ( )
45+ }
46+ break
4147 case 'privacy' :
4248 return redirect ( 'https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf' )
4349 case 'register' :
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default defineNuxtConfig({
6060 apiClient : process . env . PUBLIC_API_CLIENT ,
6161 apiKey : process . env . PUBLIC_API_KEY ,
6262 chainIdByDefault : process . env . PUBLIC_CHAIN_ID_BY_DEFAULT ,
63- deploymentType : process . env . PUBLIC_DEPLOYMENT_TYPE ,
63+ deploymentType : process . env . PUBLIC_DEPLOYMENT_TYPE as undefined ,
6464 domain : process . env . PUBLIC_DOMAIN ,
6565 gitVersion,
6666 isApiMocked : '' ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments