- Profile Sharing
+ My Themes
+
+ {/* Active profile theme status */}
- {hasPublishedTheme ? 'Published to profile' : 'Not shared'}
+ {hasPublishedTheme ? 'Profile theme active' : 'No profile theme'}
{hasPublishedTheme
- ? 'Your theme is visible when others visit your profile. Saving will auto-update it.'
- : 'Enable sharing in Edit Profile to display your theme on your profile.'}
+ ? 'Visitors see your theme on your profile. Saving auto-updates it.'
+ : 'Publish a theme to display it on your profile.'}
{hasPublishedTheme && (
@@ -444,6 +497,57 @@ export function ThemeBuilderPage() {
)}
+
+ {/* Published theme list */}
+ {_userThemes.data && _userThemes.data.length > 0 && (
+
+ {_userThemes.data.map((theme) => (
+ {
+ setTokens(theme.tokens);
+ setAutoDerive(false);
+ toast({ title: 'Theme loaded', description: `"${theme.title}" loaded into the editor.` });
+ }}
+ onSetActive={async () => {
+ try {
+ await setActiveTheme({
+ tokens: theme.tokens,
+ sourceAuthor: user.pubkey,
+ sourceIdentifier: theme.identifier,
+ });
+ applyCustomTheme(theme.tokens);
+ toast({ title: 'Theme activated', description: `"${theme.title}" is now your profile theme.` });
+ } catch {
+ toast({ title: 'Failed', description: 'Could not set as active theme.', variant: 'destructive' });
+ }
+ }}
+ onEditMetadata={() => {
+ setEditingTheme(theme);
+ setPublishTitle(theme.title);
+ setPublishDescription(theme.description || '');
+ setPublishDialogOpen(true);
+ }}
+ onDelete={async () => {
+ try {
+ await deleteTheme(theme.identifier);
+ toast({ title: 'Theme deleted', description: `"${theme.title}" has been removed.` });
+ } catch {
+ toast({ title: 'Failed', description: 'Could not delete theme.', variant: 'destructive' });
+ }
+ }}
+ />
+ ))}
+
+ )}
+
+ {_userThemes.data?.length === 0 && (
+
+ No published themes yet. Save a theme above to publish it.
+
+ )}
+ {/* Color swatches */}
+
+ {swatches.map((hex, i) => (
+
+ ))}
+
+
+ {/* Info */}
+
+
+ {theme.title}
+ {isActive && (
+
+ Active
+
+ )}
+
+ {theme.description && (
+
{theme.description}
+ )}
+
+
+ {/* Actions */}
+
+
+
+
+
+
+
+ Edit in builder
+
+ {!isActive && (
+
+
+
+
+
+
+ Set as profile theme
+
+ )}
+
+
+
+
+
+
+ Edit title & description
+
+
+
+
+
+
+
+ Delete theme
+
+
+
+ );
+}
+
// ─── Import from Profile ──────────────────────────────────────────────
function ImportFromProfile() {