Massive/Page.tsx

40 lines
787 B
TypeScript
Raw Normal View History

import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native'
2022-10-31 04:22:08 +00:00
import {Searchbar} from 'react-native-paper'
2022-12-29 00:57:19 +00:00
import AppFab from './AppFab'
2022-10-31 04:22:08 +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
placeholder="Search"
value={term}
onChangeText={search}
2022-09-28 03:49:29 +00:00
icon="search"
2022-09-28 03:50:07 +00:00
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
})