mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-05 05:28:37 +01:00
feat(settings): add typed switch/select/stepper setting rows
This commit is contained in:
38
components/settings/index/SettingsSelectRow.tsx
Normal file
38
components/settings/index/SettingsSelectRow.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import type React from "react";
|
||||
import { View } from "react-native";
|
||||
import { Text } from "@/components/common/Text";
|
||||
import { ListItem } from "@/components/list/ListItem";
|
||||
import {
|
||||
type OptionGroup,
|
||||
PlatformDropdown,
|
||||
} from "@/components/PlatformDropdown";
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
valueLabel?: string;
|
||||
groups: OptionGroup[];
|
||||
dropdownTitle?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const SettingsSelectRow: React.FC<Props> = ({
|
||||
title,
|
||||
valueLabel,
|
||||
groups,
|
||||
dropdownTitle,
|
||||
disabled,
|
||||
}) => (
|
||||
<ListItem title={title} disabled={disabled}>
|
||||
<PlatformDropdown
|
||||
groups={groups}
|
||||
title={dropdownTitle}
|
||||
trigger={
|
||||
<View className='flex flex-row items-center justify-between py-1.5 pl-3'>
|
||||
<Text className='mr-1 text-[#8E8D91]'>{valueLabel}</Text>
|
||||
<Ionicons name='chevron-expand-sharp' size={18} color='#5A5960' />
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
);
|
||||
Reference in New Issue
Block a user