diff --git a/src/layout/card/grid/NitroCardGridView.tsx b/src/layout/card/grid/NitroCardGridView.tsx index 033927a4..8fd178e0 100644 --- a/src/layout/card/grid/NitroCardGridView.tsx +++ b/src/layout/card/grid/NitroCardGridView.tsx @@ -3,16 +3,16 @@ import { NitroCardGridViewProps } from './NitroCardGridView.types'; export const NitroCardGridView: FC = props => { - const { columns = 5, className = '', style = null, children = null, ...rest } = props; + const { columns = 5, gap = 2, className = '', style = null, children = null, ...rest } = props; const getClassName = useMemo(() => { - let newClassName = 'grid gap-2 overflow-auto'; + let newClassName = `grid gap-${ gap } overflow-auto`; if(className && className.length) newClassName += ' ' + className; return newClassName; - }, [ className ]); + }, [ className, gap ]); const getStyle = useMemo(() => { diff --git a/src/layout/card/grid/NitroCardGridView.types.ts b/src/layout/card/grid/NitroCardGridView.types.ts index d5dc256d..55b14648 100644 --- a/src/layout/card/grid/NitroCardGridView.types.ts +++ b/src/layout/card/grid/NitroCardGridView.types.ts @@ -3,4 +3,5 @@ import { DetailsHTMLAttributes } from 'react'; export interface NitroCardGridViewProps extends DetailsHTMLAttributes { columns?: number; + gap?: number; } diff --git a/src/layout/card/grid/item/NitroCardGridItemView.tsx b/src/layout/card/grid/item/NitroCardGridItemView.tsx index 47c39438..3bc431ef 100644 --- a/src/layout/card/grid/item/NitroCardGridItemView.tsx +++ b/src/layout/card/grid/item/NitroCardGridItemView.tsx @@ -8,7 +8,7 @@ export const NitroCardGridItemView: FC = props => const getClassName = useMemo(() => { - let newClassName = 'grid-item cursor-pointer overflow-hidden'; + let newClassName = 'grid-item gap-1 cursor-pointer overflow-hidden'; if(itemActive) newClassName += ' active'; diff --git a/src/views/catalog/CatalogView.tsx b/src/views/catalog/CatalogView.tsx index d69eb842..ec06d572 100644 --- a/src/views/catalog/CatalogView.tsx +++ b/src/views/catalog/CatalogView.tsx @@ -205,7 +205,7 @@ export const CatalogView: FC = props =>
{ currentNavigationPage && !navigationHidden && -
+
}
diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.scss b/src/views/catalog/views/navigation/CatalogNavigationView.scss index e094aaac..e75d5f61 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.scss +++ b/src/views/catalog/views/navigation/CatalogNavigationView.scss @@ -1,10 +1,30 @@ -.nitro-catalog-navigation { - border-color: $grid-border-color !important; - background-color: $grid-bg-color !important; +.nitro-catalog-navigation-grid { + border-radius: 0.25rem; + border-color: #B6BEC5 !important; + background-color: #CDD3D9; + border: 2px solid; - .navigation-container { - overflow-y: auto; + .grid-item { + font-size: $font-size-sm; + height: 23px !important; + border-color: unset !important; + background-color: #CDD3D9; + border: 0 !important; + padding: 1px 3px; + + i.fas { + color: $black; + font-size: 10px; + padding: 1px; + } } + + // border-color: $grid-border-color !important; + // background-color: $grid-bg-color !important; + + // .navigation-container { + // overflow-y: auto; + // } } @import './item/CatalogNavigationItemView'; diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.tsx b/src/views/catalog/views/navigation/CatalogNavigationView.tsx index ac636961..cb8efe9c 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.tsx +++ b/src/views/catalog/views/navigation/CatalogNavigationView.tsx @@ -1,5 +1,6 @@ import { INodeData } from '@nitrots/nitro-renderer'; import { FC, useEffect } from 'react'; +import { NitroCardGridView } from '../../../../layout'; import { CatalogSearchView } from '../search/CatalogSearchView'; import { CatalogNavigationViewProps } from './CatalogNavigationView.types'; import { CatalogNavigationSetView } from './set/CatalogNavigationSetView'; @@ -23,13 +24,15 @@ export const CatalogNavigationView: FC = props => }, [ page ]); return ( - <> - -
-
- +
+
+ +
+ + +
- +
); } diff --git a/src/views/catalog/views/navigation/item/CatalogNavigationItemView.tsx b/src/views/catalog/views/navigation/item/CatalogNavigationItemView.tsx index 42344628..f618c0e1 100644 --- a/src/views/catalog/views/navigation/item/CatalogNavigationItemView.tsx +++ b/src/views/catalog/views/navigation/item/CatalogNavigationItemView.tsx @@ -1,6 +1,7 @@ import { GetCatalogPageComposer, INodeData } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { SendMessageHook } from '../../../../../hooks/messages/message-event'; +import { NitroCardGridItemView } from '../../../../../layout'; import { CatalogMode } from '../../../CatalogView.types'; import { CatalogIconView } from '../../catalog-icon/CatalogIconView'; import { ACTIVE_PAGES } from '../CatalogNavigationView'; @@ -70,16 +71,14 @@ export const CatalogNavigationItemView: FC = pro }, [ isActive, page ]); return ( -
-
select(page) }> + <> + select(page) }> -
{ page.localization }
+
{ page.localization }
{ (page.children.length > 0) && } -
+ { isActive && isExpanded && page.children && (page.children.length > 0) && -
- -
} -
+ } + ); } diff --git a/src/views/catalog/views/navigation/set/CatalogNavigationSetView.tsx b/src/views/catalog/views/navigation/set/CatalogNavigationSetView.tsx index 966fbfd4..3d6199a1 100644 --- a/src/views/catalog/views/navigation/set/CatalogNavigationSetView.tsx +++ b/src/views/catalog/views/navigation/set/CatalogNavigationSetView.tsx @@ -26,13 +26,13 @@ export const CatalogNavigationSetView: FC = props }, [ page, isFirstSet, activeChild, pendingTree ]); return ( -
+ <> { page && (page.children.length > 0) && page.children.map((page, index) => { if(!page.visible) return null; return }) } -
+ ); } diff --git a/src/views/catalog/views/search/CatalogSearchView.tsx b/src/views/catalog/views/search/CatalogSearchView.tsx index af6ffb41..ecb9b430 100644 --- a/src/views/catalog/views/search/CatalogSearchView.tsx +++ b/src/views/catalog/views/search/CatalogSearchView.tsx @@ -110,7 +110,7 @@ export const CatalogSearchView: FC = props => }, [ searchValue, processSearch ]); return ( -
+
setSearchValue(event.target.value) } />