1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +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; children?: ReactNode;
className?: string; className?: string;
}) { }) {
const classes = classNames( const classes = classNames("flex py-2 px-3 rounded w-full -ml-3", {
"flex py-2 px-3 rounded w-full -ml-3 w-[calc(100%+1.5rem)]", "cursor-default": !props.clickable,
{ "hover:bg-video-context-border cursor-pointer": props.clickable,
"cursor-default": !props.clickable, "bg-video-context-border": props.active,
"hover:bg-video-context-border cursor-pointer": props.clickable, });
"bg-video-context-border": props.active, const styles = { width: "calc(100% + 1.5rem)" };
}
);
const content = ( const content = (
<div className={classNames("flex items-center flex-1", props.className)}> <div className={classNames("flex items-center flex-1", props.className)}>
@ -73,11 +71,20 @@ export function Link(props: {
); );
if (!props.onClick) { if (!props.onClick) {
return <div className={classes}>{content}</div>; return (
<div className={classes} style={styles}>
{content}
</div>
);
} }
return ( return (
<button type="button" className={classes} onClick={props.onClick}> <button
type="button"
className={classes}
style={styles}
onClick={props.onClick}
>
{content} {content}
</button> </button>
); );