Skip to content

Commit

Permalink
update dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 committed Aug 26, 2023
1 parent 2fc9eab commit b26e0c5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
2 changes: 2 additions & 0 deletions assets/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"scanAgain": "Hier tippen, um erneut zu scannen",
"scanTokenOrLn": "Cashu Token oder LN Rechnung scannen",
"scanLn": "Lightning Rechnung scannen",
"scan": "Scannen",
"enutsBeta": "eNuts ist beta Software.",
"seconds": "Sekunden",
"selectAmount": "Betrag auswählen",
"selected": "Ausgewählt",
Expand Down
2 changes: 2 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"scanAgain": "Tap to Scan Again",
"scanTokenOrLn": "Scan Cashu token or Lightning invoice",
"scanLn": "Scan Lightning invoice",
"scan": "Scan",
"enutsBeta": "eNuts is beta software.",
"seconds": "seconds",
"selectAmount": "Select amount",
"selected": "Selected",
Expand Down
2 changes: 2 additions & 0 deletions assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"scanAgain": "Appuyez pour scanner à nouveau",
"scanTokenOrLn": "Scanner le Cashu token ou facture Lightning",
"scanLn": "Scanner la facture Lightning",
"scan": "Scanner",
"enutsBeta": "enuts est une version bêta.",
"seconds": "secondes",
"selectAmount": "Sélectionner le montant",
"selected": "Sélectionné",
Expand Down
2 changes: 1 addition & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function _App() {
}
}

// init pin auth data
// init auth data
const initAuth = async () => {
const [pinHash, onboard] = await Promise.all([
secureStore.get(SECURESTORE_KEY),
Expand Down
17 changes: 9 additions & 8 deletions src/components/Balance.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AboutIcon, ChevronRightIcon, HistoryIcon, SwapCurrencyIcon } from '@comps/Icons'
import { ChevronRightIcon, HistoryIcon, MintBoardIcon, SwapCurrencyIcon } from '@comps/Icons'
import { setPreferences } from '@db'
import type { RootStackParamList } from '@model/nav'
import type { NativeStackNavigationProp } from '@react-navigation/native-stack'
Expand Down Expand Up @@ -67,18 +67,19 @@ export default function Balance({ balance, nav }: IBalanceProps) {
}
{/* history */}
<BoardEntry
txt={t('history', { ns: NS.topNav })}
icon={<HistoryIcon color={mainColors.WHITE} />}
txt='Mints'
icon={<MintBoardIcon color={mainColors.WHITE} />}
color={mainColors.WHITE}
onPress={() => nav?.navigate('history')}
onPress={() => nav?.navigate('mints')}
withSeparator
/>
{/* Disclaimer */}
{/* history */}
<BoardEntry
txt={t('risks')}
icon={<AboutIcon color={mainColors.WHITE} />}
txt={t('history', { ns: NS.topNav })}
icon={<HistoryIcon color={mainColors.WHITE} />}
color={mainColors.WHITE}
onPress={() => nav?.navigate('disclaimer')}
onPress={() => nav?.navigate('history')}
withSeparator
/>
</View>
)
Expand Down
31 changes: 19 additions & 12 deletions src/screens/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Balance from '@comps/Balance'
import { IconBtn } from '@comps/Button'
import useLoading from '@comps/hooks/Loading'
import useCashuToken from '@comps/hooks/Token'
import { MintBoardIcon, ReceiveIcon, ScanQRIcon, SendIcon } from '@comps/Icons'
import { AboutIcon, ReceiveIcon, ScanQRIcon, SendIcon } from '@comps/Icons'
import InitialModal from '@comps/InitialModal'
import Txt from '@comps/Txt'
import { _testmintUrl, isIOS } from '@consts'
import { _testmintUrl } from '@consts'
import { addMint, getBalance, getMintsBalances, getMintsUrls, hasMints } from '@db'
import { l } from '@log'
import OptsModal from '@modal/OptsModal'
Expand All @@ -23,7 +23,7 @@ import { store } from '@store'
import { STORE_KEYS } from '@store/consts'
import { addToHistory } from '@store/HistoryStore'
import { getCustomMintNames } from '@store/mintStore'
import { highlight as hi } from '@styles'
import { highlight as hi, mainColors } from '@styles'
import { getStrFromClipboard, hasTrustedMint, isCashuToken } from '@util'
import { claimToken } from '@wallet'
import { getTokenInfo } from '@wallet/proofs'
Expand Down Expand Up @@ -239,7 +239,7 @@ export default function Dashboard({ navigation, route }: TDashboardPageProps) {
{/* Balance, Disclaimer & History */}
<Balance balance={balance} nav={navigation} />
{/* Receive/send/mints buttons */}
<View style={[styles.actionWrap, {paddingHorizontal: !hasMint || balance < 1 ? 75 : 30 }]}>
<View style={[styles.actionWrap, { paddingHorizontal: !hasMint || balance < 1 ? 75 : 30 }]}>
{(hasMint && balance > 0) &&
<ActionBtn
icon={
Expand All @@ -255,10 +255,10 @@ export default function Dashboard({ navigation, route }: TDashboardPageProps) {
/>
}
<ActionBtn
icon={<MintBoardIcon width={32} height={32} color={hi[highlight]} />}
txt='Mints'
icon={<ScanQRIcon width={32} height={32} color={hi[highlight]} />}
txt={t('scan')}
color={hi[highlight]}
onPress={() => navigation.navigate('mints')}
onPress={() => navigation.navigate('qr scan', { mint: undefined })}
/>
<ActionBtn
icon={<ReceiveIcon width={32} height={32} color={hi[highlight]} />}
Expand All @@ -268,11 +268,13 @@ export default function Dashboard({ navigation, route }: TDashboardPageProps) {
/>
</View>
{/* scan QR */}
<View style={styles.qrBtnWrap}>
<View style={styles.hintWrap}>
<TouchableOpacity
onPress={() => navigation.navigate('qr scan', { mint: undefined })}
onPress={() => navigation.navigate('disclaimer')}
style={styles.betaHint}
>
<ScanQRIcon width={60} height={60} color={color.TEXT} />
<AboutIcon color={mainColors.WARN} />
<Txt txt={t('enutsBeta')} styles={[{ color: mainColors.WARN, marginLeft: 10 }]} />
</TouchableOpacity>
</View>
{/* Bottom nav icons */}
Expand Down Expand Up @@ -367,10 +369,15 @@ const styles = StyleSheet.create({
fontWeight: '500',
marginTop: 10,
},
qrBtnWrap: {
hintWrap: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
marginBottom: isIOS ? 100 : 75
marginBottom: 50
},
betaHint: {
flexDirection: 'row',
alignItems: 'center',
padding: 10
}
})

0 comments on commit b26e0c5

Please sign in to comment.