mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-10-05 11:18:24 +00:00
Upgrade to RN077
This commit is contained in:
+1
-1
@@ -7,4 +7,4 @@ insert_final_newline = true
|
|||||||
[*.{js,json,yml}]
|
[*.{js,json,yml}]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 4
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
diff --git a/node_modules/react-native-nitro-sqlite/cpp/operations.cpp b/node_modules/react-native-nitro-sqlite/cpp/operations.cpp
|
|
||||||
index 0655754..88e80cd 100644
|
|
||||||
--- a/node_modules/react-native-nitro-sqlite/cpp/operations.cpp
|
|
||||||
+++ b/node_modules/react-native-nitro-sqlite/cpp/operations.cpp
|
|
||||||
@@ -165,7 +165,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str
|
|
||||||
switch (column_type) {
|
|
||||||
|
|
||||||
case SQLITE_INTEGER: {
|
|
||||||
- auto column_value = sqlite3_column_int64(statement, i);
|
|
||||||
+ auto column_value = sqlite3_column_double(statement, i);
|
|
||||||
row[column_name] = column_value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
+22
-22
@@ -11,18 +11,18 @@ export interface TransactionRecord {
|
|||||||
fee: number
|
fee: number
|
||||||
unit: MintUnit
|
unit: MintUnit
|
||||||
data: string
|
data: string
|
||||||
sentFrom?: string
|
sentFrom?: string | null
|
||||||
sentTo?: string
|
sentTo?: string | null
|
||||||
profile?: string
|
profile?: string | null
|
||||||
memo?: string
|
memo?: string | null
|
||||||
zapRequest?: string
|
zapRequest?: string | null
|
||||||
inputToken?: string
|
inputToken?: string | null
|
||||||
outputToken?: string
|
outputToken?: string | null
|
||||||
proof?: string
|
proof?: string | null
|
||||||
mint: string
|
mint: string
|
||||||
balanceAfter?: number
|
balanceAfter?: number | null
|
||||||
noteToSelf?: string
|
noteToSelf?: string | null
|
||||||
tags?: Array<string>
|
tags?: Array<string> | null
|
||||||
status: TransactionStatus
|
status: TransactionStatus
|
||||||
createdAt: Date
|
createdAt: Date
|
||||||
}
|
}
|
||||||
@@ -63,18 +63,18 @@ export const TransactionModel = types
|
|||||||
fee: types.optional(types.integer, 0),
|
fee: types.optional(types.integer, 0),
|
||||||
unit: types.frozen<MintUnit>(),
|
unit: types.frozen<MintUnit>(),
|
||||||
data: types.string,
|
data: types.string,
|
||||||
sentFrom: types.maybe(types.string),
|
sentFrom: types.maybe(types.maybeNull(types.string)),
|
||||||
sentTo: types.maybe(types.string),
|
sentTo: types.maybe(types.maybeNull(types.string)),
|
||||||
profile: types.maybe(types.string),
|
profile: types.maybe(types.maybeNull(types.string)),
|
||||||
memo: types.maybe(types.string),
|
memo: types.maybe(types.maybeNull(types.string)),
|
||||||
mint: types.string,
|
mint: types.string,
|
||||||
zapRequest: types.maybe(types.string),
|
zapRequest: types.maybe(types.maybeNull(types.string)),
|
||||||
inputToken: types.maybe(types.string),
|
inputToken: types.maybe(types.maybeNull(types.string)),
|
||||||
outputToken: types.maybe(types.string),
|
outputToken: types.maybe(types.maybeNull(types.string)),
|
||||||
proof: types.maybe(types.string),
|
proof: types.maybe(types.maybeNull(types.string)),
|
||||||
balanceAfter: types.maybe(types.integer),
|
balanceAfter: types.maybe(types.maybeNull(types.integer)),
|
||||||
noteToSelf: types.maybe(types.string),
|
noteToSelf: types.maybe(types.maybeNull(types.string)),
|
||||||
tags: types.maybe(types.array(types.string)),
|
tags: types.maybe(types.maybeNull(types.array(types.string))),
|
||||||
status: types.frozen<TransactionStatus>(),
|
status: types.frozen<TransactionStatus>(),
|
||||||
createdAt: types.optional(types.Date, new Date()),
|
createdAt: types.optional(types.Date, new Date()),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,29 +4,29 @@ import {
|
|||||||
types,
|
types,
|
||||||
flow,
|
flow,
|
||||||
detach,
|
detach,
|
||||||
} from 'mobx-state-tree'
|
} from 'mobx-state-tree'
|
||||||
import {withSetPropAction} from './helpers/withSetPropAction'
|
import {withSetPropAction} from './helpers/withSetPropAction'
|
||||||
import {
|
import {
|
||||||
TransactionModel,
|
TransactionModel,
|
||||||
Transaction,
|
Transaction,
|
||||||
TransactionStatus,
|
TransactionStatus,
|
||||||
TransactionRecord,
|
TransactionRecord,
|
||||||
} from './Transaction'
|
} from './Transaction'
|
||||||
import {Database} from '../services'
|
import {Database} from '../services'
|
||||||
import {log} from '../services/logService'
|
import {log} from '../services/logService'
|
||||||
import { getRootStore } from './helpers/getRootStore'
|
import { getRootStore } from './helpers/getRootStore'
|
||||||
import { formatDistance } from 'date-fns'
|
import { formatDistance } from 'date-fns'
|
||||||
import { MintUnit } from '../services/wallet/currency'
|
import { MintUnit } from '../services/wallet/currency'
|
||||||
import { Mint } from './Mint'
|
import { Mint } from './Mint'
|
||||||
|
|
||||||
export const maxTransactionsInHistory = 10
|
export const maxTransactionsInHistory = 10
|
||||||
export const maxTransactionsByUnit = 3
|
export const maxTransactionsByUnit = 3
|
||||||
|
|
||||||
export type GroupedByTimeAgo = {
|
export type GroupedByTimeAgo = {
|
||||||
[timeAgo: string]: Transaction[];
|
[timeAgo: string]: Transaction[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TransactionsStoreModel = types
|
export const TransactionsStoreModel = types
|
||||||
.model('TransactionsStore', {
|
.model('TransactionsStore', {
|
||||||
transactionsMap: types.map(TransactionModel),
|
transactionsMap: types.map(TransactionModel),
|
||||||
history: types.array(types.safeReference(TransactionModel, { acceptsUndefined: false })),
|
history: types.array(types.safeReference(TransactionModel, { acceptsUndefined: false })),
|
||||||
@@ -196,11 +196,11 @@ export const TransactionsStoreModel = types
|
|||||||
}),
|
}),
|
||||||
addToHistory(limit: number, offset: number, onlyPending: boolean){
|
addToHistory(limit: number, offset: number, onlyPending: boolean){
|
||||||
// Appends transaction to the map and adds reference to history from database.
|
// Appends transaction to the map and adds reference to history from database.
|
||||||
const dbTransactions = Database.getTransactions(limit, offset, onlyPending)
|
const result = Database.getTransactions(limit, offset, onlyPending)
|
||||||
log.trace('[addToHistory] dbResult ids', {ids: dbTransactions.map(t => t.id)})
|
log.trace('[addToHistory] dbResult ids', {ids: result?._array.map(t => t.id)})
|
||||||
|
|
||||||
if (dbTransactions && dbTransactions.length > 0) {
|
if (result && result.length > 0) {
|
||||||
for (const dbTransaction of dbTransactions) {
|
for (const dbTransaction of result._array) {
|
||||||
const createdAt = new Date(dbTransaction.createdAt)
|
const createdAt = new Date(dbTransaction.createdAt)
|
||||||
const inStoreTransaction = {...dbTransaction, createdAt}
|
const inStoreTransaction = {...dbTransaction, createdAt}
|
||||||
|
|
||||||
@@ -333,8 +333,8 @@ export const TransactionsStoreModel = types
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh
|
// refresh
|
||||||
export interface TransactionsStore
|
export interface TransactionsStore
|
||||||
extends Instance<typeof TransactionsStoreModel> {}
|
extends Instance<typeof TransactionsStoreModel> {}
|
||||||
export interface TransactionsStoreSnapshot
|
export interface TransactionsStoreSnapshot
|
||||||
extends SnapshotOut<typeof TransactionsStoreModel> {}
|
extends SnapshotOut<typeof TransactionsStoreModel> {}
|
||||||
@@ -4,7 +4,7 @@ import { isObj } from '@cashu/cashu-ts/src/utils'
|
|||||||
import Clipboard from '@react-native-clipboard/clipboard'
|
import Clipboard from '@react-native-clipboard/clipboard'
|
||||||
import { observer } from 'mobx-react-lite'
|
import { observer } from 'mobx-react-lite'
|
||||||
import { getSnapshot } from 'mobx-state-tree'
|
import { getSnapshot } from 'mobx-state-tree'
|
||||||
import { DimensionValue, LayoutAnimation, Platform, TextStyle, UIManager, View, ViewStyle } from 'react-native'
|
import { DimensionValue, Image, LayoutAnimation, Platform, TextStyle, UIManager, View, ViewStyle } from 'react-native'
|
||||||
import JSONTree from 'react-native-json-tree'
|
import JSONTree from 'react-native-json-tree'
|
||||||
import {
|
import {
|
||||||
$sizeStyles,
|
$sizeStyles,
|
||||||
@@ -157,6 +157,18 @@ export const MintInfoScreen: FC<SettingsStackScreenProps<'MintInfo'>> = observer
|
|||||||
return (
|
return (
|
||||||
<Screen contentContainerStyle={$screen} preset="scroll">
|
<Screen contentContainerStyle={$screen} preset="scroll">
|
||||||
<View style={[$headerContainer, {backgroundColor: headerBg, justifyContent: 'space-around', paddingBottom: spacing.huge}]}>
|
<View style={[$headerContainer, {backgroundColor: headerBg, justifyContent: 'space-around', paddingBottom: spacing.huge}]}>
|
||||||
|
{mintInfo && mintInfo.icon_url ? (
|
||||||
|
<Image
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
width: spacing.extraLarge,
|
||||||
|
height: spacing.extraLarge,
|
||||||
|
borderRadius: spacing.small,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
source={{uri: mintInfo.icon_url}}
|
||||||
|
/>
|
||||||
|
):(
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
marginEnd: spacing.small,
|
marginEnd: spacing.small,
|
||||||
@@ -173,6 +185,7 @@ export const MintInfoScreen: FC<SettingsStackScreenProps<'MintInfo'>> = observer
|
|||||||
fill='white'
|
fill='white'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
<Text preset='subheading' text={mintInfo?.name ?? mint?.shortname} style={{color: headerTitle}}/>
|
<Text preset='subheading' text={mintInfo?.name ?? mint?.shortname} style={{color: headerTitle}}/>
|
||||||
{mint?.units && (
|
{mint?.units && (
|
||||||
<View style={{flexDirection: 'row'}}>
|
<View style={{flexDirection: 'row'}}>
|
||||||
@@ -494,7 +507,7 @@ function ContactCard(props: { info: GetInfoResponse, popupMessage: (msg: string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** don't render these because they're rendered in separate components */
|
/** don't render these because they're rendered in separate components */
|
||||||
const detailsHiddenKeys = new Set(['name', 'motd', 'description', 'description_long', 'nuts', 'contact'])
|
const detailsHiddenKeys = new Set(['name', 'motd', 'description', 'description_long', 'nuts', 'contact', 'icon_url', 'time'])
|
||||||
|
|
||||||
/** key-value pairs of details about the mint */
|
/** key-value pairs of details about the mint */
|
||||||
function MintInfoDetails(props: { info: GetInfoResponse, popupMessage: (msg: string) => void }) {
|
function MintInfoDetails(props: { info: GetInfoResponse, popupMessage: (msg: string) => void }) {
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ import {
|
|||||||
import codePush, { RemotePackage } from 'react-native-code-push'
|
import codePush, { RemotePackage } from 'react-native-code-push'
|
||||||
import {moderateScale, verticalScale} from '@gocodingnow/rn-size-matters'
|
import {moderateScale, verticalScale} from '@gocodingnow/rn-size-matters'
|
||||||
import { SvgXml } from 'react-native-svg'
|
import { SvgXml } from 'react-native-svg'
|
||||||
import notifee, { AndroidImportance } from '@notifee/react-native'
|
|
||||||
import { NavigationState, Route, TabBar, TabView } from 'react-native-tab-view'
|
import { NavigationState, Route, TabBar, TabView } from 'react-native-tab-view'
|
||||||
import { NotificationService, TASK_QUEUE_CHANNEL_ID, TASK_QUEUE_CHANNEL_NAME } from '../services/notificationService'
|
|
||||||
import {useThemeColor, spacing, colors, typography} from '../theme'
|
import {useThemeColor, spacing, colors, typography} from '../theme'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
Reference in New Issue
Block a user