Skip to content

Commit c811e4c

Browse files
LabEGCopilot
andcommitted
feat: replace <img> with <Image> component and getting started screens
Co-authored-by: Copilot <copilot@github.com>
1 parent 14c7b70 commit c811e4c

3 files changed

Lines changed: 259 additions & 61 deletions

File tree

packages/reca-docs/src/next-modules.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ declare module "next/link" {
2222
export default Link;
2323
}
2424

25+
declare module "next/image" {
26+
import type React from "react";
27+
28+
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
29+
src: string;
30+
width: number;
31+
height: number;
32+
alt: string;
33+
unoptimized?: boolean;
34+
priority?: boolean;
35+
fill?: boolean;
36+
}
37+
38+
const Image: React.FC<ImageProps>;
39+
export default Image;
40+
}
41+
2542
declare module "next/navigation" {
2643
export function usePathname(): string;
2744
export function useRouter(): {

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

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

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

67
export const ArchitectureOverviewScreen = (): JSX.Element => (
@@ -20,10 +21,13 @@ export const ArchitectureOverviewScreen = (): JSX.Element => (
2021
depend on repositories.
2122
</p>
2223

23-
<img
24+
<Image
2425
src="/images/architecture-layers.svg"
2526
alt="ReCA Architecture Layers: Component → Store → Service → Repository"
26-
style={{width: "100%", maxWidth: 600, display: "block", margin: "24px auto"}}
27+
width={720}
28+
height={400}
29+
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
30+
unoptimized
2731
/>
2832

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

64-
<img
68+
<Image
6569
src="/images/request-lifecycle.svg"
6670
alt="Request lifecycle flowing from User through Component, Store, Service, Repository to Server and back"
67-
style={{width: "100%", maxWidth: 700, display: "block", margin: "24px auto"}}
71+
width={720}
72+
height={220}
73+
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
74+
unoptimized
6875
/>
6976

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

98-
<img
105+
<Image
99106
src="/images/store-flow.svg"
100107
alt="AutoStore (automatic proxy-based) vs Store (manual emitChange) flow comparison"
101-
style={{width: "100%", maxWidth: 700, display: "block", margin: "24px auto"}}
108+
width={720}
109+
height={320}
110+
style={{width: "100%", height: "auto", display: "block", margin: "24px auto"}}
111+
unoptimized
102112
/>
103113

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

0 commit comments

Comments
 (0)