Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

refactor(mobile): update tag display to use dot indicator (#1371)

Corentin Thomassetfa2c9d55dfec
diff --git a/apps/mobile/src/modules/documents/components/documents-list.tsx b/apps/mobile/src/modules/documents/components/documents-list.tsx
index 748ba9a1..6c0cf539 100644
--- a/apps/mobile/src/modules/documents/components/documents-list.tsx
+++ b/apps/mobile/src/modules/documents/components/documents-list.tsx
@@ -100,18 +100,14 @@ export function DocumentsList({
{item.tags.length > 0 && (
<View style={styles.tagsContainer}>
{item.tags.slice(0, maxVisibleTags).map((tag) => (
- <View
- key={tag.id}
- style={[styles.tag, { backgroundColor: `${tag.color}10` }]}
- >
- <Text style={[styles.tagText, { color: tag.color }]}>{tag.name}</Text>
+ <View key={tag.id} style={styles.tag}>
+ <View style={[styles.tagDot, { backgroundColor: tag.color }]} />
+ <Text style={styles.tagText}>{tag.name}</Text>
</View>
))}
{item.tags.length > maxVisibleTags && (
- <View style={[styles.tag, { backgroundColor: themeColors.muted }]}>
- <Text style={[styles.tagText, { color: themeColors.mutedForeground }]}>
- +{item.tags.length - maxVisibleTags}
- </Text>
+ <View style={styles.tag}>
+ <Text style={styles.tagText}>+{item.tags.length - maxVisibleTags}</Text>
</View>
)}
</View>
@@ -207,14 +203,24 @@ function createStyles({ themeColors }: { themeColors: ThemeColors }) {
marginTop: 6,
},
tag: {
+ flexDirection: 'row',
+ alignItems: 'center',
+ gap: 6,
paddingHorizontal: 10,
paddingVertical: 6,
borderRadius: 6,
+ backgroundColor: themeColors.muted,
+ },
+ tagDot: {
+ width: 6,
+ height: 6,
+ borderRadius: 3,
},
tagText: {
fontSize: 12,
fontWeight: '500',
lineHeight: 12,
+ color: themeColors.mutedForeground,
},
unsyncedBadge: {
flexDirection: 'row',
diff --git a/apps/mobile/src/modules/documents/screens/document-details.screen.tsx b/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
index cb09abdd..f9467730 100644
--- a/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
+++ b/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
@@ -299,8 +299,9 @@ export function DocumentDetailsScreen() {
<Text style={styles.sectionTitle}>Tags</Text>
<View style={styles.tagsContainer}>
{document.tags.map((tag) => (
- <View key={tag.id} style={[styles.tag, { backgroundColor: `${tag.color}10` }]}>
- <Text style={[styles.tagText, { color: tag.color }]}>{tag.name}</Text>
+ <View key={tag.id} style={styles.tag}>
+ <View style={[styles.tagDot, { backgroundColor: tag.color }]} />
+ <Text style={styles.tagText}>{tag.name}</Text>
</View>
))}
</View>
@@ -514,14 +515,24 @@ function createStyles({ themeColors }: { themeColors: ThemeColors }) {
gap: 8,
},
tag: {
+ flexDirection: 'row',
+ alignItems: 'center',
+ gap: 6,
paddingHorizontal: 10,
paddingVertical: 6,
borderRadius: 6,
+ backgroundColor: themeColors.muted,
+ },
+ tagDot: {
+ width: 6,
+ height: 6,
+ borderRadius: 3,
},
tagText: {
fontSize: 13,
fontWeight: '500',
lineHeight: 13,
+ color: themeColors.mutedForeground,
},
card: {
backgroundColor: themeColors.secondaryBackground,