Skip to content

Commit

Permalink
Use less next Image magic
Browse files Browse the repository at this point in the history
  • Loading branch information
kasbah committed Sep 24, 2024
1 parent ea17355 commit 80e4243
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
6 changes: 6 additions & 0 deletions frontend/src/components/Board/BoardShowcase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
)}
</div>
Expand All @@ -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
/>
)}
</div>
Expand Down
21 changes: 16 additions & 5 deletions frontend/src/components/Board/OrderPCBs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -49,8 +55,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => {
>
<Image
alt="Aisler logo"
src="/static/images/aisler.png"
src={`${assetPrefix}/static/images/aisler.png`}
{...serviceLogoDimensions}
unoptimized
/>
</a>

Expand All @@ -64,8 +71,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => {
>
<Image
alt="PCBWay logo"
src="/static/images/pcbway.png"
src={`${assetPrefix}/static/images/pcbway.png`}
{...serviceLogoDimensions}
unoptimized
/>
</a>

Expand All @@ -79,8 +87,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => {
>
<Image
alt="JLCPCB logo"
src="/static/images/jlcpcb.png"
src={`${assetPrefix}/static/images/jlcpcb.png`}
{...serviceLogoDimensions}
unoptimized
/>
</a>

Expand All @@ -94,8 +103,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => {
>
<Image
alt="OSHPark logo"
src="/static/images/oshpark.png"
src={`${assetPrefix}/static/images/oshpark.png`}
{...serviceLogoDimensions}
unoptimized
/>
</a>
<a
Expand All @@ -108,8 +118,9 @@ const OrderPCBs = ({ zipUrl, boardSpecs, projectFullname }) => {
>
<Image
alt="PCBGoGo logo"
src="/static/images/pcbgogo.png"
src={`${assetPrefix}/static/images/pcbgogo.png`}
{...serviceLogoDimensions}
unoptimized
/>
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/ProjectCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
)}
</div>
Expand Down

0 comments on commit 80e4243

Please sign in to comment.