Skip to content

Commit

Permalink
0.2.2-beta patch (#287)
Browse files Browse the repository at this point in the history
* update the release context and component

* improve pin screen contrast for light themes

* lint

* fix buggy bottom nav, Fixes #285

* improve UX while scanning from history details

* update deps and children types to jsx.element

* update options modal

* adapt styling of the trust mint modal

* use React.ReactNode as type for children elements

* update scanning error screen layout

* add missing function call parentheses

* minor padding change in dashboard

* fix ci
  • Loading branch information
KKA11010 authored Feb 8, 2024
1 parent e717541 commit 6791b83
Show file tree
Hide file tree
Showing 26 changed files with 287 additions and 134 deletions.
3 changes: 2 additions & 1 deletion assets/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "Diese Option erfordert eine Lightning-Zahlung, bringt Gebühren mit sich und kann die unbekannte Mint dennoch zur Liste hinzufügen, wenn eine Gebühren-Rückzahlung erfolgt.",
"trustHint": "Die mit dem Token verbundene Mint wird zu Ihrer Vertrauensliste hinzugefügt.",
"noDefaultHint": "Sie müssen eine Standard-Mint einrichten, um einen automatischen Tausch durchzuführen.",
"autoSwapSuccess": "Tausch erfolgreich!"
"autoSwapSuccess": "Tausch erfolgreich!",
"noReleaseData": "Keine Versionsdaten verfügbar"
},
"error": {
"checkSpendableErr": "Fehler beim Überprüfen, ob der Token ausgegeben werden kann",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "This option requires a Lightning payment, involves fees, and may still add the unknown mint to the list if a fee refund occurs.",
"trustHint": "The mint associated with the token will be added to your trusted list.",
"noDefaultHint": "You need to setup a default mint to perform an auto swap.",
"autoSwapSuccess": "Swap successful!"
"autoSwapSuccess": "Swap successful!",
"noReleaseData": "Release data not available"
},
"error": {
"checkSpendableErr": "Error while checking if token is spendable",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "Esta opción requiere un pago Lightning, implica una tarifa y aún puede agregar la ceca desconocida a la lista si se produce un reembolso de tarifa.",
"trustHint": "La ceca asociada al token se añadirá a tu lista de confianza.",
"noDefaultHint": "Necesitas configurar una ceca predeterminada para realizar un intercambio automático.",
"autoSwapSuccess": "¡Intercambio exitoso!"
"autoSwapSuccess": "¡Intercambio exitoso!",
"noReleaseData": "No hay datos de versión"
},
"error": {
"checkSpendableErr": "Error al comprobar si el token puede ser gastado",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "Ce choix nécessite un paiement Lightning et peut entraîner des frais associés.",
"trustHint": "La menthe associée au jeton sera ajoutée à votre liste de confiance.",
"noDefaultHint": "Vous devez configurer une mint par défaut pour effectuer un échange automatique.",
"autoSwapSuccess": "Échange réussi!"
"autoSwapSuccess": "Échange réussi!",
"noReleaseData": "Donnée de version indisponible"
},
"error": {
"checkSpendableErr": "Erreur lors de la vérification si le token est dépensable",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "Ez az opció egy Lightning-fizetést igényel ami költségekkel jár, és még akkor is hozzáadhatja az ismeretlen verdét a listádhoz, ha költségvisszatérítésre kerül sor.",
"trustHint": "A tokenhez kapcsolódó verde hozzá lesz adva a megbízott listához.",
"noDefaultHint": "Be kell állítanod egy alapértelmezett verdét az automatikus cseréhez.",
"autoSwapSuccess": "Csere sikeres!"
"autoSwapSuccess": "Csere sikeres!",
"noReleaseData": "Nincs elérhető verzió információ"
},
"error": {
"checkSpendableErr": "Hiba a token elkölthetőségének ellenőrzése közben",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/sw.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"swapHint": "Chaguo hili linahitaji malipo ya Lightning, linajumuisha ada, na linaweza bado kuongeza mint isiyojulikana kwenye orodha ikiwa kuna marejesho ya ada.",
"trustHint": "Minti inayohusiana na alama itaongezwa kwenye orodha yako ya kuaminika.",
"noDefaultHint": "Unahitaji kuweka kalibu ya kufanya ubadilishaji wa moja kwa moja.",
"autoSwapSuccess": "Kubadilishana kufanikiwa!"
"autoSwapSuccess": "Kubadilishana kufanikiwa!",
"noReleaseData": "Hakuna data ya toleo"
},
"error": {
"checkSpendableErr": "Kumetokea kosa wakati wa kuangalia ikiwa kijenzi kina pesa za kutumiwa",
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,22 @@
"@babel/core": "^7.23.6",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@getify/eslint-plugin-proper-arrows": "^11.0.3",
"@testing-library/react-native": "^12.4.1",
"@testing-library/react-native": "^12.4.2",
"@types/babel__core": "^7.20.5",
"@types/crypto-js": "^4.2.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@types/react": "~18.2.43",
"@types/node": "^20.10.5",
"@types/react": "~18.2.45",
"@types/react-native-onboarding-swiper": "^1.1.8",
"@types/sqlite3": "^3.1.11",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"dotenv": "^16.3.1",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-plugin-deprecate": "^0.8.4",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
Expand All @@ -114,7 +114,7 @@
"expo-dev-client": "~2.4.12",
"jest": "^29.7.0",
"jest-expo": "^49.0.0",
"metro-config": "^0.80.1",
"metro-config": "^0.80.2",
"prettier": "^3.1.1",
"ts-jest": "^29.1.1",
"ts-jest-resolver": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const styles = ScaledSheet.create({
board: {
borderBottomLeftRadius: 50,
borderBottomRightRadius: 50,
paddingHorizontal: '30@s',
paddingHorizontal: '20@s',
paddingTop: '40@vs',
paddingBottom: '50@vs',
minHeight: '50%'
Expand Down
7 changes: 7 additions & 0 deletions src/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,13 @@ export function BatteryChargingIcon({ width, height, color }: TIconProps) {
)
}

export function ConnectionErrorIcon({ width, height, color }: TIconProps) {
return (
<Svg width={width || 24} height={height || 24} viewBox="0 0 24 24" fill="none">
<Path d="M12 16V14.5C12 13.6716 12.6716 13 13.5 13H19.5C20.3284 13 21 13.6716 21 14.5V18.5C21 19.3284 20.3284 20 19.5 20H18.5C18.7761 20 19 20.2239 19 20.5C19 20.7761 18.7761 21 18.5 21H14.5C14.2239 21 14 20.7761 14 20.5C14 20.2239 14.2239 20 14.5 20H13.5C12.6716 20 12 19.3284 12 18.5V17H10.5C10.2239 17 10 16.7761 10 16.5C10 16.2239 10.2239 16 10.5 16H12ZM7 11H5.5C5.22386 11 5 10.7761 5 10.5C5 10.2239 5.22386 10 5.5 10H4.5C3.67157 10 3 9.32843 3 8.5V4.5C3 3.67157 3.67157 3 4.5 3H10.5C11.3284 3 12 3.67157 12 4.5V8.5C12 9.32843 11.3284 10 10.5 10H9.5C9.77614 10 10 10.2239 10 10.5C10 10.7761 9.77614 11 9.5 11H8V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V11ZM7.5 15.7929L9.14645 14.1464C9.34171 13.9512 9.65829 13.9512 9.85355 14.1464C10.0488 14.3417 10.0488 14.6583 9.85355 14.8536L8.20711 16.5L9.85355 18.1464C10.0488 18.3417 10.0488 18.6583 9.85355 18.8536C9.65829 19.0488 9.34171 19.0488 9.14645 18.8536L7.5 17.2071L5.85355 18.8536C5.65829 19.0488 5.34171 19.0488 5.14645 18.8536C4.95118 18.6583 4.95118 18.3417 5.14645 18.1464L6.79289 16.5L5.14645 14.8536C4.95118 14.6583 4.95118 14.3417 5.14645 14.1464C5.34171 13.9512 5.65829 13.9512 5.85355 14.1464L7.5 15.7929ZM4 4.5V8.5C4 8.77614 4.22386 9 4.5 9H10.5C10.7761 9 11 8.77614 11 8.5V4.5C11 4.22386 10.7761 4 10.5 4H4.5C4.22386 4 4 4.22386 4 4.5ZM13 14.5V18.5C13 18.7761 13.2239 19 13.5 19H19.5C19.7761 19 20 18.7761 20 18.5V14.5C20 14.2239 19.7761 14 19.5 14H13.5C13.2239 14 13 14.2239 13 14.5Z" fill={color} />
</Svg>
)
}
const styles = StyleSheet.create({
nostrIcon: {
marginLeft: -5
Expand Down
129 changes: 94 additions & 35 deletions src/components/modal/OptsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { TxtButton } from '@comps/Button'
import { CopyIcon, NostrIcon, ReceiveIcon, SendMsgIcon, ZapIcon } from '@comps/Icons'
import Option from '@comps/Option'
import { CopyIcon, NostrIcon, SendMsgIcon, ZapIcon } from '@comps/Icons'
import Loading from '@comps/Loading'
import Separator from '@comps/Separator'
import Txt from '@comps/Txt'
import { useNostrContext } from '@src/context/Nostr'
import { useThemeContext } from '@src/context/Theme'
import { NS } from '@src/i18n'
import { mainColors } from '@styles'
import { useTranslation } from 'react-i18next'
import { ScrollView } from 'react-native'
import { Text, TouchableOpacity, View } from 'react-native'
import { s, ScaledSheet, vs } from 'react-native-size-matters'

import MyModal from '.'
Expand Down Expand Up @@ -46,48 +47,106 @@ export default function OptsModal({
center
styles={[styles.hint]}
/>
<ScrollView style={styles.optionWrap} alwaysBounceVertical={false}>
<Option
icon={isSend ? <SendMsgIcon width={s(16)} height={s(16)} color={mainColors.VALID} /> : <CopyIcon color={mainColors.VALID} />}
txt={button1Txt}
hint={isSend ? t('sendEcashDashboard') : t('receiveEcashDashboard')}
onPress={onPressFirstBtn}
hasSeparator
loading={loading}
secondIcon={!isSend && <ReceiveIcon width={s(26)} height={s(26)} color={color.TEXT} />}
/>
{!isSend && nutPub.length > 0 &&
<Option
icon={<NostrIcon />}
txt={t('receiveEcashNostr')}
hint={t('receiveEcashNostrHint')}
<TouchableOpacity
style={styles.container}
onPress={onPressFirstBtn}
>
<View style={styles.iconContainer}>
{isSend ?
<SendMsgIcon width={s(16)} height={s(16)} color={mainColors.VALID} />
:
loading ?
<View>
<Loading size='small' color={mainColors.VALID} />
</View>
:
<CopyIcon color={mainColors.VALID} />
}
</View>
<View style={styles.txtWrap}>
<Text style={[styles.actionText, { color: color.TEXT }]}>
{button1Txt}
</Text>
<Text style={[styles.descriptionText, { color: color.TEXT_SECONDARY }]}>
{isSend ? t('sendEcashDashboard') : t('receiveEcashDashboard')}
</Text>
</View>
</TouchableOpacity>
<Separator style={[styles.separator]} />
{!isSend && nutPub.length > 0 &&
<>
<TouchableOpacity
style={styles.container}
onPress={() => handleNostrReceive?.()}
hasSeparator
/>
}
<Option
icon={<ZapIcon width={s(26)} height={s(26)} color={mainColors.ZAP} />}
txt={button2Txt}
hint={isSend ? t('payInvoiceDashboard') : t('createInvoiceDashboard')}
onPress={onPressSecondBtn}
/>
<TxtButton
txt={t('cancel')}
onPress={onPressCancel}
style={[{ paddingBottom: vs(15), paddingTop: vs(15) }]}
/>
</ScrollView>
>
<View style={styles.iconContainer}>
<NostrIcon />
</View>
<View style={styles.txtWrap}>
<Text style={[styles.actionText, { color: color.TEXT }]}>
{t('receiveEcashNostr')}
</Text>
<Text style={[styles.descriptionText, { color: color.TEXT_SECONDARY }]}>
{t('receiveEcashNostrHint')}
</Text>
</View>
</TouchableOpacity>
<Separator style={[styles.separator]} />
</>
}
<TouchableOpacity
style={styles.container}
onPress={onPressSecondBtn}
>
<View style={styles.iconContainer}>
<ZapIcon width={s(26)} height={s(26)} color={mainColors.ZAP} />
</View>
<View style={styles.txtWrap}>
<Text style={[styles.actionText, { color: color.TEXT }]}>
{button2Txt}
</Text>
<Text style={[styles.descriptionText, { color: color.TEXT_SECONDARY }]}>
{isSend ? t('payInvoiceDashboard') : t('createInvoiceDashboard')}
</Text>
</View>
</TouchableOpacity>
<TxtButton
txt={t('cancel')}
onPress={onPressCancel}
style={[{ paddingBottom: vs(15), paddingTop: vs(25) }]}
/>
</MyModal>
)
}

const styles = ScaledSheet.create({
optionWrap: {
container: {
flexDirection: 'row',
alignItems: 'center',
width: '100%',
paddingHorizontal: '10@s'
},
iconContainer: {
minWidth: '11%',
},
txtWrap: {
width: '90%',
},
actionText: {
fontSize: '14@vs',
fontWeight: '500',
marginBottom: '4@vs',
},
descriptionText: {
fontSize: '12@vs',
},
hint: {
fontSize: '18@vs',
marginTop: '5@vs',
marginBottom: '30@vs',
},
separator: {
width: '100%',
marginTop: '10@vs',
marginBottom: '10@vs'
}
})
Loading

0 comments on commit 6791b83

Please sign in to comment.