Skip to content

Commit 12b33ca

Browse files
committed
feat: add brownfield-navigation to expo app
1 parent 8592f7d commit 12b33ca

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

apps/ExpoApp/RNApp.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SafeAreaView } from 'react-native-safe-area-context';
2-
import { StyleSheet, Text, View } from 'react-native';
2+
import { Button, StyleSheet, Text, View } from 'react-native';
33
import Counter from './components/counter';
4+
import BrownfieldNavigation from '@callstack/brownfield-navigation';
45

56
export default function RNApp() {
67
return (
@@ -9,6 +10,15 @@ export default function RNApp() {
910

1011
<View style={styles.content}>
1112
<Counter />
13+
14+
<Button
15+
title="Navigate to Settings"
16+
onPress={() => BrownfieldNavigation.navigateToSettings()}
17+
/>
18+
<Button
19+
title="Navigate to Referrals"
20+
onPress={() => BrownfieldNavigation.navigateToReferrals('123')}
21+
/>
1222
</View>
1323
</SafeAreaView>
1424
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export interface BrownfieldNavigationSpec {
2+
/**
3+
* Navigate to the native settings screen
4+
*/
5+
navigateToSettings(): void;
6+
7+
/**
8+
* Navigate to the native referrals screen
9+
* @param userId - The user's unique identifier
10+
*/
11+
navigateToReferrals(userId: string): void;
12+
}

apps/ExpoApp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"brownfield:package:ios": "brownfield package:ios --scheme BrownfieldLib --configuration Release"
1717
},
1818
"dependencies": {
19+
"@callstack/brownfield-navigation": "workspace:^",
1920
"@callstack/brownie": "workspace:^",
2021
"@callstack/react-native-brownfield": "workspace:^",
2122
"@expo/vector-icons": "^15.0.3",

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,6 +2255,7 @@ __metadata:
22552255
version: 0.0.0-use.local
22562256
resolution: "@callstack/brownfield-example-expo-app@workspace:apps/ExpoApp"
22572257
dependencies:
2258+
"@callstack/brownfield-navigation": "workspace:^"
22582259
"@callstack/brownie": "workspace:^"
22592260
"@callstack/react-native-brownfield": "workspace:^"
22602261
"@expo/vector-icons": "npm:^15.0.3"

0 commit comments

Comments
 (0)