mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-26 17:52:18 +01:00
fix broken drawer button
This commit is contained in:
parent
15ae01bccf
commit
9d939069c9
@ -109,7 +109,14 @@ export default function InputStep({
|
||||
flex={1}
|
||||
{...register("amount", { valueAsNumber: true, min: 1 })}
|
||||
/>
|
||||
<Button leftIcon={<LightningIcon />} type="submit" isLoading={isSubmitting} variant="solid" size="md">
|
||||
<Button
|
||||
leftIcon={<LightningIcon />}
|
||||
type="submit"
|
||||
isLoading={isSubmitting}
|
||||
variant="solid"
|
||||
size="md"
|
||||
autoFocus
|
||||
>
|
||||
{actionName} {readablizeSats(watch("amount"))} sats
|
||||
</Button>
|
||||
</Flex>
|
||||
|
@ -141,6 +141,7 @@ export default function PayStep({ callbacks, onComplete }: { callbacks: PayReque
|
||||
colorScheme="yellow"
|
||||
onClick={payAllWithWebLN}
|
||||
isLoading={payingAll}
|
||||
isDisabled={!window.webln}
|
||||
>
|
||||
Pay All
|
||||
</Button>
|
||||
|
@ -1,18 +1,31 @@
|
||||
import { MouseEventHandler, useCallback } from "react";
|
||||
import { IconButton, IconButtonProps } from "@chakra-ui/react";
|
||||
import { To } from "react-router-dom";
|
||||
|
||||
import { DrawerIcon } from "./icons";
|
||||
import { useNavigateInDrawer } from "../providers/drawer-sub-view-provider";
|
||||
|
||||
export default function OpenInDrawerButton({ to, ...props }: Omit<IconButtonProps, "aria-label"> & { to: To }) {
|
||||
export default function OpenInDrawerButton({
|
||||
to,
|
||||
onClick,
|
||||
...props
|
||||
}: Omit<IconButtonProps, "aria-label"> & { to: To }) {
|
||||
const navigate = useNavigateInDrawer();
|
||||
|
||||
const handleClick = useCallback<MouseEventHandler<HTMLButtonElement>>(
|
||||
(e) => {
|
||||
navigate(to);
|
||||
if (onClick) onClick(e);
|
||||
},
|
||||
[navigate, onClick],
|
||||
);
|
||||
|
||||
return (
|
||||
<IconButton
|
||||
icon={<DrawerIcon />}
|
||||
aria-label="Open in drawer"
|
||||
title="Open in drawer"
|
||||
onClick={() => navigate(to)}
|
||||
onClick={handleClick}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
@ -36,7 +36,7 @@ function TorrentTableRow({ torrent }: { torrent: NostrEvent }) {
|
||||
if (location.pathname.startsWith("/torrents")) {
|
||||
const params = new URLSearchParams(location.search);
|
||||
params.set("tags", c.tags.join(","));
|
||||
return `/torrents` + params.toString();
|
||||
return `/torrents?` + params.toString();
|
||||
}
|
||||
return `/torrents?tags=${c.tags.join(",")}`;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user