From 80e4243027633055cf487e506cf7214c96b0c3a4 Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Tue, 24 Sep 2024 19:46:57 +0100 Subject: [PATCH] Use less next `Image` magic --- .../src/components/Board/BoardShowcase.jsx | 6 ++++++ frontend/src/components/Board/OrderPCBs.jsx | 21 ++++++++++++++----- frontend/src/components/ProjectCard/index.tsx | 2 ++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Board/BoardShowcase.jsx b/frontend/src/components/Board/BoardShowcase.jsx index e104b6602c..1b41e7beb4 100644 --- a/frontend/src/components/Board/BoardShowcase.jsx +++ b/frontend/src/components/Board/BoardShowcase.jsx @@ -51,6 +51,9 @@ const BoardShowcase = ({ assetPath }) => { data-cy="board-showcase-top" objectFit="contain" src={top} + // we are not using the next `Image` magic in order to simplify our CDN setup + // svgs are not optimized anyway so this is actually a no-op + unoptimized /> )} @@ -69,6 +72,9 @@ const BoardShowcase = ({ assetPath }) => { data-cy="board-showcase-bottom" objectFit="contain" src={bottom} + // we are not using the next `Image` magic in order to simplify our CDN setup + // svgs are not optimized anyway so this is actually a no-op + unoptimized /> )} diff --git a/frontend/src/components/Board/OrderPCBs.jsx b/frontend/src/components/Board/OrderPCBs.jsx index b797a0e6c8..c53ace9826 100644 --- a/frontend/src/components/Board/OrderPCBs.jsx +++ b/frontend/src/components/Board/OrderPCBs.jsx @@ -7,6 +7,12 @@ import styles from './OrderPCBs.module.scss' const serviceLogoDimensions = { height: 29, width: 100 } +import getConfig from 'next/config' + +const { publicRuntimeConfig } = getConfig() + +const { assetPrefix = '' } = publicRuntimeConfig + const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => { const aislerUrl = `https://aisler.net/p/new?url=${zipUrl}&ref=kitspace` const pcbwayUrl = `https://www.pcbway.com/QuickOrderOnline.aspx?fileurl=${zipUrl}&from=kitspace` @@ -49,8 +55,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => { > Aisler logo @@ -64,8 +71,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => { > PCBWay logo @@ -79,8 +87,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => { > JLCPCB logo @@ -94,8 +103,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => { > OSHPark logo { > PCBGoGo logo diff --git a/frontend/src/components/ProjectCard/index.tsx b/frontend/src/components/ProjectCard/index.tsx index b49ccec25f..4c0a8060db 100644 --- a/frontend/src/components/ProjectCard/index.tsx +++ b/frontend/src/components/ProjectCard/index.tsx @@ -46,6 +46,8 @@ const ProjectCard = ({ priority={priority} src={src} width={240} + // we are not using the next `Image` magic in order to simplify our CDN setup + unoptimized /> )}