From f67943f36436f862d753462886d14a5411b4bd01 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 1 Mar 2022 04:12:27 -0500 Subject: [PATCH] More updates --- public/ui-config.json.example | 1 + src/App.scss | 2 +- src/assets/styles/utils.scss | 4 ++++ src/components/chat-history/ChatHistoryView.scss | 4 ---- .../inventory/views/badge/InventoryBadgeView.tsx | 7 ++++--- src/layout/card/content/NitroCardContentView.tsx | 6 +++--- .../views/calendar-item/CalendarItemView.tsx | 10 +++++++++- .../views/calendar-item/CalendarItemView.types.ts | 8 -------- src/views/campaign/views/calendar/CalendarView.tsx | 13 ++++++++++++- .../campaign/views/calendar/CalendarView.types.ts | 11 ----------- .../context-menu/FurnitureContextMenuView.tsx | 4 ++-- .../room/widgets/room-tools/RoomToolsWidgetView.tsx | 2 +- 12 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 src/views/campaign/views/calendar-item/CalendarItemView.types.ts delete mode 100644 src/views/campaign/views/calendar/CalendarView.types.ts diff --git a/public/ui-config.json.example b/public/ui-config.json.example index 6b3a26c6..d8ae0939 100644 --- a/public/ui-config.json.example +++ b/public/ui-config.json.example @@ -11,6 +11,7 @@ "chat.viewer.height.percentage": 0.40, "widget.dimmer.colorwheel": false, "avatar.wardrobe.max.slots": 10, + "user.badges.max.slots": 5, "hotelview": { "widgets": { "slot.1.widget": "promoarticle", diff --git a/src/App.scss b/src/App.scss index 30fce560..5bc604ea 100644 --- a/src/App.scss +++ b/src/App.scss @@ -32,7 +32,7 @@ $inventory-height: 320px; $navigator-width: 400px; $navigator-height: 420px; -$chat-input-style-selector-widget-width: 200px; +$chat-input-style-selector-widget-width: 210px; $chat-input-style-selector-widget-height: 200px; $user-profile-width: 560px; diff --git a/src/assets/styles/utils.scss b/src/assets/styles/utils.scss index 8db17555..c1a3be5b 100644 --- a/src/assets/styles/utils.scss +++ b/src/assets/styles/utils.scss @@ -114,3 +114,7 @@ ul { transform: scale(1); } } + +.btn { + pointer-events: all; +} diff --git a/src/components/chat-history/ChatHistoryView.scss b/src/components/chat-history/ChatHistoryView.scss index 8c3838e4..f18f91b5 100644 --- a/src/components/chat-history/ChatHistoryView.scss +++ b/src/components/chat-history/ChatHistoryView.scss @@ -1,8 +1,4 @@ .nitro-chat-history { width: $chat-history-width; height: $chat-history-height; - - .content-area { - min-height: 200px; - } } diff --git a/src/components/inventory/views/badge/InventoryBadgeView.tsx b/src/components/inventory/views/badge/InventoryBadgeView.tsx index 73300e10..8aab5cbf 100644 --- a/src/components/inventory/views/badge/InventoryBadgeView.tsx +++ b/src/components/inventory/views/badge/InventoryBadgeView.tsx @@ -1,6 +1,6 @@ import { RequestBadgesComposer } from '@nitrots/nitro-renderer'; import { FC, useEffect } from 'react'; -import { LocalizeBadgeName, LocalizeText } from '../../../../api'; +import { GetConfiguration, LocalizeBadgeName, LocalizeText } from '../../../../api'; import { AutoGrid } from '../../../../common/AutoGrid'; import { Button } from '../../../../common/Button'; import { Column } from '../../../../common/Column'; @@ -22,9 +22,10 @@ export const InventoryBadgeView: FC = props => const { badgeState = null, dispatchBadgeState = null } = useInventoryContext(); const { needsBadgeUpdate = false, badge = null, badges = [], activeBadges = [] } = badgeState; - const isWearingBadge = (badgeCode: string) => (activeBadges.indexOf(badgeCode) >= 0); + const maxBadgeCount = GetConfiguration('user.badges.max.slots', 5); - const canWearBadges = () => (activeBadges.length < 5); + const isWearingBadge = (badgeCode: string) => (activeBadges.indexOf(badgeCode) >= 0); + const canWearBadges = () => (activeBadges.length < maxBadgeCount); const toggleBadge = () => { diff --git a/src/layout/card/content/NitroCardContentView.tsx b/src/layout/card/content/NitroCardContentView.tsx index 2ada5f99..85c93343 100644 --- a/src/layout/card/content/NitroCardContentView.tsx +++ b/src/layout/card/content/NitroCardContentView.tsx @@ -4,8 +4,8 @@ import { useNitroCardContext } from '../context'; export const NitroCardContentView: FC = props => { - const { classNames = [], ...rest } = props; - const { theme = 'primary', simple = false } = useNitroCardContext(); + const { overflow = 'auto', classNames = [], ...rest } = props; + const { simple = false } = useNitroCardContext(); const getClassNames = useMemo(() => { @@ -18,5 +18,5 @@ export const NitroCardContentView: FC = props => return newClassNames; }, [ simple, classNames ]); - return ; + return ; } diff --git a/src/views/campaign/views/calendar-item/CalendarItemView.tsx b/src/views/campaign/views/calendar-item/CalendarItemView.tsx index fe2eba0c..bf5e9607 100644 --- a/src/views/campaign/views/calendar-item/CalendarItemView.tsx +++ b/src/views/campaign/views/calendar-item/CalendarItemView.tsx @@ -2,7 +2,15 @@ import { FC, useCallback } from 'react'; import { GetRoomEngine, GetSessionDataManager } from '../../../../api'; import { NitroLayoutFlexColumn } from '../../../../layout'; import { CalendarItemState } from '../../common/CalendarItemState'; -import { CalendarItemViewProps } from './CalendarItemView.types'; + +interface CalendarItemViewProps +{ + id: number; + productName?: string; + state: number; + active?: boolean; + onClick(itemId: number): void; +} export const CalendarItemView: FC = props => { diff --git a/src/views/campaign/views/calendar-item/CalendarItemView.types.ts b/src/views/campaign/views/calendar-item/CalendarItemView.types.ts deleted file mode 100644 index 038dc03c..00000000 --- a/src/views/campaign/views/calendar-item/CalendarItemView.types.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface CalendarItemViewProps -{ - id: number; - productName?: string; - state: number; - active?: boolean; - onClick(itemId: number): void; -} diff --git a/src/views/campaign/views/calendar/CalendarView.tsx b/src/views/campaign/views/calendar/CalendarView.tsx index b6566791..a7d77d4a 100644 --- a/src/views/campaign/views/calendar/CalendarView.tsx +++ b/src/views/campaign/views/calendar/CalendarView.tsx @@ -4,7 +4,18 @@ import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroLayoutFl import { CalendarItemState } from '../../common/CalendarItemState'; import { getNumItemsDisplayed } from '../../common/Utils'; import { CalendarItemView } from '../calendar-item/CalendarItemView'; -import { CalendarViewProps } from './CalendarView.types'; + +interface CalendarViewProps +{ + close(): void; + openPackage(id: number, asStaff: boolean): void; + receivedProducts: Map; + campaignName: string; + currentDay: number; + numDays: number; + openedDays: number[]; + missedDays: number[]; +} export const CalendarView: FC = props => { diff --git a/src/views/campaign/views/calendar/CalendarView.types.ts b/src/views/campaign/views/calendar/CalendarView.types.ts deleted file mode 100644 index 454021e3..00000000 --- a/src/views/campaign/views/calendar/CalendarView.types.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface CalendarViewProps -{ - close(): void; - openPackage(id: number, asStaff: boolean): void; - receivedProducts: Map; - campaignName: string; - currentDay: number; - numDays: number; - openedDays: number[]; - missedDays: number[]; -} diff --git a/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx b/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx index e018d0ce..872460cd 100644 --- a/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx +++ b/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx @@ -6,9 +6,9 @@ import { TryJoinGroup } from '../../../../../api/groups/TryJoinGroup'; import { BatchUpdates, CreateMessageHook } from '../../../../../hooks'; import { useRoomEngineEvent } from '../../../../../hooks/events'; import { useRoomContext } from '../../../context/RoomContext'; +import { ContextMenuHeaderView } from '../../context-menu/ContextMenuHeaderView'; +import { ContextMenuListItemView } from '../../context-menu/ContextMenuListItemView'; import { ContextMenuView } from '../../context-menu/ContextMenuView'; -import { ContextMenuHeaderView } from '../../context-menu/views/header/ContextMenuHeaderView'; -import { ContextMenuListItemView } from '../../context-menu/views/list-item/ContextMenuListItemView'; import { EffectBoxConfirmView } from './EffectBoxConfirmView'; import { MonsterPlantSeedConfirmView } from './MonsterPlantSeedConfirmView'; import { PurchasableClothingConfirmView } from './PurchasableClothingConfirmView'; diff --git a/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx b/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx index 19ca05c0..b13b29b1 100644 --- a/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx +++ b/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx @@ -14,12 +14,12 @@ export const RoomToolsWidgetView: FC<{}> = props => { const [ isZoomedIn, setIsZoomedIn ] = useState(false); const [ isLiked, setIsLiked ] = useState(false); - const { widgetHandler = null } = useRoomContext(); const [ roomName, setRoomName ] = useState(null); const [ roomOwner, setRoomOwner ] = useState(null); const [ roomTags, setRoomTags ] = useState(null); const [ roomInfoDisplay, setRoomInfoDisplay ] = useState(false); const [ isOpen, setIsOpen ] = useState(false); + const { widgetHandler = null } = useRoomContext(); const handleToolClick = (action: string) => {