From 6b0a2793c573c0fc8f6e5caddb5c07de70916fbe Mon Sep 17 00:00:00 2001 From: Keziah Date: Sun, 14 Apr 2024 18:55:52 +0200 Subject: [PATCH] feat(build): improve layout of images/video --- .../components/molecules/LikeBuildButton.vue | 1 + frontend/src/pages/build/[id].astro | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/molecules/LikeBuildButton.vue b/frontend/src/components/molecules/LikeBuildButton.vue index 37559d9..5449916 100644 --- a/frontend/src/components/molecules/LikeBuildButton.vue +++ b/frontend/src/components/molecules/LikeBuildButton.vue @@ -8,6 +8,7 @@ const props = defineProps<{ build?: ErBuild, hasVoted?: boolean + class?: string }>() const hasVoted = ref(props.hasVoted) diff --git a/frontend/src/pages/build/[id].astro b/frontend/src/pages/build/[id].astro index b6aa84f..2839dd8 100644 --- a/frontend/src/pages/build/[id].astro +++ b/frontend/src/pages/build/[id].astro @@ -11,7 +11,7 @@ const REGEX_YOUTUBE_URL = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\ const { id } = Astro.params const build: ErBuild = await apiFetch(`/api/er-builds/${id}`) -const [, youtubeId] = build.youtube_url.match(REGEX_YOUTUBE_URL) +const youtubeMatches = build.youtube_url?.match(REGEX_YOUTUBE_URL) ---