fix: center label when no badge in library

This commit is contained in:
Nyagami
2024-01-14 11:34:04 +07:00
parent 560848f5d5
commit 39dc3ec8d6
+10 -6
View File
@@ -102,17 +102,20 @@ const LibraryScreen = ({ navigation }: LibraryScreenProps) => {
renderLabel={({ route, color }) => (
<Row>
<Text style={{ color }}>{route.title}</Text>
<View
style={[styles.badgeCtn, { backgroundColor: theme.surfaceVariant }]}
>
{showNumberOfNovels && (
{showNumberOfNovels && (
<View
style={[
styles.badgeCtn,
{ backgroundColor: theme.surfaceVariant },
]}
>
<Text
style={[styles.badgetText, { color: theme.onSurfaceVariant }]}
>
{(route as any)?.novels.length}
</Text>
)}
</View>
</View>
)}
</Row>
)}
inactiveColor={theme.secondary}
@@ -319,6 +322,7 @@ const styles = StyleSheet.create({
bottom: 0,
},
badgeCtn: {
position: 'relative',
borderRadius: 50,
marginHorizontal: 6,
paddingHorizontal: 6,