Skip to content

Commit

Permalink
refactor(docs): image dx (#4061)
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkwong authored Nov 22, 2024
1 parent e77306a commit e5a69d9
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 75 deletions.
13 changes: 13 additions & 0 deletions apps/docs/content/components/image/blurred.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Image} from "@nextui-org/react";

export default function App() {
return (
<Image
isBlurred
alt="NextUI Album Cover"
className="m-5"
src="https://nextui.org/images/album-cover.png"
width={240}
/>
);
}
14 changes: 1 addition & 13 deletions apps/docs/content/components/image/blurred.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
export default function App() {
return (
<Image
isBlurred
width={240}
src="https://nextui.org/images/album-cover.png"
alt="NextUI Album Cover"
className="m-5"
/>
);
}`;
import App from "./blurred.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
13 changes: 13 additions & 0 deletions apps/docs/content/components/image/fallback.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Image} from "@nextui-org/react";

export default function App() {
return (
<Image
alt="NextUI Image with fallback"
fallbackSrc="https://via.placeholder.com/300x200"
height={200}
src="https://app.requestly.io/delay/1000/https://nextui.org/images/fruit-4.jpeg"
width={300}
/>
);
}
14 changes: 1 addition & 13 deletions apps/docs/content/components/image/fallback.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
export default function App() {
return (
<Image
width={300}
height={200}
src="https://app.requestly.io/delay/1000/https://nextui.org/images/fruit-4.jpeg"
fallbackSrc="https://via.placeholder.com/300x200"
alt="NextUI Image with fallback"
/>
);
}`;
import App from "./fallback.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
12 changes: 12 additions & 0 deletions apps/docs/content/components/image/loading.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Image} from "@nextui-org/react";

export default function App() {
return (
<Image
alt="NextUI hero Image with delay"
height={200}
src="https://app.requestly.io/delay/5000/https://nextui.org/images/hero-card-complete.jpeg"
width={300}
/>
);
}
13 changes: 1 addition & 12 deletions apps/docs/content/components/image/loading.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
export default function App() {
return (
<Image
width={300}
height={200}
alt="NextUI hero Image with delay"
src="https://app.requestly.io/delay/5000/https://nextui.org/images/hero-card-complete.jpeg"
/>
);
}`;
import App from "./loading.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
14 changes: 14 additions & 0 deletions apps/docs/content/components/image/nextjs.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Image} from "@nextui-org/react";
import NextImage from "next/image";

export default function App() {
return (
<Image
alt="NextUI hero Image"
as={NextImage}
height={200}
src="https://nextui.org/images/hero-card-complete.jpeg"
width={300}
/>
);
}
15 changes: 1 addition & 14 deletions apps/docs/content/components/image/nextjs.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
import NextImage from "next/image";
export default function App() {
return (
<Image
as={NextImage}
width={300}
height={200}
src="https://nextui.org/images/hero-card-complete.jpeg"
alt="NextUI hero Image"
/>
);
}`;
import App from "./nextjs.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
11 changes: 11 additions & 0 deletions apps/docs/content/components/image/usage.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Image} from "@nextui-org/react";

export default function App() {
return (
<Image
alt="NextUI hero Image"
src="https://nextui.org/images/hero-card-complete.jpeg"
width={300}
/>
);
}
12 changes: 1 addition & 11 deletions apps/docs/content/components/image/usage.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
export default function App() {
return (
<Image
width={300}
alt="NextUI hero Image"
src="https://nextui.org/images/hero-card-complete.jpeg"
/>
);
}`;
import App from "./usage.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
12 changes: 12 additions & 0 deletions apps/docs/content/components/image/zoomed.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Image} from "@nextui-org/react";

export default function App() {
return (
<Image
isZoomed
alt="NextUI Fruit Image with Zoom"
src="https://nextui.org/images/fruit-1.jpeg"
width={240}
/>
);
}
13 changes: 1 addition & 12 deletions apps/docs/content/components/image/zoomed.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
const App = `import {Image} from "@nextui-org/react";
export default function App() {
return (
<Image
isZoomed
width={240}
alt="NextUI Fruit Image with Zoom"
src="https://nextui.org/images/fruit-1.jpeg"
/>
);
}`;
import App from "./zoomed.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down

0 comments on commit e5a69d9

Please sign in to comment.