mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-11 05:09:36 +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.pathname +
|
||||
(match.search && match.search.length < 20 ? "?" + match.search : "") +
|
||||
(match.hash.length < 20 ? match.hash : "")}
|
||||
(match.search && match.search.length < 120 ? match.search : "") +
|
||||
(match.hash.length < 96 ? match.hash : "")}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ function UserCard({ children, pubkey }: PropsWithChildren & { pubkey: string })
|
||||
}
|
||||
function PayRequestCard({ pubkey, invoice, onPaid }: { pubkey: string; invoice: string; onPaid: () => void }) {
|
||||
const toast = useToast();
|
||||
const showMore = useDisclosure();
|
||||
const showMore = useDisclosure({ defaultIsOpen: !window.webln });
|
||||
|
||||
const payWithWebLn = async () => {
|
||||
try {
|
||||
@ -39,16 +39,18 @@ function PayRequestCard({ pubkey, invoice, onPaid }: { pubkey: string; invoice:
|
||||
<Flex direction="column" gap="2">
|
||||
<UserCard pubkey={pubkey}>
|
||||
<ButtonGroup size="sm">
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme="yellow"
|
||||
size="sm"
|
||||
leftIcon={<LightningIcon />}
|
||||
isDisabled={!window.webln}
|
||||
onClick={payWithWebLn}
|
||||
>
|
||||
Pay
|
||||
</Button>
|
||||
{!!window.webln && (
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme="yellow"
|
||||
size="sm"
|
||||
leftIcon={<LightningIcon />}
|
||||
isDisabled={!window.webln}
|
||||
onClick={payWithWebLn}
|
||||
>
|
||||
Pay
|
||||
</Button>
|
||||
)}
|
||||
<IconButton
|
||||
icon={showMore.isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
||||
aria-label="More Options"
|
||||
@ -132,17 +134,18 @@ export default function PayStep({ callbacks, onComplete }: { callbacks: PayReque
|
||||
);
|
||||
return null;
|
||||
})}
|
||||
<Button
|
||||
variant="outline"
|
||||
size="md"
|
||||
leftIcon={<LightningIcon />}
|
||||
colorScheme="yellow"
|
||||
onClick={payAllWithWebLN}
|
||||
isLoading={payingAll}
|
||||
isDisabled={!window.webln}
|
||||
>
|
||||
Pay All
|
||||
</Button>
|
||||
{!!window.webln && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="md"
|
||||
leftIcon={<LightningIcon />}
|
||||
colorScheme="yellow"
|
||||
onClick={payAllWithWebLN}
|
||||
isLoading={payingAll}
|
||||
>
|
||||
Pay All
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user