From 34217b2754c74ac8e32e2d4c1542f71c24061ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:57:39 -0500 Subject: [PATCH] feat: more progress --- .../GuideSection/components/YouTube.tsx | 118 ------------------ .../Tankopedia/GuideSection/index.tsx | 2 +- .../[...locale]/tanks/[slug]/index.astro | 12 +- 3 files changed, 8 insertions(+), 124 deletions(-) delete mode 100644 packages/website/src/components/Tankopedia/GuideSection/components/YouTube.tsx diff --git a/packages/website/src/components/Tankopedia/GuideSection/components/YouTube.tsx b/packages/website/src/components/Tankopedia/GuideSection/components/YouTube.tsx deleted file mode 100644 index 55c74e66f..000000000 --- a/packages/website/src/components/Tankopedia/GuideSection/components/YouTube.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import { youtubers } from '@blitzkit/core'; -import { CaretRightIcon } from '@radix-ui/react-icons'; -import { Box, Flex, Link, Skeleton, Text } from '@radix-ui/themes'; -import { awaitableReviews } from '../../../../core/awaitables/reviews'; -import { Var } from '../../../../core/radix/var'; -import { Duel } from '../../../../stores/duel'; -import type { MaybeSkeletonComponentProps } from '../../../../types/maybeSkeletonComponentProps'; -import { VerifiedIcon } from '../../../VerifiedIcon'; - -const reviews = await awaitableReviews; - -export function YouTube({ skeleton }: MaybeSkeletonComponentProps) { - const tank = Duel.use((state) => state.protagonist.tank); - const videos = reviews.reviews[tank.id]?.videos; - - if (!videos) return null; - - return ( - <> - - - - - YouTube - - - - - {videos.map((video) => { - const image = `https://i.ytimg.com/vi/${video.id}/hqdefault.jpg`; - const youtuber = youtubers.find( - (youtuber) => youtuber.id === video.author, - ); - - if (!youtuber) return null; - - return ( - - - - - - {!skeleton && youtuber.name} - {skeleton && } - - {!skeleton && } - - - - ); - })} - - - - - - - - Read the full guide - - - - - ); -} diff --git a/packages/website/src/components/Tankopedia/GuideSection/index.tsx b/packages/website/src/components/Tankopedia/GuideSection/index.tsx index d3660a1b6..70e17043b 100644 --- a/packages/website/src/components/Tankopedia/GuideSection/index.tsx +++ b/packages/website/src/components/Tankopedia/GuideSection/index.tsx @@ -9,7 +9,7 @@ interface Props { export function GuideSection({ guide }: Props) { return ( - + diff --git a/packages/website/src/pages/[...locale]/tanks/[slug]/index.astro b/packages/website/src/pages/[...locale]/tanks/[slug]/index.astro index dead21e65..92ea094d2 100644 --- a/packages/website/src/pages/[...locale]/tanks/[slug]/index.astro +++ b/packages/website/src/pages/[...locale]/tanks/[slug]/index.astro @@ -116,11 +116,13 @@ if (guideResponse.ok) { const description = $('.entry-content p').first().text(); const image = $('.entry-content img').first().attr('src')?.toString(); - guide = { - url: guideUrl, - description, - image, - }; + if (description !== undefined || image !== undefined) { + guide = { + url: guideUrl, + description, + image, + }; + } } ---