From 25c7017518ed378bfa0b45b1816775bf6771d282 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 3 Mar 2022 23:59:53 -0500 Subject: [PATCH] Update RarityLevelView --- src/common/index.scss | 14 ++++++++++++++ .../layout/LayoutRarityLevelView.tsx} | 6 +++--- src/common/layout/index.ts | 1 + .../views/furniture/InventoryFurnitureView.tsx | 5 ++--- .../widgets/infostand/InfoStandWidgetFurniView.tsx | 5 ++--- 5 files changed, 22 insertions(+), 9 deletions(-) rename src/{views/shared/rarity-level/RarityLevelView.tsx => common/layout/LayoutRarityLevelView.tsx} (73%) diff --git a/src/common/index.scss b/src/common/index.scss index f5481279..5e42da37 100644 --- a/src/common/index.scss +++ b/src/common/index.scss @@ -318,5 +318,19 @@ } } +.nitro-rarity-level { + width: 36px; + height: 28px; + background: url("../assets/images/infostand/rarity-level.png"); + + div { + line-height: 28px; + text-align: center; + color: $black; + font-weight: bold; + } +} + + @import './card/NitroCardView'; diff --git a/src/views/shared/rarity-level/RarityLevelView.tsx b/src/common/layout/LayoutRarityLevelView.tsx similarity index 73% rename from src/views/shared/rarity-level/RarityLevelView.tsx rename to src/common/layout/LayoutRarityLevelView.tsx index b986f8d5..28313747 100644 --- a/src/views/shared/rarity-level/RarityLevelView.tsx +++ b/src/common/layout/LayoutRarityLevelView.tsx @@ -1,12 +1,12 @@ import { FC, useMemo } from 'react'; -import { Base, BaseProps } from '../../../common'; +import { Base, BaseProps } from '..'; -interface RarityLevelViewProps extends BaseProps +interface LayoutRarityLevelViewProps extends BaseProps { level: number; } -export const RarityLevelView: FC = props => +export const LayoutRarityLevelView: FC = props => { const { level = 0, classNames = [], children = null, ...rest } = props; diff --git a/src/common/layout/index.ts b/src/common/layout/index.ts index 6ba32465..8a3facd3 100644 --- a/src/common/layout/index.ts +++ b/src/common/layout/index.ts @@ -9,6 +9,7 @@ export * from './LayoutLoadingSpinnerView'; export * from './LayoutMiniCameraView'; export * from './LayoutNotificationAlertView'; export * from './LayoutNotificationBubbleView'; +export * from './LayoutRarityLevelView'; export * from './LayoutRoomThumbnailView'; export * from './LayoutTrophyView'; export * from './UserProfileIconView'; diff --git a/src/components/inventory/views/furniture/InventoryFurnitureView.tsx b/src/components/inventory/views/furniture/InventoryFurnitureView.tsx index 4cbdf1d6..cea8c942 100644 --- a/src/components/inventory/views/furniture/InventoryFurnitureView.tsx +++ b/src/components/inventory/views/furniture/InventoryFurnitureView.tsx @@ -1,9 +1,8 @@ import { FurnitureListComposer, IRoomSession, RoomObjectVariable, RoomPreviewer, Vector3d } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; import { GetRoomEngine, GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../../api'; -import { AutoGrid, Button, Column, Grid, Text } from '../../../../common'; +import { AutoGrid, Button, Column, Grid, LayoutRarityLevelView, Text } from '../../../../common'; import { LimitedEditionCompactPlateView } from '../../../../views/shared/limited-edition/LimitedEditionCompactPlateView'; -import { RarityLevelView } from '../../../../views/shared/rarity-level/RarityLevelView'; import { RoomPreviewerView } from '../../../../views/shared/room-previewer/RoomPreviewerView'; import { FurniCategory } from '../../common/FurniCategory'; import { attemptItemPlacement, attemptPlaceMarketplaceOffer } from '../../common/FurnitureUtilities'; @@ -120,7 +119,7 @@ export const InventoryFurnitureView: FC = props => { groupItem && groupItem.stuffData.isUnique && } { (groupItem && groupItem.stuffData.rarityLevel > -1) && - } + } { groupItem && diff --git a/src/views/room/widgets/infostand/InfoStandWidgetFurniView.tsx b/src/views/room/widgets/infostand/InfoStandWidgetFurniView.tsx index fc5536f8..350d85ab 100644 --- a/src/views/room/widgets/infostand/InfoStandWidgetFurniView.tsx +++ b/src/views/room/widgets/infostand/InfoStandWidgetFurniView.tsx @@ -2,10 +2,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { CrackableDataType, GroupInformationComposer, GroupInformationEvent, RoomControllerLevel, RoomObjectCategory, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, StringDataType } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { CreateLinkEvent, GetGroupInformation, GetRoomEngine, LocalizeText, RoomWidgetFurniActionMessage, RoomWidgetUpdateInfostandFurniEvent, SendMessageComposer } from '../../../../api'; -import { Button, Column, Flex, LayoutBadgeImageView, Text, UserProfileIconView } from '../../../../common'; +import { Button, Column, Flex, LayoutBadgeImageView, LayoutRarityLevelView, Text, UserProfileIconView } from '../../../../common'; import { BatchUpdates, UseMessageEventHook } from '../../../../hooks'; import { LimitedEditionCompactPlateView } from '../../../shared/limited-edition/LimitedEditionCompactPlateView'; -import { RarityLevelView } from '../../../shared/rarity-level/RarityLevelView'; import { useRoomContext } from '../../context/RoomContext'; interface InfoStandWidgetFurniViewProps @@ -272,7 +271,7 @@ export const InfoStandWidgetFurniView: FC = props } { (furniData.stuffData.rarityLevel > -1) &&
- +
} { furniData.image && furniData.image.src.length && }