Massive/Page.tsx
Brandon Presley 21d9149498 Quit trying to move timer logic into AlarmModule
I just can't figure out how to make the stop button
and delete intents work.
2022-10-24 14:45:21 +13:00

41 lines
867 B
TypeScript

import React from 'react';
import {StyleSheet, View} from 'react-native';
import {Searchbar} from 'react-native-paper';
import {PADDING} from './constants';
import MassiveFab from './MassiveFab';
export default function Page({
onAdd,
children,
search,
setSearch,
}: {
children: JSX.Element | JSX.Element[];
onAdd?: () => void;
search?: string;
setSearch?: (value: string) => void;
}) {
return (
<View style={styles.container}>
{typeof search === 'string' && setSearch && (
<Searchbar
placeholder="Search"
value={search}
onChangeText={setSearch}
icon="search"
clearIcon="clear"
/>
)}
{children}
{onAdd && <MassiveFab onPress={onAdd} />}
</View>
);
}
const styles = StyleSheet.create({
container: {
flexGrow: 1,
padding: PADDING,
},
});