Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor improvements #145

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading