diff --git a/Select.tsx b/Select.tsx index 03a0f7c..5e580a1 100644 --- a/Select.tsx +++ b/Select.tsx @@ -1,6 +1,6 @@ import {useCallback, useMemo, useState} from 'react' -import {Button, Menu, useTheme} from 'react-native-paper' -import {MARGIN} from './constants' +import {View} from 'react-native' +import {Button, Menu, Subheading, useTheme} from 'react-native-paper' export interface Item { value: string @@ -12,10 +12,12 @@ export default function Select({ value, onChange, items, + label, }: { value: string onChange: (value: string) => void items: Item[] + label?: string }) { const [show, setShow] = useState(false) const {colors} = useTheme() @@ -34,27 +36,33 @@ export default function Select({ ) return ( - setShow(false)} - anchor={ - - }> - {items.map(item => ( - handlePress(item.value)} - /> - ))} - + + {label && {label}} + setShow(false)} + anchor={ + + }> + {items.map(item => ( + handlePress(item.value)} + /> + ))} + + ) } diff --git a/SettingsPage.tsx b/SettingsPage.tsx index 0978e35..72026a8 100644 --- a/SettingsPage.tsx +++ b/SettingsPage.tsx @@ -6,9 +6,10 @@ import { FlatList, NativeModules, Platform, + View, } from 'react-native' import DocumentPicker from 'react-native-document-picker' -import {Button} from 'react-native-paper' +import {Button, Subheading} from 'react-native-paper' import {darkColors, lightColors} from './colors' import {MARGIN} from './constants' import {settingsRepo} from './db' @@ -232,6 +233,7 @@ export default function SettingsPage() { /> {'theme'.includes(term.toLowerCase()) && ( ({ - label: `Light color: ${color.name}`, + label: color.name, value: color.hex, color: color.hex, }))} @@ -267,18 +271,22 @@ export default function SettingsPage() {