Skip to content

Commit f3266bc

Browse files
committed
Fix localStorage and Markdown styling in dashboard components
This commit addresses two minor issues: - Add error handling for localStorage in complete-auth page - Remove redundant CSS classes for Markdown preview and use Markdown component props instead Tool: gitpod/catfood.gitpod.cloud
1 parent 3a05bca commit f3266bc

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

components/dashboard/public/complete-auth/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
window.opener.postMessage(message + "&newUser=" + newUser, `https://${window.location.hostname}`);
1919

2020
if (newUser === "true") {
21-
localStorage.setItem("newUserOnboardingPending", newUser);
21+
try {
22+
localStorage.setItem("newUserOnboardingPending", newUser);
23+
} catch (e) {
24+
console.error("Failed to set localStorage item", e);
25+
}
2226
}
2327
} else {
2428
console.log("This page is supposed to be opened by Gitpod.")

components/dashboard/src/index.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@
9898
@apply text-sm text-pk-content-secondary;
9999
}
100100

101-
.md-preview p {
102-
@apply text-base;
103-
}
104-
105-
.md-preview ol {
106-
@apply list-decimal list-inside;
107-
}
108-
109-
.md-preview ul {
110-
@apply list-disc list-inside;
111-
}
112-
113101
.app-container {
114102
@apply lg:px-28 px-4;
115103
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export const WelcomeMessagePreview = ({ disabled, setWelcomeMessageEditorOpen, h
3535
{welcomeMessage && (
3636
<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">
3737
{avatarUrl && <img src={avatarUrl} alt="" className="w-12 h-12 rounded-full" />}
38-
<Markdown className="md-preview space-y-4 text-center bg-pk-surface-secondary">
38+
<Markdown
39+
className="space-y-4 text-center bg-pk-surface-secondary"
40+
components={{
41+
ul: ({ children }) => <ul className="list-disc list-inside">{children}</ul>,
42+
ol: ({ children }) => <ol className="list-decimal list-inside">{children}</ol>,
43+
}}
44+
>
3945
{welcomeMessage}
4046
</Markdown>
4147
</div>

0 commit comments

Comments
 (0)