Massive/Page.tsx

40 lines
793 B
TypeScript
Raw Normal View History

2023-06-27 03:16:59 +00:00
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
import { Searchbar } from 'react-native-paper'
2022-12-29 00:57:19 +00:00
import AppFab from './AppFab'
2023-06-27 03:16:59 +00:00
import { PADDING } from './constants'
export default function Page({
onAdd,
children,
term,
search,
style,
}: {
2022-10-31 04:22:08 +00:00
children: JSX.Element | JSX.Element[]
onAdd?: () => void
term: string
search: (value: string) => void
style?: StyleProp<ViewStyle>
}) {
return (
<View style={[styles.view, style]}>
2022-09-28 03:49:29 +00:00
<Searchbar
2023-06-27 03:16:59 +00:00
placeholder='Search'
value={term}
onChangeText={search}
2023-06-27 03:16:59 +00:00
icon='search'
clearIcon='clear'
2022-09-28 03:49:29 +00:00
/>
{children}
2022-12-29 00:57:19 +00:00
{onAdd && <AppFab onPress={onAdd} />}
</View>
2022-10-31 04:22:08 +00:00
)
}
const styles = StyleSheet.create({
view: {
padding: PADDING,
flexGrow: 1,
},
2022-10-31 04:22:08 +00:00
})