Skip to content

Commit 40dd7db

Browse files
committed
feat: add modal explainer for pending payment clock icon in NWC header
1 parent 48d08cc commit 40dd7db

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

locales/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,7 @@
16201620
"views.Settings.Ecash.sweepThresholdSatsTitle": "Mint sweep threshold",
16211621
"views.Settings.Ecash.sweepThresholdSatsTitle.description": "Funds will be automatically swept to your self-custodial wallet if the balance you have with a mint exceeds this threshold.",
16221622
"views.Settings.NostrWalletConnect.title": "Nostr Wallet Connect service",
1623+
"views.Settings.NWC.title": "NWC service",
16231624
"views.Settings.NostrWalletConnect.connections": "Connections",
16241625
"views.Settings.NostrWalletConnect.noConnections": "No connections created yet. Create a connection to allow external apps to connect to your wallet.",
16251626
"views.Settings.NostrWalletConnect.connectionName": "Connection Name",
@@ -1711,6 +1712,10 @@
17111712
"views.Settings.NostrWalletConnect.error.failedToProcessPayments": "Failed to process payments",
17121713
"views.Settings.NostrWalletConnect.error.failedToLoadActivity": "Failed to load activity",
17131714
"views.Settings.NostrWalletConnect.confirmDeletePendingPayments": "Are you sure you want to delete all pending payments?",
1715+
"views.Settings.NostrWalletConnect.pendingPaymentIcon.title": "Pending Payment Requests",
1716+
"views.Settings.NostrWalletConnect.pendingPaymentIcon.explainer": "This clock icon indicates that you have pending payment requests from your Nostr Wallet Connect connections. These are payment requests that have been received but not yet processed.",
1717+
"views.Settings.NostrWalletConnect.pendingPaymentIcon.viewPayments": "View Pending Payments",
1718+
"views.Settings.NostrWalletConnect.pendingPaymentIcon.accessibilityLabel": "Pending payment requests",
17141719
"views.Settings.NostrWalletConnect.totalSpent": "Total Spent",
17151720
"views.Settings.NostrWalletConnect.remainingBudget": "Remaining Budget",
17161721
"views.Settings.NostrWalletConnect.warning.walletBalanceLowerThanBudget": "Your main wallet balance is lower than this connection’s budget. Please review and update it",

views/Settings/NostrWalletConnect/NWCConnectionsList.tsx

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Tag } from '../../../components/Channels/Tag';
2020

2121
import SettingsStore from '../../../stores/SettingsStore';
2222
import NostrWalletConnectStore from '../../../stores/NostrWalletConnectStore';
23+
import ModalStore from '../../../stores/ModalStore';
2324

2425
import { themeColor } from '../../../utils/ThemeUtils';
2526
import { localeString } from '../../../utils/LocaleUtils';
@@ -40,6 +41,7 @@ interface NWCConnectionsListProps {
4041
navigation: StackNavigationProp<any, any>;
4142
SettingsStore: SettingsStore;
4243
NostrWalletConnectStore: NostrWalletConnectStore;
44+
ModalStore: ModalStore;
4345
}
4446

4547
enum ConnectionFilter {
@@ -56,7 +58,7 @@ interface NWCConnectionsListState {
5658
hasPendingPayments: boolean;
5759
}
5860

59-
@inject('SettingsStore', 'NostrWalletConnectStore')
61+
@inject('SettingsStore', 'NostrWalletConnectStore', 'ModalStore')
6062
@observer
6163
export default class NWCConnectionsList extends React.Component<
6264
NWCConnectionsListProps,
@@ -423,7 +425,9 @@ export default class NWCConnectionsList extends React.Component<
423425
leftComponent="Back"
424426
centerComponent={{
425427
text: localeString(
426-
'views.Settings.NostrWalletConnect.title'
428+
hasPendingPayments
429+
? 'views.Settings.NWC.title'
430+
: 'views.Settings.NostrWalletConnect.title'
427431
),
428432
style: {
429433
color: themeColor('text'),
@@ -462,11 +466,32 @@ export default class NWCConnectionsList extends React.Component<
462466
</TouchableOpacity>
463467
{hasPendingPayments && (
464468
<TouchableOpacity
465-
onPress={() =>
466-
navigation.navigate(
467-
'NWCPendingPayments'
468-
)
469-
}
469+
onPress={() => {
470+
const { ModalStore } = this.props;
471+
ModalStore.toggleInfoModal({
472+
title: localeString(
473+
'views.Settings.NostrWalletConnect.pendingPaymentIcon.title'
474+
),
475+
text: localeString(
476+
'views.Settings.NostrWalletConnect.pendingPaymentIcon.explainer'
477+
),
478+
buttons: [
479+
{
480+
title: localeString(
481+
'views.Settings.NostrWalletConnect.pendingPaymentIcon.viewPayments'
482+
),
483+
callback: () => {
484+
navigation.navigate(
485+
'NWCPendingPayments'
486+
);
487+
}
488+
}
489+
]
490+
});
491+
}}
492+
accessibilityLabel={localeString(
493+
'views.Settings.NostrWalletConnect.pendingPaymentIcon.accessibilityLabel'
494+
)}
470495
>
471496
<ClockIcon
472497
color={themeColor('bitcoin')}

0 commit comments

Comments
 (0)