mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-10-05 19:28:26 +00:00
Tune Optimize ecash screen UI
This commit is contained in:
@@ -36,11 +36,10 @@ import { ContactsStoreSnapshot } from '../models/ContactsStore'
|
||||
import { MintsStoreSnapshot } from '../models/MintsStore'
|
||||
import { ResultModalInfo } from './Wallet/ResultModalInfo'
|
||||
import { verticalScale } from '@gocodingnow/rn-size-matters'
|
||||
import { Token, getDecodedToken, getEncodedToken } from '@cashu/cashu-ts'
|
||||
import { minibitsPngIcon } from '../components/MinibitsIcon'
|
||||
import { Token, getEncodedToken } from '@cashu/cashu-ts'
|
||||
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
||||
|
||||
const OPTIMIZE_FROM_PROOFS_COUNT = 4
|
||||
const OPTIMIZE_FROM_PROOFS_COUNT = 10
|
||||
type Props = StaticScreenProps<undefined>
|
||||
|
||||
export const ExportBackupScreen = function ExportBackup({ route }: Props) {
|
||||
@@ -329,7 +328,7 @@ export const ExportBackupScreen = function ExportBackup({ route }: Props) {
|
||||
preset='secondary'
|
||||
onPress={() => navigation.navigate('OptimizeEcash')}
|
||||
textStyle={{lineHeight: verticalScale(16), fontSize: verticalScale(14)}}
|
||||
style={{minHeight: verticalScale(40), paddingVertical: verticalScale(spacing.tiny)}}
|
||||
style={{minHeight: verticalScale(40), paddingVertical: verticalScale(spacing.tiny), marginRight: spacing.tiny, marginTop: -spacing.tiny}}
|
||||
text={'Optimize'}
|
||||
/>
|
||||
)}
|
||||
@@ -501,7 +500,8 @@ const $rightContainer: ViewStyle = {
|
||||
// alignSelf: 'center',
|
||||
marginLeft: spacing.tiny,
|
||||
marginRight: -10,
|
||||
flexDirection: 'row'
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
}
|
||||
|
||||
const $bottomContainer: ViewStyle = {
|
||||
|
||||
@@ -28,7 +28,7 @@ import {ResultModalInfo} from './Wallet/ResultModalInfo'
|
||||
import {verticalScale} from '@gocodingnow/rn-size-matters'
|
||||
import {StaticScreenProps, useNavigation} from '@react-navigation/native'
|
||||
|
||||
const OPTIMIZE_DENOMINATION_THRESHOLD = 1
|
||||
const OPTIMIZE_DENOMINATION_THRESHOLD = 5
|
||||
|
||||
type Props = StaticScreenProps<undefined>
|
||||
|
||||
@@ -148,14 +148,16 @@ export const OptimizeEcashScreen = function OptimizeEcash(_props: Props) {
|
||||
{denominationCounts.length === 0 ? (
|
||||
<ListItem text="No ecash proofs found." />
|
||||
) : (
|
||||
denominationCounts.map(({denomination, count}) => (
|
||||
denominationCounts.map(({denomination, count}, index) => (
|
||||
<ListItem
|
||||
key={denomination}
|
||||
text={`${denomination} sat`}
|
||||
subText={`Count: ${count}`}
|
||||
text={`${denomination}`}
|
||||
leftIcon='faMoneyBill1'
|
||||
//subText={`Count: ${count}`}
|
||||
RightComponent={
|
||||
count > OPTIMIZE_DENOMINATION_THRESHOLD ? (
|
||||
<View style={$rightContainer}>
|
||||
<Text preset="formHelper" text={`${count}x`} style={{color: hint, marginRight: spacing.small}} />
|
||||
{count > OPTIMIZE_DENOMINATION_THRESHOLD ? (
|
||||
<Button
|
||||
preset="secondary"
|
||||
text="Optimize"
|
||||
@@ -163,9 +165,11 @@ export const OptimizeEcashScreen = function OptimizeEcash(_props: Props) {
|
||||
textStyle={{lineHeight: verticalScale(16), fontSize: verticalScale(14)}}
|
||||
style={{minHeight: verticalScale(40), paddingVertical: verticalScale(spacing.tiny)}}
|
||||
/>
|
||||
|
||||
) : undefined}
|
||||
</View>
|
||||
) : undefined
|
||||
}
|
||||
bottomSeparator={index !== denominationCounts.length - 1 ? true : false}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
@@ -272,6 +276,7 @@ const $rightContainer: ViewStyle = {
|
||||
marginLeft: spacing.tiny,
|
||||
marginRight: -10,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
}
|
||||
|
||||
const $hintContainer: ViewStyle = {
|
||||
|
||||
Reference in New Issue
Block a user