File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
const { currentUser } = useAuth ();
3
+ const loginFeature = useFeature (' login' );
3
4
</script >
4
5
5
6
<template >
@@ -10,14 +11,14 @@ const { currentUser } = useAuth();
10
11
<span class =" max-md:hidden md:text-xl" >Mums & Dads</span >
11
12
</NavigationLink >
12
13
<ul class =" flex items-center gap-3" >
13
- <li v-if =" currentUser === null" >
14
+ <li v-if =" loginFeature && currentUser === null" >
14
15
<a
15
16
class =" cursor-pointer font-bold text-white hover:text-white hover:no-underline md:text-xl"
16
17
href =" /api/auth/signIn" >
17
18
Log In
18
19
</a >
19
20
</li >
20
- <li v-if =" currentUser !== null" >
21
+ <li v-if =" loginFeature && currentUser !== null" >
21
22
<NavigationLink to =" /portal" >
22
23
<span class =" md:text-xl" >Portal</span >
23
24
</NavigationLink >
Original file line number Diff line number Diff line change
1
+ export default function ( feature : FeatureFlag ) : boolean {
2
+ const url = useRequestURL ( ) ;
3
+ const featureFlags =
4
+ new URLSearchParams ( url . search ) . get ( 'featureFlags' ) ?. split ( ',' ) || [ ] ;
5
+
6
+ return featureFlags . includes ( feature ) ;
7
+ }
Original file line number Diff line number Diff line change @@ -19,3 +19,5 @@ declare const stateOptions = [
19
19
'closed'
20
20
] as const ;
21
21
declare type State = ( typeof stateOptions ) [ number ] ;
22
+
23
+ declare type FeatureFlag = 'login' ;
You can’t perform that action at this time.
0 commit comments