Fix add button in homepage
This commit is contained in:
parent
7fdb576e27
commit
dc21f1266e
|
@ -24,7 +24,7 @@ export default function EditSet({
|
|||
const db = useContext(DatabaseContext);
|
||||
|
||||
useEffect(() => {
|
||||
if (set)
|
||||
if (set?.id)
|
||||
setNewSet({
|
||||
...set,
|
||||
reps: set.reps.toString(),
|
||||
|
|
5
Home.tsx
5
Home.tsx
|
@ -84,6 +84,7 @@ export default function Home() {
|
|||
<Searchbar placeholder="Search" value={search} onChangeText={setSearch} />
|
||||
<FlatList
|
||||
data={sets}
|
||||
style={{height: '100%'}}
|
||||
ListEmptyComponent={
|
||||
<List.Item
|
||||
title="No sets yet"
|
||||
|
@ -102,8 +103,8 @@ export default function Home() {
|
|||
extended={false}
|
||||
label="Add"
|
||||
icon="add"
|
||||
style={{position: 'absolute', right: 60, bottom: 70}}
|
||||
onPress={() => setEdit(undefined)}
|
||||
style={{position: 'absolute', right: 10, bottom: 50}}
|
||||
onPress={() => setEdit({} as Set)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
|
|
@ -44,6 +44,7 @@ export default function Plans() {
|
|||
<View style={styles.container}>
|
||||
<Searchbar value={search} onChangeText={setSearch} placeholder="Search" />
|
||||
<FlatList
|
||||
style={{height: '100%'}}
|
||||
data={plans}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={set => set.id.toString()}
|
||||
|
@ -71,7 +72,7 @@ export default function Plans() {
|
|||
extended={false}
|
||||
label="Add"
|
||||
icon="add"
|
||||
style={{position: 'absolute', right: 20, bottom: 20}}
|
||||
style={{position: 'absolute', right: 20, bottom: 50}}
|
||||
onPress={() => {
|
||||
setPlan(undefined);
|
||||
setShowEdit(true);
|
||||
|
@ -85,6 +86,7 @@ const styles = StyleSheet.create({
|
|||
container: {
|
||||
flexGrow: 1,
|
||||
padding: 10,
|
||||
paddingBottom: '10%',
|
||||
},
|
||||
progress: {
|
||||
marginTop: 10,
|
||||
|
|
Loading…
Reference in New Issue
Block a user