Skip to content

Commit

Permalink
Merge pull request #131 from ucsb-cs184-f24/tylerc-fixpicker
Browse files Browse the repository at this point in the history
Fixed Picker Displays
  • Loading branch information
Xalex217 authored Dec 6, 2024
2 parents c335309 + 31e8015 commit 895f850
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions project/components/genderPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const GenderPickerModal: React.FC<GenderPickerProps> = ({
onGenderChange(value);
}}
style={styles.picker}
itemStyle={{ fontSize: 18, color: 'black' }}

>
<Picker.Item label="Male" value="male" />
<Picker.Item label="Female" value="female" />
Expand Down
7 changes: 5 additions & 2 deletions project/components/heightPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const HeightPickerModal: React.FC< HeightPickerModalProps > = ({ isVisible, onCl
selectedValue={Math.floor(height / 12)} // Feet part of height
onValueChange={(value) => onHeightChange(Number(value) * 12 + (height % 12))} // Update height in inches
style={styles.picker}
itemStyle={{ fontSize: 18, color: 'black' }}

>
{Array.from({ length: 4 }, (_, i) => (
<Picker.Item label={`${i + 4} feet`} value={i + 4} key={i} />
Expand All @@ -39,6 +41,7 @@ const HeightPickerModal: React.FC< HeightPickerModalProps > = ({ isVisible, onCl
selectedValue={height % 12}
onValueChange={(value) => onHeightChange(Math.floor(height / 12) * 12 + Number(value))} // Update height in inches
style={styles.picker}
itemStyle={{ fontSize: 18, color: 'black' }}
>
{Array.from({ length: 12 }, (_, i) => (
<Picker.Item label={`${i} inches`} value={i} key={i} />
Expand Down Expand Up @@ -77,12 +80,12 @@ const styles = StyleSheet.create({
},
modalPickers: {
flexDirection: 'row',
justifyContent: 'space-between',
justifyContent: 'space-around',
width: '100%',
marginBottom: 20,
},
picker: {
width: '40%',
width: '50%',
},
modalButton: {
paddingVertical: 10,
Expand Down
1 change: 1 addition & 0 deletions project/components/weightPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const WeightPickerModal: React.FC<WeightPickerModalProps> = ({
onWeightChange(Number(value));
}}
style={styles.picker}
itemStyle={{ fontSize: 18, color: 'black' }}
>
{Array.from({ length: 400 }, (_, i) => (
<Picker.Item label={`${i} Ibs`} value={i} key={i} />
Expand Down

0 comments on commit 895f850

Please # to comment.