aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/UniversityIcon.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-30 11:36:44 -0800
committerGitHub <noreply@github.com>2020-12-30 14:36:44 -0500
commit38661e00281363b0f4ad32f0b29d739e1ca09164 (patch)
tree316cd837b6cc6ae24783f1d93d6c9ee7fb898f68 /src/components/profile/UniversityIcon.tsx
parentbd2f89805d0bb1c2f1d08fe8d91099aa4f109d35 (diff)
[TMA - 457]Change followers to friends (#149)
* One commit to replace followers with friends * Move block unblock to drawer and some cosmetic changes * Options to edit own profile when viewing * Changes for University Class * Small fix * Made ProfileOnboarding a scroll view and other small changes * Small fix * Small fix thanks to ivan and tanmay * Add ?
Diffstat (limited to 'src/components/profile/UniversityIcon.tsx')
-rw-r--r--src/components/profile/UniversityIcon.tsx58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/components/profile/UniversityIcon.tsx b/src/components/profile/UniversityIcon.tsx
new file mode 100644
index 00000000..15c23715
--- /dev/null
+++ b/src/components/profile/UniversityIcon.tsx
@@ -0,0 +1,58 @@
+import React from 'react';
+import {StyleSheet, ViewProps} from 'react-native';
+import {Image, Text, View} from 'react-native-animatable';
+import {getUniversityClass} from '../../utils';
+
+export interface UniversityIconProps extends ViewProps {
+ university: string;
+ university_class: number;
+}
+
+/**
+ * Component to display university icon and class
+ */
+const UniversityIcon: React.FC<UniversityIconProps> = ({
+ style,
+ university,
+ university_class,
+}) => {
+ var universityIcon;
+ switch (university) {
+ case 'brown':
+ universityIcon = require('../../assets/universities/brown.png');
+ break;
+ default:
+ universityIcon = require('../../assets/universities/brown.png');
+ break;
+ }
+
+ return (
+ <View style={[styles.container, style]}>
+ <Image source={universityIcon} style={styles.icon} />
+ <Text style={styles.univClass}>
+ {getUniversityClass(university_class)}
+ </Text>
+ </View>
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ flexDirection: 'column',
+ flexWrap: 'wrap',
+ justifyContent: 'center',
+ marginBottom: '10%',
+ },
+ univClass: {
+ fontSize: 15,
+ fontWeight: '500',
+ },
+ icon: {
+ alignSelf: 'center',
+ width: 20,
+ height: 22.5,
+ },
+});
+
+export default UniversityIcon;