Translations and fixes

This commit is contained in:
KoalaSat 2023-11-26 23:38:04 +01:00
parent 6ed3c36312
commit 3d7d29c469
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157
9 changed files with 124 additions and 16 deletions

View File

@ -176,7 +176,7 @@ export const LinksPreview: React.FC<TextContentProps> = ({ urls, lnUrl }) => {
<View>
{decodedLnUrl && lnUrlPreview}
{Object.keys(urls).length > 0 && <View style={styles.previewCard}>{preview()}</View>}
{invoice && <LnPreview invoice={invoice} setInvoice={setInvoice} />}
{invoice && <LnPreview invoices={[invoice]} setInvoices={(arr) => setInvoice(arr[0])} />}
</View>
)
}

View File

@ -207,6 +207,16 @@
"split": "Splits between {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "Kontakt hinzufügen",
"remove": "Entfernen",
"split": "Splits between {{count}}"
},
"notificationsFeed": {
"connectContactRelays": "Reconnect to contacts' relays",
"reposted": "Reposted",

View File

@ -202,6 +202,16 @@
"split": "Splits between {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "Add contact",
"remove": "Remove",
"split": "Splits between {{count}}"
},
"notificationsFeed": {
"reposted": "Reposted",
"zap": "Zapped {{amount}}",

View File

@ -223,6 +223,16 @@
"split": "Se reparte entre {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "Añadir contacto",
"remove": "Borrar",
"split": "Repartir entre {{count}}"
},
"notificationsFeed": {
"reposted": "Reposteado",
"zap": "Zap {{amount}}",

View File

@ -228,6 +228,16 @@
"split": "Splits between {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "Ajouter un contact",
"remove": "Supprimer",
"split": "Splits between {{count}}"
},
"notificationsFeed": {
"reposted": "Reposted",
"zap": "Zapped {{amount}}",

View File

@ -224,6 +224,16 @@
"split": "Splits between {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "Добавить контакт",
"remove": "Удалить",
"split": "Splits between {{count}}"
},
"notificationsFeed": {
"reposted": "Reposted",
"zap": "Zapped {{amount}}",

View File

@ -222,6 +222,16 @@
"split": "Splits between {{count}}",
"zappers": "Zappers"
},
"splitZaps": {
"accept": "Split zaps",
"addPubKey": "Add public key",
"zapPubkeyTitle": "Add public key",
"zapPubkeyDescription": "Add any public key to be included into the split",
"zapPubkeyLabel": "Public key",
"addContact": "添加联系人",
"remove": "移除",
"split": "Splits between {{count}}"
},
"notificationsFeed": {
"reposted": "已转发",
"zap": "已赞赏{{amount}}",

View File

@ -381,7 +381,7 @@ export const ProfileActionsPage: React.FC<ProfileActionsProps> = ({ route: { par
</Button>
</View>
</RBSheet>
{zapInvoice && <LnPreview invoice={zapInvoice} setInvoice={setZapInvoice} />}
{zapInvoice && <LnPreview invoices={[zapInvoice]} setInvoices={(arr) => setZapInvoice(arr[0])} />}
{showNotification && (
<Snackbar
style={styles.snackbar}

View File

@ -7,6 +7,7 @@ import {
type ListRenderItem,
StyleSheet,
View,
Keyboard,
} from 'react-native'
import {
AnimatedFAB,
@ -26,6 +27,7 @@ import { AppContext } from '../../Contexts/AppContext'
import { UserContext } from '../../Contexts/UserContext'
import ProfileData from '../../Components/ProfileData'
import { getNip19Key, getNpub } from '../../lib/nostr/Nip19'
import { useFocusEffect } from '@react-navigation/native'
interface SplitZapPageProps {
route: { params: { splits?: string[] } }
@ -52,9 +54,16 @@ export const SplitZapPage: React.FC<SplitZapPageProps> = ({
loadUsers()
}, [])
useFocusEffect(
React.useCallback(() => {
loadUsers()
return () => { }
}, []),
)
const loadUsers: () => void = () => {
if (database && publicKey) {
getUsers(database, {}).then(setUsers)
getUsers(database, { order: 'id ASC' }).then(setUsers)
}
}
@ -184,10 +193,27 @@ export const SplitZapPage: React.FC<SplitZapPageProps> = ({
return (
<View style={styles.main}>
<View>{numberSplits > 0 && <FlatList data={splitZaps} renderItem={renderZappedItem} />}</View>
<View>
<View style={styles.tabsNavigator}>
<View
style={[
styles.tab,
{ ...styles.tabActive, borderBottomColor: theme.colors.primary }
]}
>
<TouchableRipple style={styles.textWrapper}>
<Text style={styles.tabText}>
{t('splitZaps.split', { count: splitZaps.length })}
</Text>
</TouchableRipple>
</View>
</View>
<View>{numberSplits > 0 && <FlatList data={splitZaps} renderItem={renderZappedItem} />}</View>
</View>
<View>
<Button
mode='contained'
disabled={splitZaps.length < 1}
style={styles.spacer}
onPress={() => navigate('Send', { splits: splitZaps })}
>
@ -247,17 +273,17 @@ export const SplitZapPage: React.FC<SplitZapPageProps> = ({
forceTextInputFocus={false}
/>
}
// left={
// <TextInput.Icon
// icon='qrcode'
// onPress={() => {
// bottomSheetCreateRef.current?.close()
// bottomSheetPubKeyRef.current?.close()
// navigate('QrReader')
// }}
// forceTextInputFocus={false}
// />
// }
// left={
// <TextInput.Icon
// icon='qrcode'
// onPress={() => {
// bottomSheetCreateRef.current?.close()
// bottomSheetPubKeyRef.current?.close()
// navigate('QrReader')
// }}
// forceTextInputFocus={false}
// />
// }
/>
<Button
mode='contained'
@ -275,7 +301,7 @@ export const SplitZapPage: React.FC<SplitZapPageProps> = ({
bottomSheetCreateRef.current?.close()
}}
>
{t('splitZaps.openMessage')}
{t('splitZaps.addPubKey')}
</Button>
</View>
</RBSheet>
@ -289,6 +315,28 @@ const styles = StyleSheet.create({
padding: 16,
justifyContent: 'space-between',
},
tabsNavigator: {
flexDirection: 'row',
alignItems: 'center',
height: 48,
},
tab: {
flex: 1,
height: '100%',
justifyContent: 'center',
alignContent: 'center',
},
tabText: {
textAlign: 'center',
},
tabActive: {
borderBottomWidth: 3,
},
textWrapper: {
justifyContent: 'center',
height: '100%',
textAlign: 'center',
},
spacer: {
marginBottom: 16,
},