diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-07 17:53:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 17:53:27 -0400 |
commit | 5ef5b0776cbbde697919308bbfbab2aed00ca493 (patch) | |
tree | 0180365917b8483c660435381fb1e83393caee45 /src/components/suggestedPeople/BadgeIcon.tsx | |
parent | 63c5de57ea2989fd2b66211a06b51bb42c5d20ea (diff) | |
parent | c18b2436897cd92e7a33c33c75e13dba1fec8ffe (diff) |
Merge pull request #455 from IvanIFChen/tma878-profile-badges
[TMA-878] Profile Badges
Diffstat (limited to 'src/components/suggestedPeople/BadgeIcon.tsx')
-rw-r--r-- | src/components/suggestedPeople/BadgeIcon.tsx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/components/suggestedPeople/BadgeIcon.tsx b/src/components/suggestedPeople/BadgeIcon.tsx index 8f576a43..616bac93 100644 --- a/src/components/suggestedPeople/BadgeIcon.tsx +++ b/src/components/suggestedPeople/BadgeIcon.tsx @@ -1,24 +1,17 @@ import {useNavigation} from '@react-navigation/core'; import React from 'react'; -import { - Image, - ImageSourcePropType, - StyleProp, - StyleSheet, - ViewStyle, -} from 'react-native'; +import {Image, StyleProp, StyleSheet, ViewStyle} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; import LinearGradient from 'react-native-linear-gradient'; -import {UniversityBadge} from '../../types'; +import {UniversityBadgeDisplayType} from '../../types'; import {normalize} from '../../utils'; interface BadgeIconProps { - badge: UniversityBadge; - img: ImageSourcePropType; + badge: UniversityBadgeDisplayType; style?: StyleProp<ViewStyle>; } -const BadgeIcon: React.FC<BadgeIconProps> = ({badge, img, style}) => { +const BadgeIcon: React.FC<BadgeIconProps> = ({badge, style}) => { const navigation = useNavigation(); return ( <TouchableOpacity @@ -27,7 +20,7 @@ const BadgeIcon: React.FC<BadgeIconProps> = ({badge, img, style}) => { navigation.navigate('MutualBadgeHolders', { badge_id: badge.id, badge_title: badge.name, - badge_img: img, + badge_img: badge.img, }); }}> <LinearGradient @@ -36,7 +29,7 @@ const BadgeIcon: React.FC<BadgeIconProps> = ({badge, img, style}) => { angle={154.72} angleCenter={{x: 0.5, y: 0.5}} style={styles.badgeBackground}> - <Image source={img} style={styles.icon} /> + <Image source={badge.img} style={styles.icon} /> </LinearGradient> </TouchableOpacity> ); |