msd-d / PetHub

An app for animal adoption.
1 stars 0 forks source link

`profile`: Make info component #61

Closed Kechr closed 2 years ago

Kechr commented 2 years ago

Fix todo at line 129.

kepet19 commented 2 years ago

What is Make info component? also I am not sure what todo at line 129 is, maybe it has changed?

Kechr commented 2 years ago

Yes, it is at line 177 now.
Right now the info section of the profile page is like this:

            <View style={profileStyle.row}>
              <Ionicons name={"call"} size={30} color={colors.darkGray} />
              <Text style={profileStyle.infoText}> {phone} </Text>
            </View>
            <View style={profileStyle.row}>
              <Ionicons name={"at"} size={30} color={colors.darkGray} />
              <Text style={profileStyle.infoText}>{email} </Text>
            </View>
            <View style={profileStyle.row}>
              <Ionicons name={"pin"} size={30} color={colors.darkGray} />
              <Text style={profileStyle.infoText}>{location} </Text>
            </View>

Which contains a lot of duplicated lines. To make it easier to maintain, and understand, the view should be made into a component (or just a function) where iconName and Text are passed as props.