Fix unnecessary clickable links in dynamic grid

This commit is contained in:
Kuba Orlik 2026-08-18 20:38:11 +02:00
parent 83fe4c4872
commit f844ca660f

View File

@ -22,13 +22,21 @@ const component_arguments = {
new ComponentArguments.Structured({ new ComponentArguments.Structured({
title: new ComponentArguments.ShortText(), title: new ComponentArguments.ShortText(),
subtitle: new ComponentArguments.ShortText(), subtitle: new ComponentArguments.ShortText(),
url: new ComponentArguments.ShortText(), url: new ComponentArguments.ShortText().setDefaultValue(""),
photo: new ComponentArguments.Structured({ photo: new ComponentArguments.Structured({
image: new ComponentArguments.Image(), image: new ComponentArguments.Image(),
alt: new ComponentArguments.ShortText(), alt: new ComponentArguments.ShortText(),
}), }),
shape: new ComponentArguments.Enum(["square", "horizontal", "vertical"]), shape: new ComponentArguments.Enum([
background: new ComponentArguments.Enum(["accent", "accent2", "text-bg"]), "square",
"horizontal",
"vertical",
]).setDefaultValue("square"),
background: new ComponentArguments.Enum([
"accent",
"accent2",
"text-bg",
]).setDefaultValue("accent"),
}) })
), ),
} as const; } as const;
@ -50,7 +58,7 @@ export class DynamicGridV2 extends Component<typeof component_arguments> {
) { ) {
return ( return (
<a <a
href={[tile.url]} href={tile.url || false}
class={["tile", tile.shape]} class={["tile", tile.shape]}
style={[ style={[
`--tile-bg-color: var(--color-brand-${tile.background})`, `--tile-bg-color: var(--color-brand-${tile.background})`,