mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-17 01:12:37 +01:00
Roll back local storage cards, fix catalog.headers
This commit is contained in:
parent
0e44858e1d
commit
e9d9fd4253
@ -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 } }>
|
||||||
|
@ -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 =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user