import { Column, Host, ListItem, ModalBottomSheet, Row, SegmentedButton, SingleChoiceSegmentedButtonRow, Slider, Switch, Text, } from '@expo/ui/jetpack-compose'; import { fillMaxWidth, padding, weight } from '@expo/ui/jetpack-compose/modifiers'; import { StyleSheet } from 'react-native'; import { useAndroidColors } from './material'; import { FONT_SIZE, SUGGESTIONS, SWITCHES } from './settingsRows'; import type { SettingsSheetProps } from './types'; // A modal bottom sheet of list items: switches, segmented buttons and a slider, all Material 3. export function SettingsSheet({ scheme, open, onClose, settings, onChange }: SettingsSheetProps) { const colors = useAndroidColors(scheme); const rowColors = { containerColor: colors.surfaceContainerLow }; return ( {open ? ( Settings {SWITCHES.map(([key, name]) => ( {name} onChange({ [key]: on })} /> ))} Suggestions {SUGGESTIONS.map(([value, name]) => ( onChange({ suggestions: value })} > {name} ))} Font size onChange({ fontSize: Math.round(value) })} modifiers={[weight(1)]} /> {`${settings.fontSize}`} ) : null} ); } const styles = StyleSheet.create({ anchor: { position: 'absolute', width: 0, height: 0 }, });