mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
feat(catalog): stile classico completo via skin legacy
Ripristina il look del catalogo pre-merge come CSS scoped sotto body.catalog-skin-legacy (CatalogClassicLegacy.css), attivato dal toggle 'stile classico'. CatalogView mette/toglie la classe sul body.
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
import { FC } from 'react';
|
||||
import { useCatalogData } from '../../hooks';
|
||||
import { FC, useEffect } from 'react';
|
||||
import { useCatalogClassicStyle, useCatalogData } from '../../hooks';
|
||||
import { CatalogClassicView } from './CatalogClassicView';
|
||||
|
||||
export const CatalogView: FC<{}> = () =>
|
||||
{
|
||||
const { catalogLocalizationVersion = 0 } = useCatalogData();
|
||||
const [ catalogClassicStyle ] = useCatalogClassicStyle();
|
||||
|
||||
// Toggle the legacy-skin marker on <body> so the scoped overrides in
|
||||
// CatalogClassicLegacy.css (the pre-merge catalog look) take effect for
|
||||
// every catalog element without touching the modern stylesheet.
|
||||
useEffect(() =>
|
||||
{
|
||||
document.body.classList.toggle('catalog-skin-legacy', !!catalogClassicStyle);
|
||||
|
||||
return () => document.body.classList.remove('catalog-skin-legacy');
|
||||
}, [ catalogClassicStyle ]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user