Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit 0f4fdfd

Browse files
author
John Richard Chipps-Harding
authored
Max Width (#3)
* Max Width Support * Docs
1 parent 1ea22c0 commit 0f4fdfd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ You can configure a few things by editing the file `src/config/index.tsx`.
2222
- `FILE_EXTENSION` - The filetypes supported. Default `png`.
2323
- `FILE_MIME` - The file mime type. Default `image/png`.
2424
- `SHOW_TITLE` - If the title should be overlaid. Default `true`.
25+
- `MAX_WIDTH` - The maximum width of the image column. Default `320`.
2526

2627
You can also adjust the title field formatter here: `src/utils/images.ts`.

src/components/ImageStack/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @next/next/no-img-element */
22
import { getTitle } from "@/utils/images";
3-
import { SHOW_TITLE } from "@/config";
3+
import { MAX_WIDTH, SHOW_TITLE } from "@/config";
44

55
import styles from "./ImageStack.module.css";
66

@@ -9,7 +9,12 @@ interface Props {
99
}
1010

1111
export const ImageStack = ({ images = [] }: Props) => (
12-
<ul className={styles.list}>
12+
<ul
13+
className={styles.list}
14+
style={{
15+
maxWidth: MAX_WIDTH,
16+
}}
17+
>
1318
{images.map((image) => (
1419
<li key={image}>
1520
{SHOW_TITLE && <h2>{getTitle(image)}</h2>}

src/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export const POLL_INTERVAL = 5 * 1000;
44
export const FILE_EXTENSION = "png";
55
export const FILE_MIME = "image/png";
66
export const SHOW_TITLE = true;
7+
export const MAX_WIDTH = 320;

0 commit comments

Comments
 (0)