mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(workshop): refine login banner to display only for signed-in users.
This commit is contained in:
@@ -2,7 +2,6 @@ import { useState, useMemo, type ReactNode } from 'react'
|
|||||||
import DOMPurify from 'dompurify'
|
import DOMPurify from 'dompurify'
|
||||||
import type { WidgetSettings, Achievement, PerWidgetSettings } from '../App'
|
import type { WidgetSettings, Achievement, PerWidgetSettings } from '../App'
|
||||||
import { renderAllWidgets, type WidgetData } from '../lib/renderWidgets'
|
import { renderAllWidgets, type WidgetData } from '../lib/renderWidgets'
|
||||||
import { signInUrl } from '../lib/auth'
|
|
||||||
import type { Me } from '../lib/auth'
|
import type { Me } from '../lib/auth'
|
||||||
|
|
||||||
// Defense-in-depth: the client-rendered preview assembles SVG from
|
// Defense-in-depth: the client-rendered preview assembles SVG from
|
||||||
@@ -384,11 +383,9 @@ export function WorkshopScreen({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!canEdit && (
|
{!canEdit && me.login && (
|
||||||
<div className="banner">
|
<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.`}
|
||||||
? `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.</>}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -125,18 +125,11 @@ def compute_grade(github_data: dict, custom_tags: list[str] = None) -> GradeData
|
|||||||
grade = "B-"
|
grade = "B-"
|
||||||
elif total >= 42:
|
elif total >= 42:
|
||||||
grade = "C+"
|
grade = "C+"
|
||||||
elif total >= 35:
|
|
||||||
grade = "C"
|
|
||||||
elif total >= 28:
|
|
||||||
grade = "C-"
|
|
||||||
elif total >= 20:
|
|
||||||
grade = "D+"
|
|
||||||
elif total >= 12:
|
|
||||||
grade = "D"
|
|
||||||
elif total >= 5:
|
|
||||||
grade = "D-"
|
|
||||||
else:
|
else:
|
||||||
grade = "F"
|
# C is the floor. Anything that would previously have slid into C-,
|
||||||
|
# D+, D, D-, or F is clamped up to C — the widget is meant to be an
|
||||||
|
# encouraging profile snapshot, not a failure grade.
|
||||||
|
grade = "C"
|
||||||
|
|
||||||
stats = {
|
stats = {
|
||||||
"commits": commits,
|
"commits": commits,
|
||||||
|
|||||||
Reference in New Issue
Block a user