From 019d66f255d7023025de867e2137148c708e6b90 Mon Sep 17 00:00:00 2001 From: Rob de Kort Date: Fri, 1 Mar 2024 14:30:06 +0100 Subject: [PATCH] Use extendable reusable consent gate partial (#386) --- .../components/_consent_gate.antlers.html | 38 +++++++++++++++ .../views/components/_video.antlers.html | 46 +++---------------- 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 resources/views/components/_consent_gate.antlers.html diff --git a/resources/views/components/_consent_gate.antlers.html b/resources/views/components/_consent_gate.antlers.html new file mode 100644 index 00000000..5fb90a73 --- /dev/null +++ b/resources/views/components/_consent_gate.antlers.html @@ -0,0 +1,38 @@ +{{# + @name Consent gate + @desc An ext +#}} + + +{{ _consent_embeds = + (environment == 'local' && seo:trackers_local && seo:embeds) or + (environment == 'staging' && seo:trackers_staging && seo:embeds) or + (environment == 'production' && seo:trackers_production && seo:embeds) +}} +
+
+ {{ if _consent_embeds }} + + + {{ else }} + {{ slot }} + {{ /if }} +
+ + {{ slot:append }} +
+ diff --git a/resources/views/components/_video.antlers.html b/resources/views/components/_video.antlers.html index e8b1afd7..73e66945 100644 --- a/resources/views/components/_video.antlers.html +++ b/resources/views/components/_video.antlers.html @@ -5,43 +5,11 @@ #}} -{{ consent_embeds = - (environment == 'local' && seo:trackers_local && seo:embeds) or - (environment == 'staging' && seo:trackers_staging && seo:embeds) or - (environment == 'production' && seo:trackers_production && seo:embeds) -}} -
-
- {{ if consent_embeds }} - - - {{ else }} - - {{ /if }} -
+{{ partial:components/consent_gate class="not-prose my-8 { switch((size == 'md') => 'span-md', (size == 'lg') => 'span-lg', (size == 'xl') => 'span-xl', () => 'span-md')}" }} + - {{ partial:typography/caption }} -
- + {{ slot:append }} + {{ partial:typography/caption }} + {{ /slot:append }} +{{ /partial:components/consent_gate }} + \ No newline at end of file