mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(frontend): show the product, keep work across sign-in, add social preview
Of 27 people who typed a username in the last 14 days, 15 left before a widget rendered. The landing page showed zero pixels of a product whose entire value is visual, so it now leads with a live example card and says concretely what you get. Sign-in used to discard everything: with no router the OAuth `next` is always "/", so users came back to an empty search box with their theme, widget order and achievements gone. Persist work-in-progress to sessionStorage and restore it on mount. The Workshop preview seeds from demo data (grade A, 842 commits, collaborators named alex/jordan/sam) with nothing saying so, so users saw numbers they knew were wrong. Label it until real data arrives. Add title, description, canonical, OG and Twitter tags, robots.txt and a sitemap. The page was a 445-byte shell titled "GitHub Widgets", so every link shared anywhere rendered with no image and no description. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
This commit is contained in:
@@ -226,6 +226,7 @@ type Props = {
|
||||
fetchDone: boolean
|
||||
fetchError: string | null
|
||||
widgetData: WidgetData | null
|
||||
isDemoData: boolean
|
||||
me: Me
|
||||
onAuthChange?: (m: Me) => void
|
||||
}
|
||||
@@ -239,6 +240,7 @@ export function WorkshopScreen({
|
||||
fetchDone,
|
||||
fetchError,
|
||||
widgetData,
|
||||
isDemoData,
|
||||
me,
|
||||
}: Props) {
|
||||
const canEdit = !!me.login && me.login.toLowerCase() === username.toLowerCase()
|
||||
@@ -744,6 +746,12 @@ export function WorkshopScreen({
|
||||
{/* Right preview area */}
|
||||
<div className="flex-1 flex items-start justify-center p-8 overflow-auto">
|
||||
<div className="relative">
|
||||
{isDemoData && svgContent && (
|
||||
<div className="flex items-center gap-1.5 mx-auto mb-3 w-fit rounded-full border border-amber-200 bg-amber-50 px-2.5 py-1 text-[10px] text-amber-700">
|
||||
<div className="w-1.5 h-1.5 rounded-full bg-amber-400" />
|
||||
Sample data until your stats finish building
|
||||
</div>
|
||||
)}
|
||||
{svgContent ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: svgContent }} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user