Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.0-beta #276

Merged
merged 57 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5451399
add filter for invalid relay urls in publish
KKA11010 Nov 26, 2023
276ab99
bump to 0.1.3-beta
KKA11010 Nov 26, 2023
3490be0
add methods to check for new release
KKA11010 Nov 26, 2023
b5da323
add release screen
KKA11010 Nov 26, 2023
a5f9de2
fix pasting invoice
KKA11010 Nov 28, 2023
c5698e5
remove operator in swap history entry
KKA11010 Nov 28, 2023
32fcca9
update styling of few screens
KKA11010 Nov 29, 2023
27b844e
update release screen, update hungarian tl
KKA11010 Nov 29, 2023
d9871a8
update history details screen layout
KKA11010 Nov 29, 2023
5180eab
combine memo screen with amount screen
KKA11010 Nov 29, 2023
b8aee37
update screen layouts padding
KKA11010 Nov 29, 2023
8da4e13
update scanned npub screen
KKA11010 Nov 30, 2023
d4454a4
bump to 0.2.0-beta
KKA11010 Nov 30, 2023
1fc9e84
update circle button color
KKA11010 Nov 30, 2023
5dbb34f
add qr scan in addressbook payment process
KKA11010 Nov 30, 2023
7341fed
update styling of keyboardAvoidingView
KKA11010 Nov 30, 2023
3129a26
update styling of keyboardAvoidingView
KKA11010 Nov 30, 2023
d8a4d8c
update logo color in light highlighting theme
KKA11010 Nov 30, 2023
82d7aa2
update styling of keyboardAvoidingView
KKA11010 Nov 30, 2023
0813820
solve styling of keyboardAvoidingView
KKA11010 Nov 30, 2023
1af4225
update trust modal layout
KKA11010 Nov 30, 2023
c7c33e2
update translations
KKA11010 Nov 30, 2023
2a21a2e
update translations
KKA11010 Nov 30, 2023
018fd1c
update translations
KKA11010 Nov 30, 2023
23d0123
Merge branch 'main' into 0.1.3-beta
KKA11010 Nov 30, 2023
c3846af
test auto-mint-swap
KKA11010 Nov 30, 2023
2920f94
auto-swap overpaid fees are stored in srcMint and added to user db
KKA11010 Nov 30, 2023
2777154
add todo
KKA11010 Nov 30, 2023
9e79f1b
use fullAutoMintSwap function
KKA11010 Dec 1, 2023
e263a86
format trustMint file
KKA11010 Dec 1, 2023
e0f9750
update auto-mint-swap translation
KKA11010 Dec 1, 2023
331197f
fix nip05 string check
KKA11010 Dec 4, 2023
272eede
clear deep link var after using
KKA11010 Dec 4, 2023
5663271
update backup screen, add hints
KKA11010 Dec 4, 2023
ed9f533
update fee in tx history and details
KKA11010 Dec 4, 2023
d06d510
avoid foreground prompt after copy backup token
KKA11010 Dec 4, 2023
461151d
clear deep link url if user cancels payment
KKA11010 Dec 4, 2023
105a15c
clear deep link url if user cancels payment
KKA11010 Dec 4, 2023
87424a1
update invoice check and add block comment
KKA11010 Dec 5, 2023
16ae233
add TODO
KKA11010 Dec 5, 2023
91570be
update and handle fullAutoMintSwap
KKA11010 Dec 5, 2023
c7273dd
remove unused imports
KKA11010 Dec 5, 2023
7ef9b88
fix typo
KKA11010 Dec 5, 2023
4e09174
update hu.json
KKA11010 Dec 5, 2023
b2177b7
Merge branch 'main' into 0.1.3-beta
KKA11010 Dec 5, 2023
b601f75
Merge branch 'main' into 0.1.3-beta
KKA11010 Dec 6, 2023
95b62e0
fix success screen data. Show change amount in success screen.
KKA11010 Dec 6, 2023
35d02e0
add "wallet" and "proofs" to translation files
KKA11010 Dec 6, 2023
75c8f27
fix focus issue in amount screen
KKA11010 Dec 6, 2023
93c56b3
shorten a german translation
KKA11010 Dec 6, 2023
e776e23
move some options into general settings
KKA11010 Dec 6, 2023
54aee2d
update QR screen on initial loading
KKA11010 Dec 6, 2023
41092c6
update history entry layout
KKA11010 Dec 6, 2023
9e8ee86
update styling of option rows
KKA11010 Dec 6, 2023
4bedf04
add dashboard transition to qr screen
KKA11010 Dec 6, 2023
2097e19
lint & fix ci
KKA11010 Dec 6, 2023
f5c5ad4
check if incoming token is from default token
KKA11010 Dec 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
738 changes: 370 additions & 368 deletions assets/translations/de.json

Large diffs are not rendered by default.

732 changes: 367 additions & 365 deletions assets/translations/en.json

Large diffs are not rendered by default.

732 changes: 367 additions & 365 deletions assets/translations/es.json

Large diffs are not rendered by default.

734 changes: 368 additions & 366 deletions assets/translations/fr.json

Large diffs are not rendered by default.

730 changes: 366 additions & 364 deletions assets/translations/hu.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few strings in the app I found "untranslateable". Is it possible to add these too?
"Wallet" on main screen
"Proofs" in Settings -> Manage Mints -> select mint -> Funds

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few strings in the app I found "untranslateable". Is it possible to add these too? "Wallet" on main screen "Proofs" in Settings -> Manage Mints -> select mint -> Funds

Thank you for your review sir, really appreciate it! Yes, you are right, I will add these as well.
How should I translate "wallet" and "proofs"?

I've also had to add new translations due to new screens. I used chatGPT for it, can you please review those as well? You can find them for hungarian here line 227 to 234

@KvartBeerborn for spanish here line 227 to 234

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks!
"wallet" should be "tárca" and
"proofs" should be "bizonylatok"

Large diffs are not rendered by default.

732 changes: 367 additions & 365 deletions assets/translations/sw.json

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions src/components/animation/QrTransition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import type { RootStackParamList } from '@model/nav'
import { type NavigationProp,useNavigation } from '@react-navigation/core'
import { useThemeContext } from '@src/context/Theme'
import { useRef } from 'react'
import { Animated, Easing } from 'react-native'

type StackNavigation = NavigationProp<RootStackParamList>

export const useTransitionAnimation = () => {
const nav = useNavigation<StackNavigation>()
const { color } = useThemeContext()
const animatedColorValue = useRef(new Animated.Value(0)).current
const animatedPositionValue = useRef(new Animated.Value(0)).current
const animatedOpacityValue = useRef(new Animated.Value(0)).current
const animatedMarginValue = useRef(new Animated.Value(0)).current
const animationEnded = useRef(false)
const interpolatedColor = animatedColorValue.interpolate({
inputRange: animationEnded.current ? [1, 0] : [0, 1],
outputRange: animationEnded.current ? ['#000', color.BACKGROUND] : [color.BACKGROUND, '#000'],
})
const interpolatedPosition = animatedPositionValue.interpolate({
inputRange: animationEnded.current ? [1, 0] : [0, 1],
outputRange: animationEnded.current ? [100, 0] : [0, 100],
})
const interpolatedOpacity = animatedOpacityValue.interpolate({
inputRange: animationEnded.current ? [1, 0] : [0, 1],
outputRange: animationEnded.current ? [0, 1] : [1, 0],
})
const interpolatedMargin = animatedMarginValue.interpolate({
inputRange: animationEnded.current ? [1, 0] : [0, 1],
outputRange: animationEnded.current ? [-1000, 0] : [0, -1000],
})
const animatedBgStyles = {
backgroundColor: interpolatedColor,
}
const animatedPosStyles = {
transform: [{ translateY: interpolatedPosition }],
}
const animatedOpacityStyles = {
opacity: interpolatedOpacity,
}
const animatedMarginStyles = {
marginTop: interpolatedMargin,
}
const animateTransition = () => {
Animated.parallel([
Animated.timing(animatedColorValue, {
toValue: animationEnded.current ? 0 : 1,
duration: 300,
easing: Easing.linear,
useNativeDriver: false,
}),
Animated.timing(animatedPositionValue, {
toValue: animationEnded.current ? 0 : 1,
duration: 300,
easing: Easing.linear,
useNativeDriver: false,
}),
Animated.timing(animatedOpacityValue, {
toValue: animationEnded.current ? 0 : 1,
duration: 150,
easing: Easing.linear,
useNativeDriver: false,
}),
Animated.timing(animatedMarginValue, {
toValue: animationEnded.current ? 0 : 1,
duration: 300,
easing: Easing.linear,
useNativeDriver: false,
})
]).start(() => {
if (animationEnded.current) { return animationEnded.current = false }
nav.navigate('qr scan', { mint: undefined })
animationEnded.current = true
})
}
return {
animatedBgStyles,
animatedPosStyles,
animatedOpacityStyles,
animatedMarginStyles,
animationEnded,
animateTransition,
}
}
112 changes: 65 additions & 47 deletions src/components/nav/BottomNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ import { STORE_KEYS } from '@store/consts'
import { highlight as hi } from '@styles'
import { isStr } from '@util'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, TouchableOpacity } from 'react-native'
import { Animated, SafeAreaView, TouchableOpacity } from 'react-native'
import { s, ScaledSheet, vs } from 'react-native-size-matters'

export default function BottomNav({ navigation, route }: TBottomNavProps) {
type TInterPolation = Animated.AnimatedInterpolation<string | number>

export default function BottomNav({
navigation,
route,
animatedBgStyles,
animatedPosStyles
}: TBottomNavProps & {
animatedBgStyles?: { backgroundColor: TInterPolation },
animatedPosStyles?: { transform: { translateY: TInterPolation }[] }
}) {
const { t } = useTranslation([NS.topNav])
const { color, highlight } = useThemeContext()

Expand All @@ -37,51 +47,59 @@ export default function BottomNav({ navigation, route }: TBottomNavProps) {
route.name === 'Contacts settings'

return (
<SafeAreaView style={[styles.bottomNav, { backgroundColor: color.BACKGROUND, paddingBottom: vs(10) }]}>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('dashboard')}
disabled={isWalletRelatedScreen}
>
<WalletIcon width={s(26)} height={s(26)} color={isWalletRelatedScreen ? hi[highlight] : color.TEXT} />
<Txt
txt='Wallet'
styles={[styles.iconTxt, {
color: isWalletRelatedScreen ? hi[highlight] : color.TEXT,
fontWeight: isWalletRelatedScreen ? '500' : '400'
}]}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('Address book')}
disabled={route.name === 'Address book'}
>
<BookIcon width={s(26)} height={s(26)} color={route.name === 'Address book' ? hi[highlight] : color.TEXT} />
<Txt
txt={t('contacts', { ns: NS.bottomNav })}
styles={[
styles.iconTxt, {
color: route.name === 'Address book' ? hi[highlight] : color.TEXT,
fontWeight: route.name === 'Address book' ? '500' : '400'
}
]}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('Settings')}
disabled={isSettingsRelatedScreen}
>
<SettingsIcon width={s(26)} height={s(26)} color={isSettingsRelatedScreen ? hi[highlight] : color.TEXT} />
<Txt
txt={t('settings')}
styles={[styles.iconTxt, {
color: isSettingsRelatedScreen ? hi[highlight] : color.TEXT,
fontWeight: isSettingsRelatedScreen ? '500' : '400'
}]}
/>
</TouchableOpacity>
<SafeAreaView>
<Animated.View
style={[
styles.bottomNav,
{ paddingBottom: vs(10) },
animatedBgStyles,
animatedPosStyles
]}>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('dashboard')}
disabled={isWalletRelatedScreen}
>
<WalletIcon width={s(26)} height={s(26)} color={isWalletRelatedScreen ? hi[highlight] : color.TEXT} />
<Txt
txt={t('wallet', { ns: NS.bottomNav })}
styles={[styles.iconTxt, {
color: isWalletRelatedScreen ? hi[highlight] : color.TEXT,
fontWeight: isWalletRelatedScreen ? '500' : '400'
}]}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('Address book')}
disabled={route.name === 'Address book'}
>
<BookIcon width={s(26)} height={s(26)} color={route.name === 'Address book' ? hi[highlight] : color.TEXT} />
<Txt
txt={t('contacts', { ns: NS.bottomNav })}
styles={[
styles.iconTxt, {
color: route.name === 'Address book' ? hi[highlight] : color.TEXT,
fontWeight: route.name === 'Address book' ? '500' : '400'
}
]}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.navIcon}
onPress={() => void handleNav('Settings')}
disabled={isSettingsRelatedScreen}
>
<SettingsIcon width={s(26)} height={s(26)} color={isSettingsRelatedScreen ? hi[highlight] : color.TEXT} />
<Txt
txt={t('settings')}
styles={[styles.iconTxt, {
color: isSettingsRelatedScreen ? hi[highlight] : color.TEXT,
fontWeight: isSettingsRelatedScreen ? '500' : '400'
}]}
/>
</TouchableOpacity>
</Animated.View>
</SafeAreaView>
)
}
Expand Down
8 changes: 6 additions & 2 deletions src/context/FocusClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { l } from '@log'
import type { ITokenInfo } from '@model'
import { store } from '@store'
import { STORE_KEYS } from '@store/consts'
import { getStrFromClipboard, hasTrustedMint, isCashuToken, sleep } from '@util'
import { getDefaultMint } from '@store/mintStore'
import { getStrFromClipboard, hasTrustedMint, isCashuToken, isStr, sleep } from '@util'
import { isTokenSpendable } from '@wallet'
import { getTokenInfo } from '@wallet/proofs'
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'
Expand Down Expand Up @@ -32,9 +33,12 @@ const useFocusClaim = () => {
const info = getTokenInfo(cleanedClipboard)
if (!info) { return false }
// check if mint is a trusted one
const defaultM = await getDefaultMint()
const userMints = await getMintsUrls()
// do not claim from clipboard when app comes to the foreground if mint from token is not trusted
if (!hasTrustedMint(userMints, info.mints)) { return false }
if (!hasTrustedMint(userMints, info.mints)|| (isStr(defaultM) && !info.mints.includes(defaultM))) {
return false
}
// check if token is spendable
try {
const isSpendable = await isTokenSpendable(cleanedClipboard)
Expand Down
1 change: 1 addition & 0 deletions src/model/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export type RootStackParamList = {
isZap?: boolean
nostr?: INostrSendData
isScanned?: boolean
change?: number
}
mintmanagement: {
mint: IMintUrl
Expand Down
Loading
Loading