diff options
author | Ollie H <renahlee@outlook.com> | 2023-05-09 10:02:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 12:02:55 -0500 |
commit | bf3ea67442857b62d29c74ba0739f31a79b0f7b7 (patch) | |
tree | d403e4a10c66d64335d029dd3db96d68d04d1ef2 /src | |
parent | 28f7ff76a4d7cb756d63f1cb6224965ce26cd6f8 (diff) | |
download | voidsky-bf3ea67442857b62d29c74ba0739f31a79b0f7b7.tar.zst |
Add time to app password and fix related text wrapping (#604)
Diffstat (limited to 'src')
-rw-r--r-- | src/view/screens/AppPasswords.tsx | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx index a4bea68f7..cb1896b4a 100644 --- a/src/view/screens/AppPasswords.tsx +++ b/src/view/screens/AppPasswords.tsx @@ -180,21 +180,35 @@ function AppPassword({ ) }, [store, name]) + const {contentLanguages} = store.preferences + + const primaryLocale = + contentLanguages.length > 0 ? contentLanguages[0] : 'en-US' + return ( <TouchableOpacity testID={testID} style={[styles.item, pal.border]} onPress={onDelete} accessibilityRole="button" - accessibilityLabel="Delete" - accessibilityHint="Deletes app password"> - <Text type="md-bold" style={pal.text}> - {name} - </Text> - <View style={styles.flex1} /> - <Text type="md" style={[pal.text, styles.pr10]}> - {new Date(createdAt).toDateString()} - </Text> + accessibilityLabel="Delete app password" + accessibilityHint=""> + <View> + <Text type="md-bold" style={pal.text}> + {name} + </Text> + <Text type="md" style={[pal.text, styles.pr10]} numberOfLines={1}> + Created{' '} + {Intl.DateTimeFormat(primaryLocale, { + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + }).format(new Date(createdAt))} + </Text> + </View> <FontAwesomeIcon icon={['far', 'trash-can']} style={styles.trashIcon} /> </TouchableOpacity> ) @@ -246,6 +260,7 @@ const styles = StyleSheet.create({ item: { flexDirection: 'row', alignItems: 'center', + justifyContent: 'space-between', borderBottomWidth: 1, paddingHorizontal: 20, paddingVertical: 14, |