diff --git a/src/layout/card/content/NitroCardContentView.tsx b/src/layout/card/content/NitroCardContentView.tsx index f7f478db..e8662783 100644 --- a/src/layout/card/content/NitroCardContentView.tsx +++ b/src/layout/card/content/NitroCardContentView.tsx @@ -1,15 +1,23 @@ -import { FC } from 'react'; +import { FC, useMemo } from 'react'; +import { Column } from '../../../common/Column'; import { useNitroCardContext } from '../context'; import { NitroCardContentViewProps } from './NitroCardContextView.types'; export const NitroCardContentView: FC = props => { - const { theme = 'primary', children = null, className = '', ...rest } = props; + const { theme = 'primary', classNames = [], ...rest } = props; const { simple = false } = useNitroCardContext(); - - return ( -
- { children } -
- ); + + const getClassNames = useMemo(() => + { + const newClassNames: string[] = [ 'container-fluid', 'content-area' ]; + + if(simple) newClassNames.push('simple'); + + if(classNames.length) newClassNames.push(...classNames); + + return newClassNames; + }, [ simple, classNames ]); + + return ; } diff --git a/src/layout/card/content/NitroCardContextView.types.ts b/src/layout/card/content/NitroCardContextView.types.ts index 21b1d68d..829c149d 100644 --- a/src/layout/card/content/NitroCardContextView.types.ts +++ b/src/layout/card/content/NitroCardContextView.types.ts @@ -1,7 +1,7 @@ -import { DetailsHTMLAttributes } from 'react'; +import { ColumnProps } from '../../../common/Column'; -export interface NitroCardContentViewProps extends DetailsHTMLAttributes +export interface NitroCardContentViewProps extends ColumnProps { theme?: string; } diff --git a/src/views/catalog/CatalogView.tsx b/src/views/catalog/CatalogView.tsx index 403166bf..5c30cac0 100644 --- a/src/views/catalog/CatalogView.tsx +++ b/src/views/catalog/CatalogView.tsx @@ -1,10 +1,12 @@ import { GetCatalogIndexComposer, GetCatalogPageComposer, GetGiftWrappingConfigurationComposer, ILinkEventTracker, INodeData, RoomPreviewer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useReducer, useState } from 'react'; import { AddEventLinkTracker, GetRoomEngine, LocalizeText, RemoveLinkEventTracker } from '../../api'; +import { Column } from '../../common/Column'; +import { Grid } from '../../common/Grid'; import { CatalogEvent } from '../../events'; import { useUiEvent } from '../../hooks/events/ui/ui-event'; import { SendMessageHook } from '../../hooks/messages/message-event'; -import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView, NitroLayoutGrid, NitroLayoutGridColumn } from '../../layout'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../layout'; import { CatalogMessageHandler } from './CatalogMessageHandler'; import { CatalogMode, CatalogViewProps } from './CatalogView.types'; import { BuildCatalogPageTree } from './common/CatalogUtilities'; @@ -195,6 +197,8 @@ export const CatalogView: FC = props => { root && root.children.length && root.children.map((page, index) => { + if(!page.visible) return null; + return ( setCurrentTab(page) }> { page.localization } @@ -203,15 +207,15 @@ export const CatalogView: FC = props => }) } - + { currentNavigationPage && !navigationHidden && - + - } - + } + - - + + } diff --git a/src/views/friends/views/friend-bar/FriendBarView.tsx b/src/views/friends/views/friend-bar/FriendBarView.tsx index aaff2555..5a074319 100644 --- a/src/views/friends/views/friend-bar/FriendBarView.tsx +++ b/src/views/friends/views/friend-bar/FriendBarView.tsx @@ -1,5 +1,6 @@ import { FC, useMemo, useState } from 'react'; -import { NitroLayoutButton, NitroLayoutFlex } from '../../../../layout'; +import { Flex } from '../../../../common/Flex'; +import { NitroLayoutButton } from '../../../../layout'; import { NitroLayoutBase } from '../../../../layout/base'; import { FriendBarItemView } from '../friend-bar-item/FriendBarItemView'; import { FriendBarViewProps } from './FriendBarView.types'; @@ -26,7 +27,7 @@ export const FriendBarView: FC = props => }, [ maxDisplayCount, indexOffset, onlineFriends ]); return ( - + setIndexOffset(indexOffset - 1) }> @@ -37,6 +38,6 @@ export const FriendBarView: FC = props => - + ); } diff --git a/src/views/notification-center/common/NotificationUtilities.ts b/src/views/notification-center/common/NotificationUtilities.ts index c4dd1bd9..891713af 100644 --- a/src/views/notification-center/common/NotificationUtilities.ts +++ b/src/views/notification-center/common/NotificationUtilities.ts @@ -161,6 +161,8 @@ export class NotificationUtilities public static openUrl(url: string): void { + if(!url || !url.length) return; + if(url.startsWith('http')) { HabboWebTools.openWebPage(url);