Skip to content

Commit

Permalink
chore: debug menu in prod
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Jan 2, 2025
1 parent 6d10d67 commit c7f64e8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions apps/mobile/src/screens/(modal)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default function ModalLayout() {
title: "RSSHub Form",
}}
/>
<Stack.Screen
name="loading"
options={{ presentation: "transparentModal", headerShown: false, animation: "fade" }}
/>
</Stack>
)
}
12 changes: 12 additions & 0 deletions apps/mobile/src/screens/(modal)/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { router } from "expo-router"
import { Text, TouchableOpacity, View } from "react-native"

export default function Loading() {
return (
<View className="flex-1 items-center justify-center bg-transparent">
<TouchableOpacity onPress={() => router.back()}>
<Text className="text-text">Loading...</Text>
</TouchableOpacity>
</View>
)
}
17 changes: 16 additions & 1 deletion apps/mobile/src/screens/(stack)/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FeedViewType } from "@follow/constants"
import { PlatformPressable } from "@react-navigation/elements/src/PlatformPressable"
import { Tabs } from "expo-router"
import { router, Tabs } from "expo-router"
import { View } from "react-native"
import { Gesture, GestureDetector } from "react-native-gesture-handler"
import { runOnJS } from "react-native-reanimated"
Expand All @@ -19,6 +19,12 @@ const doubleTap = Gesture.Tap()
runOnJS(setCurrentView)(FeedViewType.Articles)
})

const fifthTap = Gesture.Tap()
.numberOfTaps(5)
.onStart(() => {
runOnJS(router.push)("/debug")
})

export default function TabLayout() {
return (
<Tabs
Expand Down Expand Up @@ -63,6 +69,15 @@ export default function TabLayout() {
options={{
title: "Settings",
headerShown: false,
tabBarButton(props) {
return (
<GestureDetector gesture={fifthTap}>
<View className="flex-1">
<PlatformPressable {...props} />
</View>
</GestureDetector>
)
},
tabBarIcon: ({ color, focused }) => {
const Icon = !focused ? Settings7CuteReIcon : Setting7CuteFi
return <Icon color={color} width={24} height={24} />
Expand Down
3 changes: 1 addition & 2 deletions apps/mobile/src/screens/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export default function RootLayout() {
<Stack.Screen name="(modal)" options={{ headerShown: false, presentation: "modal" }} />
</Stack>

{/* {__DEV__ && <DebugButton />} */}
<DebugButton />
{__DEV__ && <DebugButton />}
</RootProviders>
)
}
Expand Down

0 comments on commit c7f64e8

Please sign in to comment.