Reworked front resource details page to support tv series

This commit is contained in:
Aleksi Lassila
2023-07-11 20:32:29 +03:00
parent 75b250258c
commit e544eff886
12 changed files with 300 additions and 145 deletions

View File

@@ -11,7 +11,7 @@
export let href: string | undefined = undefined;
export let target: string | undefined = undefined;
let buttonStyle;
let buttonStyle: string;
$: buttonStyle = classNames(
'border-2 border-white transition-all uppercase tracking-widest text-xs whitespace-nowrap',
{
@@ -27,9 +27,9 @@
}
);
const handleClick = (event) => {
const handleClick = (event: MouseEvent) => {
if (href) {
if (target === '_blank') window.open(href, target).focus();
if (target === '_blank') window.open(href, target)?.focus();
else window.open(href, target as string);
} else {
dispatch('click', event);
@@ -37,6 +37,7 @@
};
</script>
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
<button class={buttonStyle} on:click={handleClick} on:mouseover on:mouseleave {disabled}>
<slot />
</button>