Replace height percent setting with flex: 1
This way reacts better to changing the screen sizes. I think there was one bug where the fab wouldn't be precisely at the bottom of the page depending on the flat list length.
This commit is contained in:
parent
46f0875497
commit
9bd8fa9353
|
@ -65,11 +65,7 @@ export default function BestList() {
|
|||
description="Once sets have been added, this will highlight your personal bests."
|
||||
/>
|
||||
) : (
|
||||
<FlatList
|
||||
style={{height: '99%'}}
|
||||
renderItem={renderItem}
|
||||
data={bests}
|
||||
/>
|
||||
<FlatList style={{flex: 1}} renderItem={renderItem} data={bests} />
|
||||
)}
|
||||
</Page>
|
||||
);
|
||||
|
|
|
@ -87,8 +87,8 @@ export default function EditPlan() {
|
|||
);
|
||||
|
||||
return (
|
||||
<View style={{padding: PADDING}}>
|
||||
<ScrollView style={{height: '90%'}}>
|
||||
<View style={{padding: PADDING, flex: 1}}>
|
||||
<ScrollView style={{flex: 1}}>
|
||||
<Text style={styles.title}>Days</Text>
|
||||
{DAYS.map(day => (
|
||||
<Switch
|
||||
|
|
|
@ -118,8 +118,8 @@ export default function EditWorkout() {
|
|||
};
|
||||
|
||||
return (
|
||||
<View style={{padding: PADDING}}>
|
||||
<ScrollView style={{height: '90%'}}>
|
||||
<View style={{padding: PADDING, flex: 1}}>
|
||||
<ScrollView style={{flex: 1}}>
|
||||
<MassiveInput
|
||||
autoFocus
|
||||
label="Name"
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function MassiveFab(
|
|||
style={{
|
||||
position: 'absolute',
|
||||
right: 10,
|
||||
bottom: 60,
|
||||
bottom: 10,
|
||||
backgroundColor: color,
|
||||
}}
|
||||
{...props}
|
||||
|
|
1
Page.tsx
1
Page.tsx
|
@ -34,6 +34,5 @@ const styles = StyleSheet.create({
|
|||
container: {
|
||||
flexGrow: 1,
|
||||
padding: PADDING,
|
||||
paddingBottom: '10%',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ export default function PlanList() {
|
|||
/>
|
||||
) : (
|
||||
<FlatList
|
||||
style={{height: '99%'}}
|
||||
style={{flex: 1}}
|
||||
data={plans}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={set => set.id?.toString() || ''}
|
||||
|
|
|
@ -95,7 +95,7 @@ export default function SetList() {
|
|||
) : (
|
||||
<FlatList
|
||||
data={sets}
|
||||
style={{height: '99%'}}
|
||||
style={{flex: 1}}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={s => s.id!.toString()}
|
||||
onEndReached={next}
|
||||
|
|
|
@ -88,7 +88,7 @@ export default function WorkoutList() {
|
|||
) : (
|
||||
<FlatList
|
||||
data={workouts}
|
||||
style={{height: '99%'}}
|
||||
style={{flex: 1}}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={w => w.name}
|
||||
onEndReached={next}
|
||||
|
|
Loading…
Reference in New Issue
Block a user