From daaadee79612c48c8b9d3065e45e48662769886f Mon Sep 17 00:00:00 2001 From: Mads Hermansen <119772939+madshermansen@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:31:19 +0200 Subject: [PATCH] feat(frontend): :sparkles: Add OuiImage component to replace missing preview images (#239) --- frontend/src/app/projects/page.tsx | 7 ++++++- frontend/src/app/satellites/page.tsx | 7 ++++++- frontend/src/components/fullBlogCard.tsx | 24 +++++++++++++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/projects/page.tsx b/frontend/src/app/projects/page.tsx index 008b4a2..3f00e08 100644 --- a/frontend/src/app/projects/page.tsx +++ b/frontend/src/app/projects/page.tsx @@ -5,6 +5,7 @@ import { getClient } from "@/lib/ApolloClient"; import Link from "next/link"; import Image from "next/image"; import { SlicePreviewText } from "@/components/SlicePreviewText"; +import { OuiImage } from "@/components/fullBlogCard"; const HOST_URL = process.env.HOST_URL; const GET_PROJECTS = gql(` @@ -77,7 +78,7 @@ export default async function ProjectsPage() {
- {previewImage && ( + {previewImage ? ( + ) : ( +
+ +
)}
diff --git a/frontend/src/app/satellites/page.tsx b/frontend/src/app/satellites/page.tsx index f5839cf..92084f1 100644 --- a/frontend/src/app/satellites/page.tsx +++ b/frontend/src/app/satellites/page.tsx @@ -5,6 +5,7 @@ import Link from "next/link"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import SatelliteStatsTable from "@/components/satelliteData/SatelliteStatsTable"; import Image from "next/image"; +import { OuiImage } from "@/components/fullBlogCard"; const HOST_URL = process.env.HOST_URL; const GET_SATELLITES = gql(` @@ -65,7 +66,7 @@ export default async function Satellites() { satName={satelliteName} missionStatus={missionStatus} /> - {previewImage && ( + {previewImage ? ( {previewImage} + ) : ( +
+ +
)}
diff --git a/frontend/src/components/fullBlogCard.tsx b/frontend/src/components/fullBlogCard.tsx index 0558937..f37b5f2 100644 --- a/frontend/src/components/fullBlogCard.tsx +++ b/frontend/src/components/fullBlogCard.tsx @@ -8,6 +8,24 @@ import Link from "next/link"; import { SlicePreviewText } from "./SlicePreviewText"; import { BlogPost } from "@/app/blog/page"; import Image from "next/image"; +import { SVGProps } from "react"; + +export function OuiImage(props: SVGProps) { + return ( + + + + ); +} export default function FullBlogCard(article: BlogPost) { function formatDate(dateString: string) { @@ -31,7 +49,7 @@ export default function FullBlogCard(article: BlogPost) { > - {article.coverImage && ( + {article.coverImage ? ( {article.coverImage} + ) : ( +
+ +
)}