Initial screen starter scaffold
This commit is contained in:
commit
d136b9dddc
49 files changed
+2966
No files matched your search
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@dev-screen-starter/debug",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc --noEmit",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^19.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.1.16",
|
||||
"typescript": "^5.9.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
type DebugBadgeProps = {
|
||||
enabled?: boolean
|
||||
scale?: number
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
const defaultEnabled = typeof location !== 'undefined' && location.hostname === 'localhost'
|
||||
|
||||
export function DebugBadge({ enabled = defaultEnabled, scale, updatedAt }: DebugBadgeProps) {
|
||||
if (!enabled) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<aside className="debug-badge">
|
||||
{scale ? <span>scale {scale.toFixed(3)}</span> : null}
|
||||
{updatedAt ? <span>updated {new Date(updatedAt).toLocaleTimeString()}</span> : null}
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './DebugBadge'
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in new issue
Block a user