mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(site): resolve biome lint warnings (#602)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4efb94cd88
commit
5098b1b5ee
@@ -29,7 +29,6 @@ export function PreferenceSync() {
|
||||
}
|
||||
}, [framework]);
|
||||
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
// biome-ignore lint/complexity/noUselessFragments: Astro SSR logs false "Invalid hook call" when a React component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ export function PreferenceUpdater({ currentFramework }: PreferenceUpdaterProps)
|
||||
styleStore.set(style);
|
||||
}, [currentFramework]);
|
||||
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
// biome-ignore lint/complexity/noUselessFragments: Astro SSR logs false "Invalid hook call" when a React component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
|
||||
const activeId = useActiveHeading(filteredHeadings);
|
||||
|
||||
if (filteredHeadings.length === 0) {
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
// biome-ignore lint/complexity/noUselessFragments: Astro SSR logs false "Invalid hook call" when a React component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,13 +41,6 @@ function getSkinImportParts(skin: Skin): { group: string; skinFile: string } {
|
||||
return { group: skin, skinFile: 'skin' };
|
||||
}
|
||||
|
||||
function getPresetAccess(useCase: UseCase): string {
|
||||
if (useCase === 'default-video') {
|
||||
return 'presets.website';
|
||||
}
|
||||
return `presets['${useCase}']`;
|
||||
}
|
||||
|
||||
function getProviderComponent(useCase: UseCase): string {
|
||||
const map: Record<UseCase, string> = {
|
||||
'default-video': 'VideoProvider',
|
||||
@@ -60,7 +53,6 @@ function getProviderComponent(useCase: UseCase): string {
|
||||
function generateReactCode(useCase: UseCase, skin: Skin, renderer: Renderer, playbackId: string | null): string {
|
||||
const providerComponent = getProviderComponent(useCase);
|
||||
const rendererComponent = getRendererComponent(renderer);
|
||||
const presetAccess = getPresetAccess(useCase);
|
||||
|
||||
// Background video has fixed skin and subpath imports, others use skin picker value
|
||||
const isBackgroundVideo = useCase === 'background-video';
|
||||
|
||||
@@ -25,10 +25,10 @@ export default function SkinPicker() {
|
||||
// Auto-switch skin when use case changes and current skin is invalid
|
||||
useEffect(() => {
|
||||
const validValues = options.map((o) => o.value);
|
||||
if (!validValues.includes($skin)) {
|
||||
if (!validValues.includes(skin.get())) {
|
||||
skin.set(options[0].value);
|
||||
}
|
||||
}, [$useCase]);
|
||||
}, [options]);
|
||||
|
||||
return (
|
||||
<ImageRadioGroup value={$skin} onChange={(value) => skin.set(value)} options={options} aria-label="Select skin" />
|
||||
|
||||
Reference in New Issue
Block a user