1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

fix bad alignment in context menus

This commit is contained in:
mrjvs 2023-10-20 23:30:46 +02:00
parent 18b434c9ac
commit a3b64c5105

View file

@ -56,14 +56,12 @@ export function Link(props: {
children?: ReactNode;
className?: string;
}) {
const classes = classNames(
"flex py-2 px-3 rounded w-full -ml-3 w-[calc(100%+1.5rem)]",
{
const classes = classNames("flex py-2 px-3 rounded w-full -ml-3", {
"cursor-default": !props.clickable,
"hover:bg-video-context-border cursor-pointer": props.clickable,
"bg-video-context-border": props.active,
}
);
});
const styles = { width: "calc(100% + 1.5rem)" };
const content = (
<div className={classNames("flex items-center flex-1", props.className)}>
@ -73,11 +71,20 @@ export function Link(props: {
);
if (!props.onClick) {
return <div className={classes}>{content}</div>;
return (
<div className={classes} style={styles}>
{content}
</div>
);
}
return (
<button type="button" className={classes} onClick={props.onClick}>
<button
type="button"
className={classes}
style={styles}
onClick={props.onClick}
>
{content}
</button>
);