Roll back local storage cards, fix catalog.headers

This commit is contained in:
Bill 2022-08-23 23:15:14 -04:00
parent 0e44858e1d
commit e9d9fd4253
2 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,5 @@
import { FC, useEffect, useMemo, useRef } from 'react'; import { FC, useMemo, useRef } from 'react';
import { Column, ColumnProps } from '..'; import { Column, ColumnProps } from '..';
import { GetLocalStorage, SetLocalStorage, WindowSaveOptions } from '../../api';
import { DraggableWindow, DraggableWindowPosition, DraggableWindowProps } from '../draggable-window'; import { DraggableWindow, DraggableWindowPosition, DraggableWindowProps } from '../draggable-window';
import { NitroCardContextProvider } from './NitroCardContext'; import { NitroCardContextProvider } from './NitroCardContext';
@ -25,7 +24,7 @@ export const NitroCardView: FC<NitroCardViewProps> = props =>
return newClassNames; return newClassNames;
}, [ theme, classNames ]); }, [ theme, classNames ]);
useEffect(() => /* useEffect(() =>
{ {
if(!uniqueKey || !elementRef || !elementRef.current) return; if(!uniqueKey || !elementRef || !elementRef.current) return;
@ -34,8 +33,8 @@ export const NitroCardView: FC<NitroCardViewProps> = props =>
if(localStorage && localStorage.size) if(localStorage && localStorage.size)
{ {
element.style.width = `${ localStorage.size.width }px`; //element.style.width = `${ localStorage.size.width }px`;
element.style.height = `${ localStorage.size.height }px`; //element.style.height = `${ localStorage.size.height }px`;
} }
const observer = new ResizeObserver(event => const observer = new ResizeObserver(event =>
@ -53,7 +52,7 @@ export const NitroCardView: FC<NitroCardViewProps> = props =>
{ {
observer.disconnect(); observer.disconnect();
} }
}, [ uniqueKey ]); }, [ uniqueKey ]); */
return ( return (
<NitroCardContextProvider value={ { theme } }> <NitroCardContextProvider value={ { theme } }>

View File

@ -69,7 +69,7 @@ export const CatalogView: FC<{}> = props =>
return ( return (
<> <>
{ isVisible && { isVisible &&
<NitroCardView uniqueKey="catalog" className="nitro-catalog" style={ { width: GetConfiguration('catalog.headers') ? '710px' : '' } }> <NitroCardView uniqueKey="catalog" className="nitro-catalog" style={ GetConfiguration('catalog.headers') ? { width: 710 } : {} }>
<NitroCardHeaderView headerText={ LocalizeText('catalog.title') } onCloseClick={ event => setIsVisible(false) } /> <NitroCardHeaderView headerText={ LocalizeText('catalog.title') } onCloseClick={ event => setIsVisible(false) } />
<NitroCardTabsView> <NitroCardTabsView>
{ rootNode && (rootNode.children.length > 0) && rootNode.children.map(child => { rootNode && (rootNode.children.length > 0) && rootNode.children.map(child =>