feat(workshop): refine login banner to display only for signed-in users.

This commit is contained in:
shay
2026-04-21 15:40:46 -04:00
parent 9cc9de2147
commit 5102a36238
2 changed files with 6 additions and 16 deletions
@@ -2,7 +2,6 @@ import { useState, useMemo, type ReactNode } from 'react'
import DOMPurify from 'dompurify'
import type { WidgetSettings, Achievement, PerWidgetSettings } from '../App'
import { renderAllWidgets, type WidgetData } from '../lib/renderWidgets'
import { signInUrl } from '../lib/auth'
import type { Me } from '../lib/auth'
// Defense-in-depth: the client-rendered preview assembles SVG from
@@ -384,11 +383,9 @@ export function WorkshopScreen({
</div>
)}
{!canEdit && (
{!canEdit && me.login && (
<div className="banner">
{me.login
? `Signed in as ${me.login}. Changes here produce a shareable link with query params. Only ${username} can save them permanently.`
: <><a href={signInUrl()}>Sign in with GitHub</a> to save these settings permanently. Otherwise, Generate gives you a drop-in URL with query params.</>}
{`Signed in as ${me.login}. Changes here produce a shareable link with query params. Only ${username} can save them permanently.`}
</div>
)}