mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
Fix:Adding Indexing to the Catalog Tabs
This commit is contained in:
parent
304e945c13
commit
e4658143fa
@ -72,24 +72,28 @@ export const CatalogView: FC<{}> = props =>
|
||||
<NitroCardView uniqueKey="catalog" className="nitro-catalog" style={ GetConfiguration('catalog.headers') ? { width: 710 } : {} }>
|
||||
<NitroCardHeaderView headerText={ LocalizeText('catalog.title') } onCloseClick={ event => setIsVisible(false) } />
|
||||
<NitroCardTabsView>
|
||||
{ rootNode && (rootNode.children.length > 0) && rootNode.children.map(child =>
|
||||
{
|
||||
if(!child.isVisible) return null;
|
||||
|
||||
return (
|
||||
<NitroCardTabsItemView key={ child.pageId } isActive={ child.isActive } onClick={ event =>
|
||||
{
|
||||
if(searchResult) setSearchResult(null);
|
||||
|
||||
activateNode(child);
|
||||
} } >
|
||||
<Flex gap={ GetConfiguration('catalog.tab.icons') ? 1 : 0 } alignItems="center">
|
||||
{ GetConfiguration('catalog.tab.icons') && <CatalogIconView icon={ child.iconId } /> }
|
||||
{ child.localization }
|
||||
</Flex>
|
||||
</NitroCardTabsItemView>
|
||||
);
|
||||
}) }
|
||||
{rootNode &&
|
||||
rootNode.children.length > 0 &&
|
||||
rootNode.children.map((child, index) => {
|
||||
if (!child.isVisible) return null;
|
||||
// Generate a unique key using the index of the map function
|
||||
const uniqueKey = `${child.pageId}-${index}`;
|
||||
return (
|
||||
<NitroCardTabsItemView
|
||||
key={uniqueKey}
|
||||
isActive={child.isActive}
|
||||
onClick={(event) => {
|
||||
if (searchResult) setSearchResult(null);
|
||||
activateNode(child);
|
||||
}}
|
||||
>
|
||||
<Flex gap={GetConfiguration('catalog.tab.icons') ? 1 : 0} alignItems="center">
|
||||
{GetConfiguration('catalog.tab.icons') && <CatalogIconView icon={child.iconId} />}
|
||||
{child.localization}
|
||||
</Flex>
|
||||
</NitroCardTabsItemView>
|
||||
);
|
||||
})}
|
||||
</NitroCardTabsView>
|
||||
<NitroCardContentView>
|
||||
<Grid>
|
||||
|
Loading…
x
Reference in New Issue
Block a user