mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-28 04:27:35 +02:00
fix broken drawer button
This commit is contained in:
@@ -109,7 +109,14 @@ export default function InputStep({
|
|||||||
flex={1}
|
flex={1}
|
||||||
{...register("amount", { valueAsNumber: true, min: 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
|
{actionName} {readablizeSats(watch("amount"))} sats
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@@ -141,6 +141,7 @@ export default function PayStep({ callbacks, onComplete }: { callbacks: PayReque
|
|||||||
colorScheme="yellow"
|
colorScheme="yellow"
|
||||||
onClick={payAllWithWebLN}
|
onClick={payAllWithWebLN}
|
||||||
isLoading={payingAll}
|
isLoading={payingAll}
|
||||||
|
isDisabled={!window.webln}
|
||||||
>
|
>
|
||||||
Pay All
|
Pay All
|
||||||
</Button>
|
</Button>
|
||||||
|
@@ -1,18 +1,31 @@
|
|||||||
|
import { MouseEventHandler, useCallback } from "react";
|
||||||
import { IconButton, IconButtonProps } from "@chakra-ui/react";
|
import { IconButton, IconButtonProps } from "@chakra-ui/react";
|
||||||
import { To } from "react-router-dom";
|
import { To } from "react-router-dom";
|
||||||
|
|
||||||
import { DrawerIcon } from "./icons";
|
import { DrawerIcon } from "./icons";
|
||||||
import { useNavigateInDrawer } from "../providers/drawer-sub-view-provider";
|
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 navigate = useNavigateInDrawer();
|
||||||
|
|
||||||
|
const handleClick = useCallback<MouseEventHandler<HTMLButtonElement>>(
|
||||||
|
(e) => {
|
||||||
|
navigate(to);
|
||||||
|
if (onClick) onClick(e);
|
||||||
|
},
|
||||||
|
[navigate, onClick],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={<DrawerIcon />}
|
icon={<DrawerIcon />}
|
||||||
aria-label="Open in drawer"
|
aria-label="Open in drawer"
|
||||||
title="Open in drawer"
|
title="Open in drawer"
|
||||||
onClick={() => navigate(to)}
|
onClick={handleClick}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@@ -36,7 +36,7 @@ function TorrentTableRow({ torrent }: { torrent: NostrEvent }) {
|
|||||||
if (location.pathname.startsWith("/torrents")) {
|
if (location.pathname.startsWith("/torrents")) {
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
params.set("tags", c.tags.join(","));
|
params.set("tags", c.tags.join(","));
|
||||||
return `/torrents` + params.toString();
|
return `/torrents?` + params.toString();
|
||||||
}
|
}
|
||||||
return `/torrents?tags=${c.tags.join(",")}`;
|
return `/torrents?tags=${c.tags.join(",")}`;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user