Skip to content

Commit

Permalink
chore: minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Oct 1, 2024
1 parent 25c3e3a commit 8847d10
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion components/AlbyBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function AlbyBanner() {
{ value: 10000, emoji: '🚀' }
];

function isPaymentOlderThan24Hours(paymentDate: Date | undefined) {
function isPaymentOlderThan24Hours(paymentDate: Date | null) {
if (!paymentDate) return true;

const currentDate = new Date();
Expand All @@ -39,6 +39,7 @@ function AlbyBanner() {
key={value}
variant="secondary"
size="sm"
className="flex-1"
onPress={() => {
router.navigate({
pathname: "/send",
Expand Down
2 changes: 1 addition & 1 deletion lib/state/appStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface AppState {
addAddressBookEntry(entry: AddressBookEntry): void;
reset(): void;
showOnboarding(): void;
getLastAlbyPayment(): Date | undefined;
getLastAlbyPayment(): Date | null;
updateLastAlbyPayment(): void;
}

Expand Down
28 changes: 14 additions & 14 deletions pages/settings/wallets/EditWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { DEFAULT_WALLET_NAME } from "~/lib/constants";
import { useAppStore } from "~/lib/state/appStore";
import * as Clipboard from "expo-clipboard";
import Screen from "~/components/Screen";
import { TriangleAlert } from "~/components/Icons";
import { Nip47Capability } from "@getalby/sdk/dist/NWCClient";

export function EditWallet() {
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
Expand All @@ -22,20 +24,18 @@ export function EditWallet() {
<Screen
title="Edit Wallet"
/>
{(wallets[selectedWalletId].nwcCapabilities || []).indexOf(
"notifications",
) < 0 && (
<Text>
Warning: Your wallet does not support notifications capability.
</Text>
)}
{(wallets[selectedWalletId].nwcCapabilities || []).indexOf(
"list_transactions",
) < 0 && (
<Text>
Warning: Your wallet does not support list_transactions capability.
</Text>
)}
{(["notifications", "list_transactions"] as Nip47Capability[]).map(capability =>
(wallets[selectedWalletId].nwcCapabilities || []).indexOf(capability) < 0 && (
<Card key={capability}>
<CardHeader>
<CardTitle className="flex flex-row gap-3 items-center">
<TriangleAlert size={16} className="text-foreground" />
<Text>Your wallet does not support {capability}</Text>
</CardTitle>
</CardHeader>
</Card>
)
)}
<Link href={`/settings/wallets/${selectedWalletId}/name`} asChild>
<Pressable>
<Card className="w-full">
Expand Down

0 comments on commit 8847d10

Please sign in to comment.