Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lexical][Gallery] Add description in the card, option to render preview card at run time if no image #6372

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/lexical-website/src/components/Gallery/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function Card({item}) {
<li key={item.title} className="card shadow--md">
<a href={item.uri} target="_blank">
<div className={clsx('card__image', styles.showcaseCardImage)}>
<img src={image} alt={item.title} />
{item.renderPreview == null && <img src={image} alt={item.title} />}
{item.renderPreview != null && item.renderPreview()}
</div>
</a>
<div className="card__body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@

export const plugins = (customFields) => [
{
description: 'Learn how to create an editor with Emojis',
title: 'EmojiPlugin',
uri: `${customFields.STACKBLITZ_PREFIX}examples/vanilla-js-plugin?embed=1&file=src%2Femoji-plugin%2FEmojiPlugin.ts&terminalHeight=0&ctl=0`,
},
{
description: 'Learn how to create an editor with Real Time Collaboration',
title: 'Collab RichText',
uri: 'https://stackblitz.com/github/facebook/lexical/tree/fix/collab_example/examples/react-rich-collab?ctl=0&file=src%2Fmain.tsx&terminalHeight=0&embed=1',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.cardList {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
gap: 24px;
}

Expand All @@ -28,7 +28,7 @@ html[data-theme='dark'] .showcaseFavorite {

.showcaseCardImage {
overflow: hidden;
height: 150px;
height: 240px;
border-bottom: 2px solid var(--ifm-color-emphasis-200);
}

Expand Down
Loading