small changes to link display

This commit is contained in:
hzrd149 2024-01-29 10:00:49 +00:00
parent 92fe0bb27d
commit 9f79c622f7
2 changed files with 27 additions and 24 deletions

View File

@ -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>
);
}

View File

@ -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>
);
}