aboutsummaryrefslogtreecommitdiff
path: root/src/screens/badge
diff options
context:
space:
mode:
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',