Fix create keys page (#133)

This commit is contained in:
KoalaSat 2023-01-17 11:00:00 +00:00 committed by GitHub
commit b0f19a1b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 186 additions and 137 deletions

View File

@ -37,7 +37,12 @@
"level4": "#16304F",
"level5": "#193353"
},
"warning": "#D69242",
"success": "#369734"
"warning": "#FFB869",
"warningContainer": "#683D00",
"onWarningContainer": "#FFDCBB",
"success": "#369734",
"successContainer": "#369734",
"onSuccessContainer": "#96FA89"
}
}

View File

@ -16,47 +16,47 @@
"ProfileConnect": "",
"ProfileLoad": "",
"Landing": "",
"Conversation": "Conversation",
"Reply": "Reply",
"Note": "Note",
"Profile": "Profile",
"Conversation": "Conversación",
"Reply": "Responder",
"Note": "Nota",
"Profile": "Perfil",
"About": "About",
"Send": "Send",
"Relays": "Relays",
"ProfileConfig": "My profile"
},
"conversationPage": {
"typeMessage": "Type message",
"typeMessage": "Escribir mensaje",
"notifications": {
"privateMessageSendError": "There was an error sending your message."
"privateMessageSendError": "Ha ocurrido un error enviando el mensaje."
}
},
"profileLoadPage": {
"relaysDescripion": "Connect with other relays if you have problems finding your data.",
"relays": "See relays",
"home": "Access",
"searchingProfile": "Searching for your profile",
"foundProfile": "Found profile",
"foundContacts": "{{contactsCount}} contacts found"
"relaysDescripion": "Conéctate a otros relays si tienes problemas encontrando tus datos.",
"relays": "Ver relays",
"home": "Acceder",
"searchingProfile": "Buscando tu perfil",
"foundProfile": "Perfil encontrado",
"foundContacts": "{{contactsCount}} contactos encontrados"
},
"sendPage": {
"isContact": "Following",
"isNotContact": "Not following",
"contentWarning": "Sensitive content",
"send": "Send"
"isContact": "Siguiendo",
"isNotContact": "Sin seguir",
"contentWarning": "Contenido sensible",
"send": "Enviar"
},
"menuItems": {
"relays": "Relays",
"notConnected": "Not connected",
"connectedRelays": "{{number}} connected",
"following": "{{following}} following",
"followers": "{{followers}} followers",
"configuration": "Configuration",
"notConnected": "No conectado",
"connectedRelays": "{{number}} conectados",
"following": "{{following}} siguiendo",
"followers": "{{followers}} seguidores",
"configuration": "Configuración",
"about": "About",
"logout": "Logout"
"logout": "Salir"
},
"noteCard": {
"answering": "Answer to {{username}}",
"answering": "Responder a {{username}}",
"seeParent": "See note",
"contentWarning": "Sensitive content"
},
@ -68,21 +68,25 @@
},
"profileCreatePage": {
"notifications": {
"copied": "Private key copied.",
"description": "Save this key on a safe place."
"copied": "Private key copied.\n\nSave this key on a safe place."
},
"snackbarDescription": "Important. Save your key on a safe place, if loose it, you won't be able to access or recover your profile.",
"snackbarAction": "Copy private key",
"accessButton": "Access",
"label": "Private key"
"warningTitle": "Importante",
"warningDescription": "Guarda tu clave privada en un lugar seguro, si la pierdes, no podrás acceder a tu perfil ni recuperarlo.",
"warningAction": "Copiar clave",
"accessButton": "Acceder",
"label": "Clave privada",
"copied": "Clave copiada",
"description": "Guarda la clave en un lugar seguro."
},
"loggerPage": {
"createButton": "Create keys",
"notKeys": "Don't have keys?",
"isPublic": "Access with public key",
"accessButton": "Access",
"privateKey": "Private key",
"publicKey": "Public key"
"createButton": "Crear claves",
"notKeys": "No tienes claves",
"isPublic": "Acceder con clave pública",
"accessButton": "Acceder",
"privateKey": "Clave privada",
"publicKey": "Clave pública"
},
"contactsFeed": {
"notifications": {
@ -90,14 +94,14 @@
"addContactError": "There was an error publishing your changes.",
"contactRemoved": "Profile unfollowed."
},
"cancel": "Cancel",
"addContact": "Add contact",
"addContactDescription": "Paste here the public key of the profile you want to add.",
"addContactTitle": "Add contact",
"followers": "Followers ({{count}})",
"following": "Following ({{count}})",
"stopFollowing": "Stop Following",
"follow": "Follow"
"cancel": "Cancelar",
"addContact": "Añadir contacto",
"addContactDescription": "Pega la clave pública de quien desees añadir.",
"addContactTitle": "Añadir contacto",
"followers": "Seguidores ({{count}})",
"following": "Siguiendo ({{count}})",
"stopFollowing": "Dejar de seguir",
"follow": "Seguir"
},
"aboutPage": {
"gitHub": "GitHub",
@ -105,84 +109,84 @@
"nips": "NIPs"
},
"relaysPage": {
"labelAdd": "Relay address",
"cancel": "Cancel",
"add": "Add",
"removeRelay": "Remove",
"copyRelay": "Copy",
"labelAdd": "Dirección de relay",
"cancel": "Cancelar",
"add": "Añadir",
"removeRelay": "Borrar",
"copyRelay": "Copiar",
"notifications": {
"add": "Relay connected.",
"remove": "Relay removed.",
"badFormat": "Relay URL has a bad format."
"add": "Relay conectado",
"remove": "Relay borrado",
"badFormat": "La URL del relay no tiene el formato adecuado."
}
},
"profileConfigPage": {
"notifications": {
"nsecCopied": "Secret key copied.",
"npubCopied": "Public key copied.",
"profilePublished": "Profile published.",
"lud06Published": "LUD-06 published.",
"nip05Published": "NIP-05 published.",
"picturePublished": "Picture published.",
"connectionError": "Connection error."
"nsecCopied": "Clave secreta copiada.",
"npubCopied": "Clave pública copiada.",
"profilePublished": "Perfil publicado.",
"lud06Published": "LUD-06 publicado.",
"nip05Published": "NIP-05 publicado.",
"picturePublished": "Picture publicado.",
"connectionError": "Error de conexión"
},
"publishLud06": "Publish",
"publishLud06": "Publicar",
"lud06Label": "LNURL / Lightning Address",
"lud06Description": "Link your identity with a LNURL or Lightning Address.",
"lud06Description": "Vincula tu perfil a LNURL or Lightning Address.",
"lud06Title": "LUD-06",
"publishNip05": "Publish",
"nip05Link": "Learn more.",
"nip05Description": "Link your identity with a domain.",
"publishNip05": "Publicar",
"nip05Link": "Saber más.",
"nip05Description": "Vincula tu perfil con un dominio.",
"nip05Title": "NIP-05",
"directoryCancell": "Cancel",
"directoryContinue": "Continue",
"directoryCancell": "Cancelar",
"directoryContinue": "Continuar",
"directoryDescription": "Nostr Directory es una base de datos de claves públicas de nostr asociadas a una cuenta de Twitter. Encuentra a las personas que sigues en Twitter en nostr y añade tu clave pública para que tus seguidores te encuentren si lo deseas.\n\n\nAl verificar tu cuenta de Twitter se añadirá un distintivo en tu perfil.\n\n\nSi continuas tendrás que llevar a cabo el proceso de verificación fuera de la aplicación.",
"directoryTitle": "Nostr Directory",
"publishPicture": "Publish",
"pictureUrl": "Picture URL",
"pictureDescription": "Paste here the URL for the image you would like to display on your public profile.",
"pictureTitle": "Link profile's picture",
"publish": "Publish",
"nsec": "Secret key",
"npub": "Public key",
"copyNPub": "Copy",
"publishPicture": "Publicar",
"pictureUrl": "URL de imagen",
"pictureDescription": "Pega la URL de la imagen que desees mostrar en tu perfil público",
"pictureTitle": "Enlaza tu imagen de perfil",
"publish": "Publicar",
"nsec": "Clave secreta",
"npub": "Clave pública",
"copyNPub": "Copiar",
"directory": "Directory",
"lud06": "LUD-06",
"nip05": "NIP-05",
"name": "Name",
"about": "Description"
"name": "Nombre",
"about": "Descripción"
},
"profilePage": {
"notifications": {
"contactAdded": "Profile followed",
"contactRemoved": "Profile unfollowed",
"npubCopied": "Public key copied."
"contactAdded": "Siguiendo",
"contactRemoved": "Dejando de seguir ",
"npubCopied": "Clave pública copiada."
},
"invoice": "Tip",
"message": "Message",
"follow": "Follow",
"unfollow": "Following",
"copyNPub": "Copy key"
"invoice": "Propina",
"message": "Mensaje",
"follow": "Seguir",
"unfollow": "Siguiendo",
"copyNPub": "Copiar clave"
},
"profileCard": {
"notifications": {
"contactAdded": "Profile followed",
"contactRemoved": "Profile unfollowed",
"npubCopied": "Public key copied."
"contactAdded": "Siguiendo",
"contactRemoved": "Dejando de seguir",
"npubCopied": "Clave pública copiada."
},
"invoice": "Tip",
"message": "Message",
"follow": "Follow",
"unfollow": "Following",
"copyNPub": "Copy key"
"invoice": "Propina",
"message": "Mensaje",
"follow": "Seguir",
"unfollow": "Siguiendo",
"copyNPub": "Copiar clave"
},
"conversationsFeed": {
"openMessage": "Open conversation",
"openMessageLabel": "Public key",
"openMessageDescription": "Paste here a public key to start a conversation",
"openMessageTitle": "Open conversation to public key",
"addPubKey": "Open conversation to public key",
"newMessageContact": "Open conversation to contact"
"openMessage": "Iniciar conversación",
"openMessageLabel": "Clave pública",
"openMessageDescription": "Pega una clave pública para iniciar una conversación.",
"openMessageTitle": "Iniciar conversación con clave pública",
"addPubKey": "Iniciar conversación con clave pública",
"newMessageContact": "Iniciar conversación con contacto"
}
}
}

View File

@ -6,7 +6,6 @@ import { useTranslation } from 'react-i18next'
import { nsecEncode } from 'nostr-tools/nip19'
import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'
import { UserContext } from '../../Contexts/UserContext'
import NostrosNotification from '../../Components/NostrosNotification'
interface ProfileCreatePageProps {
navigation: DrawerNavigationHelpers
@ -43,7 +42,7 @@ export const ProfileCreatePage: React.FC<ProfileCreatePageProps> = ({ navigation
return (
<View style={styles.container}>
<View>
<View style={styles.form}>
<TextInput
mode='outlined'
label={t('profileCreatePage.label') ?? ''}
@ -59,26 +58,32 @@ export const ProfileCreatePage: React.FC<ProfileCreatePageProps> = ({ navigation
/>
}
/>
<Button mode='contained' onPress={onPress} disabled={!copied}>
{/* FIXME: colors are not on the theme */}
<View style={[styles.warning, { backgroundColor: '#683D00' }]}>
<Text variant='titleSmall' style={[styles.warningTitle, { color: '#FFDCBB' }]}>
{t('profileCreatePage.warningTitle')}
</Text>
<Text style={{ color: '#FFDCBB' }}>{t('profileCreatePage.warningDescription')}</Text>
<View style={styles.warningActionOuterLayout}>
<Button style={styles.warningAction} textColor='#FFDCBB' mode='text' onPress={copyContent}>
{t('profileCreatePage.warningAction')}
</Button>
</View>
</View>
<Button mode='contained' compact onPress={onPress} disabled={!copied}>
{t('profileCreatePage.accessButton')}
</Button>
</View>
<Snackbar
style={styles.snackbar}
visible
onDismiss={copyContent}
action={{ label: t('profileCreatePage.snackbarAction') ?? '', onPress: copyContent }}
>
{t('profileCreatePage.snackbarDescription')}
</Snackbar>
{showNotification && (
<NostrosNotification
showNotification={showNotification}
setShowNotification={setShowNotification}
<Snackbar
style={styles.snackbar}
visible={showNotification !== undefined}
duration={Snackbar.DURATION_SHORT}
onIconPress={() => setShowNotification(undefined)}
onDismiss={() => setShowNotification(undefined)}
>
<Text>{t(`profileCreatePage.notifications.${showNotification}`)}</Text>
<Text>{t('profileCreatePage.notifications.description')}</Text>
</NostrosNotification>
{t('profileCreatePage.notifications.copied')}
</Snackbar>
)}
</View>
)
@ -86,12 +91,35 @@ export const ProfileCreatePage: React.FC<ProfileCreatePageProps> = ({ navigation
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 16,
justifyContent: 'center',
},
snackbar: {
top: 150,
margin: 16,
width: '100%'
},
warning: {
borderRadius: 4,
padding: 16,
marginTop: 16,
marginBottom: 16,
},
warningTitle: {
marginBottom: 8,
},
warningAction: {
marginTop: 16,
},
warningActionOuterLayout: {
flexDirection: 'row',
justifyContent: 'flex-end',
},
form: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignContent: 'center',
},
})

View File

@ -24,9 +24,9 @@
"crypto-browserify": "^3.12.0",
"cryptr": "^6.0.3",
"events": "^3.3.0",
"i18next": "^22.0.6",
"i18next": "^22.4.9",
"link-preview-js": "^3.0.4",
"lnurl-pay": "^2.1.0",
"lnurl-pay": "^2.1.1",
"lodash.debounce": "^4.0.8",
"moment": "^2.29.4",
"nostr-tools": "^1.1.1",
@ -64,10 +64,10 @@
"@babel/runtime": "^7.20.6",
"@react-native-community/eslint-config": "^3.2.0",
"@types/create-hash": "^1.2.2",
"@types/jest": "^29.2.2",
"@types/jest": "^29.2.5",
"@types/linkify-it": "^3.0.2",
"@types/lodash.debounce": "^4.0.7",
"@types/react-native": "^0.70.6",
"@types/react-native": "^0.70.8",
"@types/react-native-sqlite-storage": "^5.0.2",
"@types/react-native-vector-icons": "^6.4.12",
"@types/react-test-renderer": "^16.9.2",
@ -76,7 +76,7 @@
"@typescript-eslint/eslint-plugin": "^5.43.0",
"babel-jest": "^29.3.1",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard-with-typescript": "^24.0.0",
"eslint-import-resolver-typescript": "^3.5.1",
"eslint-plugin-i18next": "^6.0.0-6",

View File

@ -898,7 +898,7 @@
pirates "^4.0.5"
source-map-support "^0.5.16"
"@babel/runtime@^7.0.0", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2":
"@babel/runtime@^7.0.0", "@babel/runtime@^7.14.5":
version "7.20.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.0.tgz#824a9ef325ffde6f78056059db3168c08785e24a"
integrity sha512-NDYdls71fTXoU8TZHfbBWg7DiZfNzClcKui/+kyi6ppD2L1qnWW3VV6CjtaBXSUGGhiTWJ6ereOIkUvenif66Q==
@ -1815,10 +1815,10 @@
dependencies:
"@types/istanbul-lib-report" "*"
"@types/jest@^29.2.2":
version "29.2.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.3.tgz#f5fd88e43e5a9e4221ca361e23790d48fcf0a211"
integrity sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==
"@types/jest@^29.2.5":
version "29.2.5"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.5.tgz#c27f41a9d6253f288d1910d3c5f09484a56b73c0"
integrity sha512-H2cSxkKgVmqNHXP7TC2L/WUorrZu8ZigyRywfVzv6EyBlxj39n4C00hjXYQWsbwqgElaj/CiAeSRmk5GoaKTgw==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"
@ -1878,13 +1878,20 @@
"@types/react" "*"
"@types/react-native" "*"
"@types/react-native@*", "@types/react-native@^0.70.6":
"@types/react-native@*":
version "0.70.6"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.70.6.tgz#0d1bc3014111f64f13e0df643aec2ab03f021fdb"
integrity sha512-ynQ2jj0km9d7dbnyKqVdQ6Nti7VQ8SLTA/KKkkS5+FnvGyvij2AOo1/xnkBR/jnSNXuzrvGVzw2n0VWfppmfKw==
dependencies:
"@types/react" "*"
"@types/react-native@^0.70.8":
version "0.70.9"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.70.9.tgz#7d9d11960a4ab78c874e77af895f83d2817aac96"
integrity sha512-0C6sIo13ztzM2llaWdTq0Vpscx3VdU0T8F45kEurWv3l5n+BHm/Mkr8Z+N29eXDYGhTvCz5y2jegB8JyiVa5kw==
dependencies:
"@types/react" "*"
"@types/react-test-renderer@^16.9.2":
version "16.9.5"
resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.9.5.tgz#edab67da470f7c3e997f58d55dcfe2643cc30a68"
@ -2427,7 +2434,7 @@ available-typed-arrays@^1.0.5:
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
axios@^1.2.1:
axios@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.2.tgz#72681724c6e6a43a9fea860fc558127dbe32f9f1"
integrity sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==
@ -3749,6 +3756,11 @@ eslint-config-prettier@^8.5.0:
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
eslint-config-prettier@^8.6.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207"
integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==
eslint-config-standard-with-typescript@^24.0.0:
version "24.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-24.0.0.tgz#30e83b580380fd71477bf80bcb5405e8a46f555f"
@ -4723,12 +4735,12 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
i18next@^22.0.6:
version "22.0.6"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.0.6.tgz#d7029912f8aa74ff295c0d9afd1b7dea45859b49"
integrity sha512-RlreNGoPIdDP4QG+qSA9PxZKGwlzmcozbI9ObI6+OyUa/Rp0EjZZA9ubyBjw887zVNZsC+7FI3sXX8oiTzAfig==
i18next@^22.4.9:
version "22.4.9"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.4.9.tgz#98c8384c6bd41ff937da98b1e809ba03d3b41053"
integrity sha512-8gWMmUz460KJDQp/ob3MNUX84cVuDRY9PLFPnV8d+Qezz/6dkjxwOaH70xjrCNDO+JrUL25iXfAIN9wUkInNZw==
dependencies:
"@babel/runtime" "^7.17.2"
"@babel/runtime" "^7.20.6"
ieee754@^1.1.13, ieee754@^1.2.1:
version "1.2.1"
@ -5822,15 +5834,15 @@ link-preview-js@^3.0.4:
cross-fetch "3.1.5"
url "0.11.0"
lnurl-pay@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/lnurl-pay/-/lnurl-pay-2.1.0.tgz#c3843aed328e4f6f6eb0ee413a830f8386d39523"
integrity sha512-Dd6ZGDDbyolyCWHaeaV9E2eCxUXahYjSYNZa7TM/+VAYRCmXVibGU2i6yjqtDbOtvlKF6X74dHtH36xEO8x2nw==
lnurl-pay@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/lnurl-pay/-/lnurl-pay-2.1.1.tgz#002be1b3c0e2e1bb4751ad2a81532b8103ce88b6"
integrity sha512-Bj/F3xfjMmcuaijIB570mYFqu5yjS2JKY25tifEWnBMTqaQJLtZvD9YydA1AxG2nrLyv2AxXBhb0grQCVIUriw==
dependencies:
"@aws-crypto/sha256-js" "^2.0.2"
aes-js "^3.1.2"
assert "^2.0.0"
axios "^1.2.1"
axios "^1.2.2"
base64-js "^1.5.1"
bech32 "^2.0.0"
bolt11 "^1.4.0"