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