aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/UniversityIcon.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-22 19:07:04 -0400
committerGitHub <noreply@github.com>2021-04-22 19:07:04 -0400
commit1f04e445e9d317bc141624a440a2c1e55f8704b3 (patch)
tree1d38b38e527955481aac1c45de65f6cf7ef600d3 /src/components/profile/UniversityIcon.tsx
parente8913cc0bdc432c20a008e852482c82c3bb3c2a0 (diff)
parentac082ed35d765f7182e95541d8eb9e2d9f033641 (diff)
Merge pull request #379 from ankit-thanekar007/tma-794-806-badge-profile-view
[TMA-794/806] Badge profile view
Diffstat (limited to 'src/components/profile/UniversityIcon.tsx')
-rw-r--r--src/components/profile/UniversityIcon.tsx28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/components/profile/UniversityIcon.tsx b/src/components/profile/UniversityIcon.tsx
index 4cb1abe6..cfe1366d 100644
--- a/src/components/profile/UniversityIcon.tsx
+++ b/src/components/profile/UniversityIcon.tsx
@@ -8,6 +8,7 @@ export interface UniversityIconProps extends ViewProps {
university: UniversityType;
university_class?: number;
imageStyle?: StyleProp<ImageStyle>;
+ needsShadow?: boolean;
}
/**
@@ -18,13 +19,16 @@ const UniversityIcon: React.FC<UniversityIconProps> = ({
university,
university_class,
imageStyle,
+ needsShadow = false,
}) => {
return (
<View style={[styles.container, style]}>
- <Image
- source={getUniversityBadge(university, 'Crest')}
- style={[styles.icon, imageStyle]}
- />
+ <View style={needsShadow && styles.shadowStyle}>
+ <Image
+ source={getUniversityBadge(university, 'Crest')}
+ style={[styles.icon, imageStyle]}
+ />
+ </View>
{university_class && (
<Text style={styles.univClass}>
{getUniversityClass(university_class)}
@@ -47,8 +51,20 @@ const styles = StyleSheet.create({
fontWeight: '500',
},
icon: {
- width: normalize(17),
- height: normalize(19),
+ width: normalize(12),
+ height: normalize(13),
+ },
+ shadowStyle: {
+ padding: 5,
+ borderRadius: 30,
+ shadowOffset: {
+ width: 1,
+ height: 1,
+ },
+ shadowOpacity: 1,
+ shadowRadius: 3,
+ shadowColor: 'rgba(0, 0, 0, 0.3)',
+ backgroundColor: 'white',
},
});