mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-06-25 00:00:49 +02:00
small changes to link display
This commit is contained in:
parent
92fe0bb27d
commit
9f79c622f7
@ -10,8 +10,8 @@ export function renderGenericUrl(match: URL) {
|
|||||||
"//" +
|
"//" +
|
||||||
match.host +
|
match.host +
|
||||||
match.pathname +
|
match.pathname +
|
||||||
(match.search && match.search.length < 20 ? "?" + match.search : "") +
|
(match.search && match.search.length < 120 ? match.search : "") +
|
||||||
(match.hash.length < 20 ? match.hash : "")}
|
(match.hash.length < 96 ? match.hash : "")}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ function UserCard({ children, pubkey }: PropsWithChildren & { pubkey: string })
|
|||||||
}
|
}
|
||||||
function PayRequestCard({ pubkey, invoice, onPaid }: { pubkey: string; invoice: string; onPaid: () => void }) {
|
function PayRequestCard({ pubkey, invoice, onPaid }: { pubkey: string; invoice: string; onPaid: () => void }) {
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const showMore = useDisclosure();
|
const showMore = useDisclosure({ defaultIsOpen: !window.webln });
|
||||||
|
|
||||||
const payWithWebLn = async () => {
|
const payWithWebLn = async () => {
|
||||||
try {
|
try {
|
||||||
@ -39,16 +39,18 @@ function PayRequestCard({ pubkey, invoice, onPaid }: { pubkey: string; invoice:
|
|||||||
<Flex direction="column" gap="2">
|
<Flex direction="column" gap="2">
|
||||||
<UserCard pubkey={pubkey}>
|
<UserCard pubkey={pubkey}>
|
||||||
<ButtonGroup size="sm">
|
<ButtonGroup size="sm">
|
||||||
<Button
|
{!!window.webln && (
|
||||||
variant="outline"
|
<Button
|
||||||
colorScheme="yellow"
|
variant="outline"
|
||||||
size="sm"
|
colorScheme="yellow"
|
||||||
leftIcon={<LightningIcon />}
|
size="sm"
|
||||||
isDisabled={!window.webln}
|
leftIcon={<LightningIcon />}
|
||||||
onClick={payWithWebLn}
|
isDisabled={!window.webln}
|
||||||
>
|
onClick={payWithWebLn}
|
||||||
Pay
|
>
|
||||||
</Button>
|
Pay
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={showMore.isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
icon={showMore.isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
||||||
aria-label="More Options"
|
aria-label="More Options"
|
||||||
@ -132,17 +134,18 @@ export default function PayStep({ callbacks, onComplete }: { callbacks: PayReque
|
|||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
})}
|
})}
|
||||||
<Button
|
{!!window.webln && (
|
||||||
variant="outline"
|
<Button
|
||||||
size="md"
|
variant="outline"
|
||||||
leftIcon={<LightningIcon />}
|
size="md"
|
||||||
colorScheme="yellow"
|
leftIcon={<LightningIcon />}
|
||||||
onClick={payAllWithWebLN}
|
colorScheme="yellow"
|
||||||
isLoading={payingAll}
|
onClick={payAllWithWebLN}
|
||||||
isDisabled={!window.webln}
|
isLoading={payingAll}
|
||||||
>
|
>
|
||||||
Pay All
|
Pay All
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user