Skip to content

Commit 6b18923

Browse files
refactor(mobile): use shared scanner header actions
1 parent ab5fb81 commit 6b18923

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

‎apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ScreenScrollView as ScrollView } from "../../components/ScreenScrollView";
22
import { CameraView, useCameraPermissions } from "expo-camera";
3-
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
43
import {
54
StackActions,
65
useNavigation,
@@ -194,7 +193,8 @@ export function ConnectionsNewRouteScreen({
194193
actions={[
195194
{
196195
accessibilityLabel: showScanner ? "Close scanner" : "Scan QR code",
197-
icon: showScanner ? "xmark" : "camera",
196+
icon: showScanner ? "xmark" : Platform.OS === "ios" ? "qrcode.viewfinder" : "camera",
197+
tintColor: headerIconColor,
198198
onPress: () => {
199199
if (showScanner) {
200200
closeScanner();
@@ -205,26 +205,6 @@ export function ConnectionsNewRouteScreen({
205205
},
206206
]}
207207
>
208-
<NativeStackScreenOptions
209-
options={{ title: showScanner ? "Scan QR Code" : "Add Environment" }}
210-
/>
211-
{Platform.OS !== "android" ? (
212-
<NativeHeaderToolbar placement="right">
213-
<NativeHeaderToolbar.Button
214-
icon={showScanner ? "xmark" : "qrcode.viewfinder"}
215-
onPress={() => {
216-
if (showScanner) {
217-
closeScanner();
218-
} else {
219-
void openScanner();
220-
}
221-
}}
222-
separateBackground
223-
tintColor={headerIconColor}
224-
/>
225-
</NativeHeaderToolbar>
226-
) : null}
227-
228208
<ScrollView
229209
contentInsetAdjustmentBehavior="automatic"
230210
showsVerticalScrollIndicator={false}

0 commit comments

Comments
 (0)