aboutsummaryrefslogtreecommitdiff
path: root/src/screens/badge
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-13 17:49:43 -0400
committerGitHub <noreply@github.com>2021-05-13 17:49:43 -0400
commit36a26cc7716913e8b243553169ae91588bc8e413 (patch)
treeaf8afb1d4813c935cd3930e5a3c67cf7b7b8f0a3 /src/screens/badge
parentae0ad98d49f9626710ce90a211d4df608ae2c92f (diff)
parent45331d92a7c9f0a82b5799dba71b0e2f117156b3 (diff)
Merge pull request #417 from IvanIFChen/tma857-new-badges
[TMA-857] Added 17 new badges
Diffstat (limited to 'src/screens/badge')
-rw-r--r--src/screens/badge/BadgeItem.tsx33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/screens/badge/BadgeItem.tsx b/src/screens/badge/BadgeItem.tsx
index 1051d4a7..e4f1b1da 100644
--- a/src/screens/badge/BadgeItem.tsx
+++ b/src/screens/badge/BadgeItem.tsx
@@ -43,9 +43,15 @@ const BadgeItem: React.FC<BadgeItemProps> = ({
style={styles.item}>
<View style={styles.detailContainer}>
<Image source={resourcePath} style={styles.imageStyles} />
- <View style={styles.textContainer}>
- <Text style={styles.title}>{title}</Text>
- </View>
+ <Text
+ style={[
+ styles.title,
+ title.length > 30
+ ? {fontSize: normalize(12), lineHeight: normalize(16)}
+ : {},
+ ]}>
+ {title}
+ </Text>
</View>
</LinearGradient>
</TouchableOpacity>
@@ -53,33 +59,30 @@ const BadgeItem: React.FC<BadgeItemProps> = ({
);
};
+const ITEM_WIDTH = SCREEN_WIDTH / 3 - 20;
+
const styles = StyleSheet.create({
border: {
- width: SCREEN_WIDTH / 3 - 20 + 6,
- height: 146,
+ width: ITEM_WIDTH + 6,
+ height: 156,
marginLeft: 10,
marginBottom: 12,
borderRadius: 8,
},
item: {
- width: SCREEN_WIDTH / 3 - 20,
- height: 140,
+ width: ITEM_WIDTH,
+ height: 150,
borderRadius: 8,
},
detailContainer: {
flexGrow: 1,
- justifyContent: 'center',
+ justifyContent: 'space-evenly',
alignItems: 'center',
- borderWidth: 3,
- borderRadius: 8,
- borderColor: 'transparent',
},
imageStyles: {
- width: 40,
- height: 40,
- marginTop: '11%',
+ width: normalize(50),
+ height: normalize(50),
},
- textContainer: {marginTop: '16%'},
title: {
fontSize: normalize(15),
fontWeight: '500',