mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-01 12:56:29 +01:00
Some checks failed
🏗️ Build Apps / 🤖 Build Android APK (Phone) (push) Has been cancelled
🏗️ Build Apps / 🤖 Build Android APK (TV) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build iOS IPA (Phone) (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
86 lines
2.7 KiB
TypeScript
86 lines
2.7 KiB
TypeScript
import { Ionicons } from "@expo/vector-icons";
|
|
import { Stack } from "expo-router";
|
|
import { useState } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { Platform, TouchableOpacity } from "react-native";
|
|
import { LibraryOptionsSheet } from "@/components/settings/LibraryOptionsSheet";
|
|
import { nestedTabPageScreenOptions } from "@/components/stacks/NestedTabPageStack";
|
|
import { useSettings } from "@/utils/atoms/settings";
|
|
|
|
export default function IndexLayout() {
|
|
const { settings, updateSettings, pluginSettings } = useSettings();
|
|
const [optionsSheetOpen, setOptionsSheetOpen] = useState(false);
|
|
|
|
const { t } = useTranslation();
|
|
|
|
if (!settings?.libraryOptions) return null;
|
|
|
|
return (
|
|
<>
|
|
<Stack>
|
|
<Stack.Screen
|
|
name='index'
|
|
options={{
|
|
headerShown: !Platform.isTV,
|
|
headerTitle: t("tabs.library"),
|
|
headerBlurEffect: "none",
|
|
headerTransparent: Platform.OS === "ios",
|
|
headerShadowVisible: false,
|
|
headerRight: () =>
|
|
!pluginSettings?.libraryOptions?.locked &&
|
|
!Platform.isTV && (
|
|
<TouchableOpacity
|
|
onPress={() => setOptionsSheetOpen(true)}
|
|
className='flex flex-row items-center justify-center w-9 h-9'
|
|
>
|
|
<Ionicons
|
|
name='ellipsis-horizontal-outline'
|
|
size={24}
|
|
color='white'
|
|
/>
|
|
</TouchableOpacity>
|
|
),
|
|
}}
|
|
/>
|
|
<Stack.Screen
|
|
name='[libraryId]'
|
|
options={{
|
|
title: "",
|
|
headerShown: !Platform.isTV,
|
|
headerBlurEffect: "none",
|
|
headerTransparent: Platform.OS === "ios",
|
|
headerShadowVisible: false,
|
|
}}
|
|
/>
|
|
{Object.entries(nestedTabPageScreenOptions).map(([name, options]) => (
|
|
<Stack.Screen key={name} name={name} options={options} />
|
|
))}
|
|
<Stack.Screen
|
|
name='collections/[collectionId]'
|
|
options={{
|
|
title: "",
|
|
headerShown: !Platform.isTV,
|
|
headerBlurEffect: "none",
|
|
headerTransparent: Platform.OS === "ios",
|
|
headerShadowVisible: false,
|
|
}}
|
|
/>
|
|
</Stack>
|
|
<LibraryOptionsSheet
|
|
open={optionsSheetOpen}
|
|
setOpen={setOptionsSheetOpen}
|
|
settings={settings.libraryOptions}
|
|
updateSettings={(options) =>
|
|
updateSettings({
|
|
libraryOptions: {
|
|
...settings.libraryOptions,
|
|
...options,
|
|
},
|
|
})
|
|
}
|
|
disabled={pluginSettings?.libraryOptions?.locked}
|
|
/>
|
|
</>
|
|
);
|
|
}
|