@squad-sports/react-native 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squad-sports/react-native",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Squad Sports Experience SDK for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,11 +1,13 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { ActivityIndicator, View } from 'react-native';
3
3
  import { createNativeStackNavigator } from '@react-navigation/native-stack';
4
+ import { useRecoilValue } from 'recoil';
4
5
 
5
6
  import { User } from '@squad-sports/core';
6
7
  import { useSquadSDK } from '../SquadProvider';
7
8
  import { Colors } from '../theme/ThemeContext';
8
9
  import { ScreenErrorBoundary } from '../components/ErrorBoundary';
10
+ import { featureFlags } from '../state/features';
9
11
 
10
12
  // Auth Screens
11
13
  import { LandingScreen } from '../screens/auth/LandingScreen';
@@ -133,6 +135,7 @@ type NavigationState = 'loading' | 'auth' | 'onboarding' | 'main';
133
135
  export function SquadNavigator() {
134
136
  const sdk = useSquadSDK();
135
137
  const [navState, setNavState] = useState<NavigationState>('loading');
138
+ const features = useRecoilValue(featureFlags);
136
139
 
137
140
  useEffect(() => {
138
141
  const determineRoute = async () => {
@@ -232,12 +235,12 @@ export function SquadNavigator() {
232
235
  <Stack.Screen name="BlockedUsers" component={withErrorBoundary(BlockedUsersScreen, 'BlockedUsers')} />
233
236
  <Stack.Screen name="DeleteAccount" component={withErrorBoundary(DeleteAccountScreen, 'DeleteAccount')} />
234
237
  <Stack.Screen name="Events" component={withErrorBoundary(EventScreen, 'Events')} />
235
- <Stack.Screen name="Wallet" component={withErrorBoundary(WalletScreen, 'Wallet')} />
238
+ {features.wallet && <Stack.Screen name="Wallet" component={withErrorBoundary(WalletScreen, 'Wallet')} />}
236
239
  <Stack.Screen name="Messaging" component={withErrorBoundary(MessagingScreen, 'Messaging')} />
237
240
  <Stack.Screen name="FreestyleCreate" component={withErrorBoundary(FreestyleCreationScreen, 'FreestyleCreate')} />
238
241
  <Stack.Screen name="PollResponse" component={withErrorBoundary(PollResponseScreen, 'PollResponse')} />
239
242
  <Stack.Screen name="Invite" component={withErrorBoundary(InviteScreen, 'Invite')} />
240
- <Stack.Screen name="AddCallTitle" component={withErrorBoundary(AddCallTitleScreen, 'AddCallTitle')} />
243
+ {features.squadLine && <Stack.Screen name="AddCallTitle" component={withErrorBoundary(AddCallTitleScreen, 'AddCallTitle')} />}
241
244
  <Stack.Screen name="Freestyle" component={withErrorBoundary(FreestyleScreen, 'Freestyle')} />
242
245
  <Stack.Screen name="FreestyleListens" component={withErrorBoundary(FreestyleListensScreen, 'FreestyleListens')} />
243
246
  <Stack.Screen name="FreestyleReactions" component={withErrorBoundary(FreestyleReactionsScreen, 'FreestyleReactions')} />
@@ -246,17 +249,19 @@ export function SquadNavigator() {
246
249
  <Stack.Screen name="PollSummation" component={withErrorBoundary(PollSummationScreen, 'PollSummation')} />
247
250
  <Stack.Screen name="InvitationQrCode" component={withErrorBoundary(InvitationQrCodeScreen, 'InvitationQrCode')} />
248
251
  <Stack.Screen name="NetworkStatus" component={withErrorBoundary(NetworkStatusScreen, 'NetworkStatus')} />
249
- <Stack.Screen
250
- name="ActiveCall"
251
- component={withErrorBoundary(CallScreen, 'ActiveCall')}
252
- options={{ animation: 'slide_from_bottom', gestureEnabled: false }}
253
- />
252
+ {features.squadLine && (
253
+ <Stack.Screen
254
+ name="ActiveCall"
255
+ component={withErrorBoundary(CallScreen, 'ActiveCall')}
256
+ options={{ animation: 'slide_from_bottom', gestureEnabled: false }}
257
+ />
258
+ )}
254
259
  </>
255
260
  )}
256
261
  </Stack.Navigator>
257
262
 
258
- {/* Global overlay for incoming calls */}
259
- <IncomingCallOverlay />
263
+ {/* Global overlay for incoming calls — only when Squad Line is enabled */}
264
+ {features.squadLine && <IncomingCallOverlay />}
260
265
  </>
261
266
  );
262
267
  }
@@ -10,9 +10,11 @@ import {
10
10
  import { useRoute, useNavigation } from '@react-navigation/native';
11
11
  import type { RouteProp } from '@react-navigation/native';
12
12
 
13
+ import { useRecoilValue } from 'recoil';
13
14
  import type { RootStackParamList } from '../../navigation/SquadNavigator';
14
15
  import { useApiClient } from '../../SquadProvider';
15
16
  import { useTheme, Colors } from '../../theme/ThemeContext';
17
+ import { featureFlags } from '../../state/features';
16
18
  import ScreenHeader from '../../components/ux/layout/ScreenHeader';
17
19
  import UserImage from '../../components/ux/user-image/UserImage';
18
20
  import Button from '../../components/ux/buttons/Button';
@@ -31,6 +33,7 @@ export function ProfileScreen() {
31
33
  const route = useRoute<Route>();
32
34
  const navigation = useNavigation();
33
35
  const apiClient = useApiClient();
36
+ const features = useRecoilValue(featureFlags);
34
37
  const { theme } = useTheme();
35
38
 
36
39
  const { userId } = route.params;
@@ -136,14 +139,16 @@ export function ProfileScreen() {
136
139
  Message
137
140
  </Text>
138
141
  </Button>
139
- <Button
140
- style={styles.actionButtonOutline}
141
- onPress={() =>
142
- (navigation as any).navigate('AddCallTitle', { connectionId: userId })
143
- }
144
- >
145
- <Text style={styles.actionButtonOutlineText}>Call</Text>
146
- </Button>
142
+ {features.squadLine && (
143
+ <Button
144
+ style={styles.actionButtonOutline}
145
+ onPress={() =>
146
+ (navigation as any).navigate('AddCallTitle', { connectionId: userId })
147
+ }
148
+ >
149
+ <Text style={styles.actionButtonOutlineText}>Call</Text>
150
+ </Button>
151
+ )}
147
152
  </View>
148
153
  )}
149
154
  </ScrollView>
@@ -8,12 +8,12 @@ import { atom, selector } from 'recoil';
8
8
  export const featureFlags = atom<Record<string, boolean>>({
9
9
  key: 'squad-sdk:features:flags',
10
10
  default: {
11
- squadLine: true,
11
+ squadLine: false,
12
12
  freestyle: true,
13
13
  messaging: true,
14
14
  polls: true,
15
15
  events: true,
16
- wallet: true,
16
+ wallet: false,
17
17
  },
18
18
  });
19
19