Skip to content

Commit 8bc5ee6

Browse files
LabEGCopilot
andcommitted
feat: update image handling in documentation screens to use environment-based paths
Co-authored-by: Copilot <copilot@github.com>
1 parent ff217fc commit 8bc5ee6

3 files changed

Lines changed: 13 additions & 26 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
run: npm run build -w packages/reca-docs
3232
env:
3333
BASE_PATH: /reca
34+
NEXT_PUBLIC_BASE_PATH: /reca
3435

3536
- uses: actions/upload-pages-artifact@v3
3637
with:

packages/reca-docs/src/screens/architecture/overview-screen.tsx

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import {type JSX} from "react";
4-
import Image from "next/image";
54
import {DocContent} from "../../components/doc-content/doc-content.js";
65

76
export const ArchitectureOverviewScreen = (): JSX.Element => (
@@ -21,13 +20,10 @@ export const ArchitectureOverviewScreen = (): JSX.Element => (
2120
depend on repositories.
2221
</p>
2322

24-
<Image
25-
src="/images/architecture-layers.svg"
23+
<img
24+
src={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/images/architecture-layers.svg`}
2625
alt="ReCA Architecture Layers: Component → Store → Service → Repository"
27-
width={720}
28-
height={400}
29-
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
30-
unoptimized
26+
style={{width: "100%", maxWidth: 600, display: "block", margin: "24px auto"}}
3127
/>
3228

3329
<h2>The Four Layers</h2>
@@ -65,13 +61,10 @@ export const ArchitectureOverviewScreen = (): JSX.Element => (
6561
When a user interacts with the UI, the request flows through all layers and back:
6662
</p>
6763

68-
<Image
69-
src="/images/request-lifecycle.svg"
64+
<img
65+
src={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/images/request-lifecycle.svg`}
7066
alt="Request lifecycle flowing from User through Component, Store, Service, Repository to Server and back"
71-
width={720}
72-
height={220}
73-
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
74-
unoptimized
67+
style={{width: "100%", maxWidth: 700, display: "block", margin: "24px auto"}}
7568
/>
7669

7770
<ol>
@@ -102,13 +95,10 @@ export const ArchitectureOverviewScreen = (): JSX.Element => (
10295
diagram below shows the difference in how they trigger re-renders:
10396
</p>
10497

105-
<Image
106-
src="/images/store-flow.svg"
98+
<img
99+
src={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/images/store-flow.svg`}
107100
alt="AutoStore (automatic proxy-based) vs Store (manual emitChange) flow comparison"
108-
width={720}
109-
height={320}
110-
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
111-
unoptimized
101+
style={{width: "100%", maxWidth: 700, display: "block", margin: "24px auto"}}
112102
/>
113103

114104
<h2>Store as a Modern Controller</h2>

packages/reca-docs/src/screens/getting-started/why-reca-screen.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import {type JSX} from "react";
4-
import Image from "next/image";
54
import {Alert} from "@mui/material";
65
import {DocContent} from "../../components/doc-content/doc-content.js";
76

@@ -15,13 +14,10 @@ export const WhyRecaScreen = (): JSX.Element => (
1514
is commonly known as <strong>spaghetti code</strong>.
1615
</p>
1716

18-
<Image
19-
src="/images/why-reca.svg"
17+
<img
18+
src={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/images/why-reca.svg`}
2019
alt="Spaghetti code transformed into clean layered architecture by ReCA"
21-
width={900}
22-
height={400}
23-
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
24-
unoptimized
20+
style={{width: "100%", maxWidth: 800, display: "block", margin: "24px auto"}}
2521
/>
2622

2723
<p>

0 commit comments

Comments
 (0)