Skip to content

Commit 4b8fc12

Browse files
committed
EnhanceWelcomeMessagePreview with support for headings and imgs
Tool: gitpod/catfood.gitpod.cloud
1 parent f601310 commit 4b8fc12

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/dashboard/src/teams/onboarding/WelcomeMessagePreview.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { Button } from "@podkit/buttons/Button";
8-
import { Heading2, Subheading } from "@podkit/typography/Headings";
8+
import { Heading1, Heading2, Heading3, Subheading } from "@podkit/typography/Headings";
99
import Markdown from "react-markdown";
1010
import { useOrgSettingsQuery } from "../../data/organizations/org-settings-query";
1111
import { gitpodWelcomeSubheading } from "./WelcomeMessageConfigurationField";
@@ -32,18 +32,22 @@ export const WelcomeMessagePreview = ({ disabled, setWelcomeMessageEditorOpen, h
3232
</div>
3333
<Subheading>{gitpodWelcomeSubheading}</Subheading>
3434
{welcomeMessage && (
35-
<div className="p-8 my-4 bg-pk-surface-secondary text-pk-content-primary rounded-xl flex flex-col gap-5 items-center justify-center">
35+
<article className="p-8 my-4 bg-pk-surface-secondary text-pk-content-primary rounded-xl flex flex-col gap-5 items-center justify-center">
3636
{avatarUrl && <img src={avatarUrl} alt="" className="w-12 h-12 rounded-full" />}
3737
<Markdown
3838
className="space-y-4 text-center bg-pk-surface-secondary"
3939
components={{
4040
ul: ({ children }) => <ul className="list-disc list-inside">{children}</ul>,
4141
ol: ({ children }) => <ol className="list-decimal list-inside">{children}</ol>,
42+
img: ({ src, alt }) => <img src={src} alt={alt} className="w-full rounded-lg" />,
43+
h1: ({ children }) => <Heading1 className="text-left text-2xl">{children}</Heading1>,
44+
h2: ({ children }) => <Heading2 className="text-left text-xl">{children}</Heading2>,
45+
h3: ({ children }) => <Heading3 className="text-left text-lg">{children}</Heading3>,
4246
}}
4347
>
4448
{welcomeMessage}
4549
</Markdown>
46-
</div>
50+
</article>
4751
)}
4852
</div>
4953
);

0 commit comments

Comments
 (0)