AssetsModule 等引用 src/components/Blur 但该文件未纳入版本库导致 CI rollup 报 Could not resolve "../../components/Blur"。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4acf10ef79
commit
71ff459111
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ln-bi",
|
"name": "ln-bi",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "concurrently -n server,client -c blue,green \"npm run dev:server\" \"npm run dev:client\"",
|
"dev": "concurrently -n server,client -c blue,green \"npm run dev:server\" \"npm run dev:client\"",
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { createContext, useContext, type ReactNode } from 'react';
|
||||||
|
|
||||||
|
const DemoModeContext = createContext(false);
|
||||||
|
|
||||||
|
export function DemoModeProvider({ enabled, children }: { enabled: boolean; children: ReactNode }) {
|
||||||
|
return <DemoModeContext.Provider value={enabled}>{children}</DemoModeContext.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useDemoMode() {
|
||||||
|
return useContext(DemoModeContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Blur({ children }: { children: ReactNode }) {
|
||||||
|
const demo = useContext(DemoModeContext);
|
||||||
|
if (!demo) return <>{children}</>;
|
||||||
|
return <span className="blur-[5px] select-none">{children}</span>;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user