mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 21:31:43 +01:00
fix z-index for embed buttons
This commit is contained in:
parent
2bac97b819
commit
83c1616eeb
@ -25,10 +25,14 @@ export default function EmbedActions({
|
||||
|
||||
return (
|
||||
<ButtonGroup variant="link" size="sm" {...props}>
|
||||
<Button onClick={() => onToggle(!open)}>
|
||||
<Button onClick={() => onToggle(!open)} zIndex={1}>
|
||||
[ {label} {open ? <ChevronDownIcon /> : <ChevronUpIcon />} ]
|
||||
</Button>
|
||||
{navigator.clipboard && url && <Button onClick={copy}>{copied ? "[ Copied ]" : "[ Copy ]"}</Button>}
|
||||
{navigator.clipboard && url && (
|
||||
<Button onClick={copy} zIndex={1}>
|
||||
{copied ? "[ Copied ]" : "[ Copy ]"}
|
||||
</Button>
|
||||
)}
|
||||
{open && url && (
|
||||
<Button as={Link} href={url.toString()} isExternal>
|
||||
[ Open ]
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { MouseEvent, MouseEventHandler, forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
Button,
|
||||
ButtonProps,
|
||||
Code,
|
||||
Image,
|
||||
ImageProps,
|
||||
@ -112,7 +113,11 @@ export function EmbeddedImage({ src, event, imageProps, ...props }: EmbeddedImag
|
||||
);
|
||||
}
|
||||
|
||||
function VerifyImageButton({ src, original }: { src: URL; original: string }) {
|
||||
function VerifyImageButton({
|
||||
src,
|
||||
original,
|
||||
...props
|
||||
}: { src: URL; original: string } & Omit<ButtonProps, "children" | "onClick">) {
|
||||
const toast = useToast();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@ -144,6 +149,7 @@ function VerifyImageButton({ src, original }: { src: URL; original: string }) {
|
||||
onClick={verify}
|
||||
isLoading={loading}
|
||||
colorScheme={matches === undefined ? undefined : matches ? "green" : "red"}
|
||||
{...props}
|
||||
>
|
||||
[ {matches === undefined ? "Verify" : matches ? "Valid" : "Invalid!"} ]
|
||||
</Button>
|
||||
@ -177,7 +183,7 @@ export function renderImageUrl(match: URL) {
|
||||
<ExpandableEmbed
|
||||
label="Image"
|
||||
url={match}
|
||||
actions={hash ? <VerifyImageButton src={match} original={hash} /> : undefined}
|
||||
actions={hash ? <VerifyImageButton src={match} original={hash} zIndex={1} /> : undefined}
|
||||
hideOnDefaultOpen={!hash}
|
||||
>
|
||||
<EmbeddedImage src={match.toString()} imageProps={{ maxH: ["initial", "35vh"] }} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user