Skip to content
Closed
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
5 changes: 5 additions & 0 deletions frontend/public/embed.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ html,
body {
margin: 0;
padding: 0;
/* The embed route is meant to render transparently inside a host page's
iframe. It still inherits the root layout's <html>/<body>, whose
globals.css sets an opaque gradient background — override it here so
the widget doesn't show a solid background box in embeds. */
background: transparent !important;
}

.w-full {
Expand Down
52 changes: 23 additions & 29 deletions frontend/src/app/embed/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export async function generateMetadata({ params }: { params: { username: string
return {
title: `Support ${profile.displayName} — NovaSupport`,
robots: { index: false, follow: false },
viewport: "width=device-width, initial-scale=1",
};
}

Expand Down Expand Up @@ -92,34 +93,27 @@ export default async function EmbedPage({ params, searchParams }: PageProps) {
}));

return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" />
<link rel="stylesheet" href="/embed.css" />
</head>
<body
style={{
margin: 0,
padding: 8,
background: "transparent",
fontFamily: "system-ui, -apple-system, sans-serif",
}}
>
<EmbedWidget
username={profile.username}
displayName={profile.displayName}
bio={profile.bio}
avatarUrl={profile.avatarUrl}
acceptedAssets={profile.acceptedAssets}
stats={stats}
recentSupporters={recentSupporters}
theme={theme}
size={size}
profileUrl={profileUrl}
/>
</body>
</html>
<div
style={{
margin: 0,
padding: 8,
background: "transparent",
fontFamily: "system-ui, -apple-system, sans-serif",
}}
>
<link rel="stylesheet" href="/embed.css" />
<EmbedWidget
username={profile.username}
displayName={profile.displayName}
bio={profile.bio}
avatarUrl={profile.avatarUrl}
acceptedAssets={profile.acceptedAssets}
stats={stats}
recentSupporters={recentSupporters}
theme={theme}
size={size}
profileUrl={profileUrl}
/>
</div>
);
}
7 changes: 7 additions & 0 deletions frontend/src/app/embed/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The embed route renders a minimal, iframe-friendly widget and must not
// inherit the app's root <html>/<body> chrome (theme script, gradient
// background, Providers). This layout opts the /embed/* subtree out of the
// nesting Next.js would otherwise apply from app/layout.tsx.
export default function EmbedLayout({ children }: { children: React.ReactNode }) {
return children;
}
Loading