mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
feat: intro screen
This commit is contained in:
@@ -30,9 +30,8 @@ export default function page() {
|
|||||||
<View>
|
<View>
|
||||||
<Text className="text-lg font-bold">Features</Text>
|
<Text className="text-lg font-bold">Features</Text>
|
||||||
<Text className="text-xs">
|
<Text className="text-xs">
|
||||||
Streamyfin has a bunch of features and integrates with a
|
Streamyfin has a bunch of features and integrates with a wide array of
|
||||||
wide array of software which you can find in the settings menu, these
|
software which you can find in the settings menu, these include:
|
||||||
include:
|
|
||||||
</Text>
|
</Text>
|
||||||
<View className="flex flex-row items-center mt-4">
|
<View className="flex flex-row items-center mt-4">
|
||||||
<Image
|
<Image
|
||||||
|
|||||||
@@ -75,6 +75,13 @@ export default function settings() {
|
|||||||
}}
|
}}
|
||||||
title={"Show intro"}
|
title={"Show intro"}
|
||||||
/>
|
/>
|
||||||
|
<ListItem
|
||||||
|
textColor="red"
|
||||||
|
onPress={() => {
|
||||||
|
storage.set("hasShownIntro", false);
|
||||||
|
}}
|
||||||
|
title={"Reset intro"}
|
||||||
|
/>
|
||||||
</ListGroup>
|
</ListGroup>
|
||||||
|
|
||||||
<View className="mb-4">
|
<View className="mb-4">
|
||||||
|
|||||||
@@ -13,14 +13,13 @@ const { Navigator } = createNativeBottomTabNavigator();
|
|||||||
import { BottomTabNavigationOptions } from "@react-navigation/bottom-tabs";
|
import { BottomTabNavigationOptions } from "@react-navigation/bottom-tabs";
|
||||||
|
|
||||||
import { Colors } from "@/constants/Colors";
|
import { Colors } from "@/constants/Colors";
|
||||||
|
import { useSettings } from "@/utils/atoms/settings";
|
||||||
|
import { storage } from "@/utils/mmkv";
|
||||||
import type {
|
import type {
|
||||||
ParamListBase,
|
ParamListBase,
|
||||||
TabNavigationState,
|
TabNavigationState,
|
||||||
} from "@react-navigation/native";
|
} from "@react-navigation/native";
|
||||||
import { SystemBars } from "react-native-edge-to-edge";
|
import { SystemBars } from "react-native-edge-to-edge";
|
||||||
import { useSettings } from "@/utils/atoms/settings";
|
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
|
||||||
import { storage } from "@/utils/mmkv";
|
|
||||||
|
|
||||||
export const NativeTabs = withLayoutContext<
|
export const NativeTabs = withLayoutContext<
|
||||||
BottomTabNavigationOptions,
|
BottomTabNavigationOptions,
|
||||||
@@ -32,16 +31,13 @@ export const NativeTabs = withLayoutContext<
|
|||||||
export default function TabLayout() {
|
export default function TabLayout() {
|
||||||
const [settings] = useSettings();
|
const [settings] = useSettings();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const hasNavigated = useRef(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
const hasShownIntro = storage.getBoolean("hasShownIntro");
|
const hasShownIntro = storage.getBoolean("hasShownIntro");
|
||||||
if (hasShownIntro === false && !hasNavigated.current) {
|
if (!hasShownIntro) {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
hasNavigated.current = true;
|
|
||||||
router.push("/intro/page");
|
router.push("/intro/page");
|
||||||
storage.set("hasShownIntro", true);
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user