Skip to content

Commit

Permalink
Changed key to index for OptionSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Webster committed Feb 2, 2024
1 parent 05ff108 commit bc19d9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/OptionSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default function OptionSelector({options, selected, setOption}) {
return (
<View style={{flexDirection: 'row'}}>
{
options.map(option => {
options.map((option, index) => {
const optionSelected = selected === option
return (
<TouchableOpacity key={option} onPress={() => setOption(option)} style={{flex: 1, justifyContent: 'flex-end', alignItems: 'center', borderColor: optionSelected ? colors.brand : colors.tertiary, borderBottomWidth: 2}}>
<TouchableOpacity key={index} onPress={() => setOption(option)} style={{flex: 1, justifyContent: 'flex-end', alignItems: 'center', borderColor: optionSelected ? colors.brand : colors.tertiary, borderBottomWidth: 2}}>
<Text style={{color: optionSelected ? colors.brand : colors.tertiary, fontSize: 20, fontWeight: 'bold', textAlign: 'center'}}>{option.toUpperCase()}</Text>
</TouchableOpacity>
)
Expand Down

0 comments on commit bc19d9f

Please sign in to comment.