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

add cardGridSection and Card#16

Draft
Cuerillius wants to merge 6 commits intomainfrom
Grid-Cards-Section
Draft

add cardGridSection and Card#16
Cuerillius wants to merge 6 commits intomainfrom
Grid-Cards-Section

Conversation

@Cuerillius
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant to the current branch?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adjust the things necessary to this branch.
No changes needed, just keep this in mind.

Comment on lines +6 to +7
title: string | null;
content: string | null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherit title and content from the Prisma Schema.

Comment on lines +6 to +7
title: string | null;
description: string | null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherit title and description from the Prisma Schema.

export interface CardGridProps {
title: string | null;
description: string | null;
CardSlot: React.ReactNode;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camelCase for props.

return (
<div>
{title && <h1>{title}</h1>}
{description && <div dangerouslySetInnerHTML={{ __html: description }} />}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will later replace this with the WYSIWYG component.
No changes needed.

Comment on lines +29 to +31
const cards = await prisma.cards.findMany({
where: { fkCardGrids: id },
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to sort this!

title={cardGrid.title}
description={cardGrid.description}
CardSlot={cards.map((card) => (
<CardBuilder {...card} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using .map to iterate over React components, always add a key prop.

<ImageComponent
path={imageInfo.path}
title={imageInfo.title || imageInfo.filenameDisk || "image"}
altText={imageInfo.title || imageInfo.filenameDisk || "image"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only use the title for the altText

Comment on lines +13 to +17
<div>
{title && <h1>{title}</h1>}
{content && <div dangerouslySetInnerHTML={{ __html: content }} />}
{backgroundSlot}
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want to put the background image on the div with css?

@TeamBattino TeamBattino marked this pull request as draft June 27, 2024 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants