···11import React from "react";
22import { ButtonPrimary } from "../../components/Buttons";
33-import { TextBlock, ImageBlock } from "./Blocks";
33+import { TextBlock, ImageBlock, CardBlock } from "./Blocks";
4455export const Card = (props: {
66 children: React.ReactNode;
···1313 cards: number[];
1414 card: number;
1515 cardWidth: number;
1616+ cardHeight: number;
1617}) => {
1718 return (
1819 <>
···2122 <div
2223 id={props.id}
2324 className={`
2424- cardWrapper w-[calc(100vw-12px)] md:w-[calc(50vw-24px)] max-w-prose
2525+ cardWrapper w-[calc(100vw-12px)] md:w-[calc(50vw-32px)] max-w-prose
2526 relative
2627 grow flex flex-col
2728 overflow-y-scroll no-scrollbar
···31323233 `}
3334 >
3434- <CardContent />
3535+ <CardContent cardHeight={props.cardHeight} />
3536 </div>
3637 {/* <AddCardButton
3738 setCards={props.setCards}
···150151 );
151152};
152153153153-const CardContent = () => {
154154+const CardContent = (props: { cardHeight: number }) => {
154155 return (
155155- <div className=" p-3 sm:p-4 flex flex-col gap-1 z-10">
156156- <h3>Card Title</h3>
156156+ <div className=" p-3 sm:p-4 flex flex-col">
157157+ <h2>Chapter 1</h2>
158158+159159+ <TextBlock
160160+ lines={6}
161161+ defaultValue="It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. However little known the feelings or views of such a man may be on his first entering a neighbourhood, this truth is so well fixed in the minds of the surrounding families, that he is considered as the rightful property of some one or other of their daughters."
162162+ />
163163+ <TextBlock
164164+ lines={2}
165165+ defaultValue="“My dear Mr. Bennet,” said his lady to him one day, “have you heard that Netherfield Park is let at last?”"
166166+ />
167167+ <TextBlock lines={1} defaultValue="Mr. Bennet replied that he had not." />
168168+ <TextBlock
169169+ lines={2}
170170+ defaultValue="“But it is,” returned she; “for Mrs. Long has just been here, and she told me all about it.”"
171171+ />
172172+ <TextBlock lines={1} defaultValue="Mr. Bennet made no answer." />
173173+ <TextBlock
174174+ lines={2}
175175+ defaultValue="“Do not you want to know who has taken it?” cried his wife, impatiently."
176176+ />
177177+ <TextBlock
178178+ lines={1}
179179+ defaultValue="“You want to tell me, and I have no objection to hearing it.”"
180180+ />
181181+ <TextBlock lines={1} defaultValue="" />
182182+ <h3>Related Images</h3>
183183+ <ImageBlock src="./test-image.jpg" cardHeight={props.cardHeight} />
184184+ <ImageBlock src="./test-image-2.jpg" cardHeight={props.cardHeight} />
157185158158- <div className="flex flex-col">
159159- <TextBlock
160160- lines={6}
161161- defaultValue="It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. However little known the feelings or views of such a man may be on his first entering a neighbourhood, this truth is so well fixed in the minds of the surrounding families, that he is considered as the rightful property of some one or other of their daughters."
162162- />
163163- <TextBlock
164164- lines={2}
165165- defaultValue="“My dear Mr. Bennet,” said his lady to him one day, “have you heard that Netherfield Park is let at last?”"
166166- />
167167- <TextBlock
168168- lines={1}
169169- defaultValue="Mr. Bennet replied that he had not."
170170- />
171171- <TextBlock
172172- lines={2}
173173- defaultValue="“But it is,” returned she; “for Mrs. Long has just been here, and she told me all about it.”"
174174- />
175175- <TextBlock lines={1} defaultValue="Mr. Bennet made no answer." />
176176- <TextBlock
177177- lines={2}
178178- defaultValue="“Do not you want to know who has taken it?” cried his wife, impatiently."
179179- />
180180- <TextBlock
181181- lines={1}
182182- defaultValue="“You want to tell me, and I have no objection to hearing it.”"
183183- />
184184- <TextBlock lines={1} defaultValue="" />
185185- <ImageBlock>
186186- <img src="./test-image.jpg" alt="An image" />
187187- </ImageBlock>
188188- <ImageBlock>
189189- <img src="./test-image-2.jpg" alt="An image" />
190190- </ImageBlock>
191191- </div>
186186+ <CardBlock fontSize="h1" imgSrc="./test-image-2.jpg">
187187+ Chapter 2
188188+ </CardBlock>
189189+ <CardBlock fontSize="h2">Notes</CardBlock>
190190+ <CardBlock fontSize="h3">Footnote #3</CardBlock>
191191+192192+ <CardBlock fontSize="p" imgSrc="./test-image.jpg">
193193+ This was invitation enough. “Why, my dear, you must know, Mrs. Long says
194194+ that Netherfield is taken by a young man of large fortune from the north
195195+ of England; that he came down on Monday in a chaise and four to see the
196196+ place, and was so much delighted with it that he agreed with Mr. Morris
197197+ immediately; that he is to take possession before Michaelmas, and some
198198+ of his servants are to be in the house by the end of next week.”
199199+ </CardBlock>
192200 </div>
193201 );
194202};
+2-1
app/test/page.tsx
···1212};
13131414export default function Index() {
1515- let [cardRef, { width: cardWidth }] = useMeasure();
1515+ let [cardRef, { width: cardWidth, height: cardHeight }] = useMeasure();
1616 let [cards, setCards] = useState([0, 1]);
1717 let [focusedCardIndex, setFocusedCardIndex] = useState(0);
1818 let [pageBGImage, setPageBGImage] = useState({
···5959 cards={cards}
6060 card={card}
6161 cardWidth={cardWidth}
6262+ cardHeight={cardHeight}
6263 >
6364 Card {card}
6465 </Card>