diff --git a/craco.config.js b/craco.config.js index 661daecc..4f5320a4 100644 --- a/craco.config.js +++ b/craco.config.js @@ -5,6 +5,23 @@ module.exports = { webpack: { configure: (webpackConfig) => ({ ...webpackConfig, + optimization: { + ...webpackConfig.optimization, + splitChunks: { + cacheGroups: { + vendor: { + name: 'vendors', + test: /[\\/]node_modules[\\/]/, + chunks: 'all', + }, + renderer: { + name: 'renderer', + test: /[\\/]node_modules[\\/]@nitrots[\\/]nitro-renderer[\\/]/, + chunks: 'all', + } + } + } + }, module: { ...webpackConfig.module, rules: webpackConfig.module.rules.map((rule) => diff --git a/src/App.scss b/src/App.scss index 8d450e5a..2a93b1ff 100644 --- a/src/App.scss +++ b/src/App.scss @@ -17,6 +17,21 @@ $grid-active-border-color: $white; $toolbar-height: 55px; +$achievement-width: 650px; +$achievement-height: 400px; + +$avatar-editor-width: 620px; +$avatar-editor-height: 374px; + +$catalog-width: 620px; +$catalog-height: 400px; + +$inventory-width: 528px; +$inventory-height: 320px; + +$navigator-width: 400px; +$navigator-height: 420px; + .nitro-app { width: 100%; height: 100%; diff --git a/src/App.tsx b/src/App.tsx index 439fbc5d..9d050bd9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -125,7 +125,7 @@ export const App: FC<{}> = props => } return ( -
+
{ (!isReady || isError) && } diff --git a/src/api/friends/OpenMessengerChat.ts b/src/api/friends/OpenMessengerChat.ts new file mode 100644 index 00000000..0b8ab554 --- /dev/null +++ b/src/api/friends/OpenMessengerChat.ts @@ -0,0 +1,7 @@ +import { CreateLinkEvent } from '..'; + +export function OpenMessengerChat(friendId: number = -1): void +{ + if(friendId === -1) CreateLinkEvent('friends/messenger/open'); + else CreateLinkEvent(`friends/messenger/${friendId}`); +} diff --git a/src/api/friends/index.ts b/src/api/friends/index.ts new file mode 100644 index 00000000..ffb458ee --- /dev/null +++ b/src/api/friends/index.ts @@ -0,0 +1 @@ +export * from './OpenMessengerChat'; diff --git a/src/api/index.ts b/src/api/index.ts index 773325c3..0b87703a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,4 +1,5 @@ export * from './core'; +export * from './friends'; export * from './groups'; export * from './navigator'; export * from './nitro'; diff --git a/src/api/nitro/room/DispatchMouseEvent.ts b/src/api/nitro/room/DispatchMouseEvent.ts index 762e0dda..6d18f2e8 100644 --- a/src/api/nitro/room/DispatchMouseEvent.ts +++ b/src/api/nitro/room/DispatchMouseEvent.ts @@ -47,6 +47,8 @@ export function DispatchMouseEvent(roomId: number, canvasId: number, event: Mous break; case MouseEventType.MOUSE_UP: break; + case MouseEventType.RIGHT_CLICK: + break; default: return; } diff --git a/src/api/nitro/room/widgets/events/RoomWidgetUpdateDecorateModeEvent.ts b/src/api/nitro/room/widgets/events/RoomWidgetUpdateDecorateModeEvent.ts new file mode 100644 index 00000000..212e371c --- /dev/null +++ b/src/api/nitro/room/widgets/events/RoomWidgetUpdateDecorateModeEvent.ts @@ -0,0 +1,20 @@ +import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent'; + +export class RoomWidgetUpdateDecorateModeEvent extends RoomWidgetUpdateEvent +{ + public static UPDATE_DECORATE: string = 'RWUDME_UPDATE_DECORATE'; + + private _isDecorating: boolean; + + constructor(isDecorating: boolean) + { + super(RoomWidgetUpdateDecorateModeEvent.UPDATE_DECORATE); + + this._isDecorating = isDecorating; + } + + public get isDecorating(): boolean + { + return this._isDecorating; + } +} diff --git a/src/api/nitro/room/widgets/events/index.ts b/src/api/nitro/room/widgets/events/index.ts index f612d85b..775d210e 100644 --- a/src/api/nitro/room/widgets/events/index.ts +++ b/src/api/nitro/room/widgets/events/index.ts @@ -14,6 +14,7 @@ export * from './RoomWidgetUpdateChatInputContentEvent'; export * from './RoomWidgetUpdateCreditFurniEvent'; export * from './RoomWidgetUpdateCustomStackHeightEvent'; export * from './RoomWidgetUpdateDanceStatusEvent'; +export * from './RoomWidgetUpdateDecorateModeEvent'; export * from './RoomWidgetUpdateDimmerEvent'; export * from './RoomWidgetUpdateDimmerStateEvent'; export * from './RoomWidgetUpdateEvent'; diff --git a/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts b/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts index 1ee584ce..e86aba4e 100644 --- a/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts +++ b/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts @@ -1,7 +1,7 @@ import { IFurnitureData, NitroEvent, ObjectDataFactory, PetFigureData, PetRespectComposer, PetSupplementComposer, PetType, RoomControllerLevel, RoomModerationSettings, RoomObjectCategory, RoomObjectOperationType, RoomObjectType, RoomObjectVariable, RoomSessionPetInfoUpdateEvent, RoomSessionUserBadgesEvent, RoomTradingLevelEnum, RoomUnitDropHandItemComposer, RoomUnitGiveHandItemComposer, RoomUnitGiveHandItemPetComposer, RoomUserData, RoomWidgetEnum, RoomWidgetEnumItemExtradataParameter, Vector3d } from '@nitrots/nitro-renderer'; import { GetNitroInstance, GetRoomEngine, GetSessionDataManager, IsOwnerOfFurniture } from '../../../..'; import { InventoryTradeRequestEvent, WiredSelectObjectEvent } from '../../../../../events'; -import { FriendListSendFriendRequestEvent } from '../../../../../events/friend-list/FriendListSendFriendRequestEvent'; +import { FriendsSendFriendRequestEvent } from '../../../../../events/friends/FriendsSendFriendRequestEvent'; import { dispatchUiEvent } from '../../../../../hooks/events'; import { SendMessageHook } from '../../../../../hooks/messages'; import { PetSupplementEnum } from '../../../../../views/room/widgets/avatar-info/common/PetSupplementEnum'; @@ -76,7 +76,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler case RoomWidgetRoomObjectMessage.GET_OBJECT_INFO: return this.processObjectInfoMessage((message as RoomWidgetRoomObjectMessage)); case RoomWidgetUserActionMessage.SEND_FRIEND_REQUEST: - dispatchUiEvent(new FriendListSendFriendRequestEvent(userId)); + dispatchUiEvent(new FriendsSendFriendRequestEvent(userId)); break; case RoomWidgetUserActionMessage.RESPECT_USER: GetSessionDataManager().giveRespect(userId); diff --git a/src/assets/images/friendlist/icons/icon_new_message.png b/src/assets/images/friendlist/icons/icon_new_message.png new file mode 100644 index 00000000..f7a31fa0 Binary files /dev/null and b/src/assets/images/friendlist/icons/icon_new_message.png differ diff --git a/src/assets/images/friendlist/icons/icon_warning.png b/src/assets/images/friendlist/icons/icon_warning.png new file mode 100644 index 00000000..3a3ffcf9 Binary files /dev/null and b/src/assets/images/friendlist/icons/icon_warning.png differ diff --git a/src/assets/styles/bootstrap/_utilities.scss b/src/assets/styles/bootstrap/_utilities.scss index 960d6f1a..7c6c7231 100644 --- a/src/assets/styles/bootstrap/_utilities.scss +++ b/src/assets/styles/bootstrap/_utilities.scss @@ -42,6 +42,14 @@ $utilities: map-merge( property: overflow, values: auto hidden visible scroll, ), + "overflow-x": ( + property: overflow-x, + values: auto hidden visible scroll, + ), + "overflow-y": ( + property: overflow-y, + values: auto hidden visible scroll, + ), // scss-docs-end utils-overflow // scss-docs-start utils-display "display": ( diff --git a/src/assets/styles/bootstrap/_variables.scss b/src/assets/styles/bootstrap/_variables.scss index 57aa9b7d..feb71255 100644 --- a/src/assets/styles/bootstrap/_variables.scss +++ b/src/assets/styles/bootstrap/_variables.scss @@ -85,6 +85,7 @@ $ghost: #c8cad0 !default; $gray-chateau: #a3a7b1 !default; $gable-green: #1C323F !default; $william: #3d5f6e !default; +$bluewood: #304059 !default; $success: $green !default; $info: $cyan !default; $warning: $yellow !default; @@ -385,7 +386,7 @@ $enable-transitions: true !default; $enable-reduced-motion: true !default; $enable-smooth-scroll: true !default; $enable-grid-classes: true !default; -$enable-cssgrid: false !default; +$enable-cssgrid: true !default; $enable-button-pointers: true !default; $enable-rfs: true !default; $enable-validation-icons: true !default; diff --git a/src/assets/styles/grid.scss b/src/assets/styles/grid.scss deleted file mode 100644 index 3a23cb69..00000000 --- a/src/assets/styles/grid.scss +++ /dev/null @@ -1,44 +0,0 @@ -$grid-options: ( - "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" -); - -.grid-items { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; - align-content: flex-start; - width: 100%; - margin-top: -3px; - overflow: hidden; - - @each $option in $grid-options { - &.grid-#{$option} { - .grid-item { - width: calc(1 / #{$option} * 100% - (1 - 1 / #{$option}) * 3px); - - &:nth-child(#{$option}n) { - margin-right: 0; - } - } - } - } -} - -.row-grid { - margin: 0 !important; - - .col { - padding: 0 !important; - } -} - -@each $option in $grid-options { - .row-grid { - &.row-cols-#{$option} { - .col:nth-child(#{$option}n) { - padding-left: 10px !important; - } - } - } -} diff --git a/src/assets/styles/icons.scss b/src/assets/styles/icons.scss index a5108a7c..3d8f14ab 100644 --- a/src/assets/styles/icons.scss +++ b/src/assets/styles/icons.scss @@ -693,6 +693,18 @@ height: 16px; } + &.icon-friendlist-warning { + background: url('../images/friendlist/icons/icon_warning.png'); + width: 23px; + height: 21px; + } + + &.icon-friendlist-new-message { + background: url('../images/friendlist/icons/icon_new_message.png'); + width: 14px; + height: 16px; + } + &.spin { animation: rotating 1s linear infinite; } diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 0c20accd..ee7ae10f 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -7,7 +7,6 @@ @import '../node_modules/animate.css/animate.min.css'; @import './scrollbars'; @import './slider'; -@import './grid'; @import './icons'; @import './utils'; @@ -15,6 +14,10 @@ min-height: 28px; } +textarea { + resize: none; +} + /* Chrome, Safari, Edge, Opera */ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { diff --git a/src/assets/styles/scrollbars.scss b/src/assets/styles/scrollbars.scss index f4120813..b2d976db 100644 --- a/src/assets/styles/scrollbars.scss +++ b/src/assets/styles/scrollbars.scss @@ -1,22 +1,53 @@ ::-webkit-scrollbar { width: 0.5rem; - height: 0.5rem; + + &:horizontal { + height: 0.5rem; + } + + &:not(:horizontal) { + width: 0.5rem; + } } ::-webkit-scrollbar-track { - background-clip: padding-box; - border-right: 0.25rem solid rgba($black, .1); + + &:horizontal { + border-bottom: 0.25rem solid rgba($black, .1); + } + + &:not(:horizontal) { + border-right: 0.25rem solid rgba($black, .1); + } } ::-webkit-scrollbar-thumb { - background-clip: padding-box; - border-right: 0.25rem solid rgba($primary, .4); - &:hover { - border-right: 0.25rem solid rgba($primary, .8); + &:horizontal { + border-bottom: 0.25rem solid rgba($primary, .4); + + &:hover { + border-bottom: 0.25rem solid rgba($primary, .8); + } + + &:active { + border-bottom: 0.25rem solid $secondary; + } } - &:active { - border-right: 0.25rem solid $secondary; + &:not(:horizontal) { + border-right: 0.25rem solid rgba($primary, .4); + + &:hover { + border-right: 0.25rem solid rgba($primary, .8); + } + + &:active { + border-right: 0.25rem solid $secondary; + } } } + +::-webkit-scrollbar-corner { + background: rgba($black, .1); +} diff --git a/src/assets/styles/utils.scss b/src/assets/styles/utils.scss index 0050c41b..cc44e17f 100644 --- a/src/assets/styles/utils.scss +++ b/src/assets/styles/utils.scss @@ -10,6 +10,14 @@ transform: scale(1) translateZ(0); } +.scale-1-25 { + transform: scale(1.25) translateZ(0); +} + +.scale-1-50 { + transform: scale(1.50) translateZ(0); +} + .scale-2 { transform: scale(2) translateZ(0); } diff --git a/src/events/friend-list/index.ts b/src/events/friend-list/index.ts deleted file mode 100644 index 4789fde9..00000000 --- a/src/events/friend-list/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './FriendEnteredRoomEvent'; -export * from './FriendListEvent'; diff --git a/src/events/friend-list/FriendEnteredRoomEvent.ts b/src/events/friends/FriendEnteredRoomEvent.ts similarity index 100% rename from src/events/friend-list/FriendEnteredRoomEvent.ts rename to src/events/friends/FriendEnteredRoomEvent.ts diff --git a/src/events/friend-list/FriendListContentEvent.ts b/src/events/friends/FriendListContentEvent.ts similarity index 83% rename from src/events/friend-list/FriendListContentEvent.ts rename to src/events/friends/FriendListContentEvent.ts index a7623cbc..80048267 100644 --- a/src/events/friend-list/FriendListContentEvent.ts +++ b/src/events/friends/FriendListContentEvent.ts @@ -1,7 +1,7 @@ import { MessengerFriend } from '../../views/friends/common/MessengerFriend'; -import { FriendListEvent } from './FriendListEvent'; +import { FriendsEvent } from './FriendsEvent'; -export class FriendListContentEvent extends FriendListEvent +export class FriendListContentEvent extends FriendsEvent { public static FRIEND_LIST_CONTENT: string = 'FLSFRE_FRIEND_LIST_CONTENT'; diff --git a/src/events/friend-list/FriendListEvent.ts b/src/events/friends/FriendsEvent.ts similarity index 57% rename from src/events/friend-list/FriendListEvent.ts rename to src/events/friends/FriendsEvent.ts index d450144e..0f8be1d7 100644 --- a/src/events/friend-list/FriendListEvent.ts +++ b/src/events/friends/FriendsEvent.ts @@ -1,8 +1,10 @@ import { NitroEvent } from '@nitrots/nitro-renderer'; -export class FriendListEvent extends NitroEvent +export class FriendsEvent extends NitroEvent { public static SHOW_FRIEND_LIST: string = 'IE_SHOW_FRIEND_LIST'; public static TOGGLE_FRIEND_LIST: string = 'IE_TOGGLE_FRIEND_LIST'; + public static SHOW_FRIEND_MESSENGER: string = 'IE_SHOW_FRIEND_MESSENGER'; + public static TOGGLE_FRIEND_MESSENGER: string = 'IE_TOGGLE_FRIEND_MESSENGER'; public static REQUEST_FRIEND_LIST: string = 'FLSFRE_REQUEST_FRIEND_LIST'; } diff --git a/src/events/friends/FriendsMessengerIconEvent.ts b/src/events/friends/FriendsMessengerIconEvent.ts new file mode 100644 index 00000000..602eb726 --- /dev/null +++ b/src/events/friends/FriendsMessengerIconEvent.ts @@ -0,0 +1,23 @@ +import { NitroEvent } from '@nitrots/nitro-renderer'; + +export class FriendsMessengerIconEvent extends NitroEvent +{ + public static UPDATE_ICON: string = 'FMIE_UPDATE_ICON'; + public static HIDE_ICON: number = 0; + public static SHOW_ICON: number = 1; + public static UNREAD_ICON: number = 2; + + private _iconType: number; + + constructor(type: string, subType: number = FriendsMessengerIconEvent.SHOW_ICON) + { + super(type); + + this._iconType = subType; + } + + public get iconType(): number + { + return this._iconType; + } +} diff --git a/src/events/friend-list/FriendListSendFriendRequestEvent.ts b/src/events/friends/FriendsSendFriendRequestEvent.ts similarity index 57% rename from src/events/friend-list/FriendListSendFriendRequestEvent.ts rename to src/events/friends/FriendsSendFriendRequestEvent.ts index 02d7c006..9e42661b 100644 --- a/src/events/friend-list/FriendListSendFriendRequestEvent.ts +++ b/src/events/friends/FriendsSendFriendRequestEvent.ts @@ -1,6 +1,6 @@ -import { FriendListEvent } from './FriendListEvent'; +import { FriendsEvent } from './FriendsEvent'; -export class FriendListSendFriendRequestEvent extends FriendListEvent +export class FriendsSendFriendRequestEvent extends FriendsEvent { public static SEND_FRIEND_REQUEST: string = 'FLSFRE_SEND_FRIEND_REQUEST'; @@ -8,7 +8,7 @@ export class FriendListSendFriendRequestEvent extends FriendListEvent constructor(userId: number) { - super(FriendListSendFriendRequestEvent.SEND_FRIEND_REQUEST); + super(FriendsSendFriendRequestEvent.SEND_FRIEND_REQUEST); this._userId = userId; } diff --git a/src/events/friends/index.ts b/src/events/friends/index.ts new file mode 100644 index 00000000..2f3699c3 --- /dev/null +++ b/src/events/friends/index.ts @@ -0,0 +1,5 @@ +export * from './FriendEnteredRoomEvent'; +export * from './FriendListContentEvent'; +export * from './FriendsEvent'; +export * from './FriendsMessengerIconEvent'; +export * from './FriendsSendFriendRequestEvent'; diff --git a/src/events/index.ts b/src/events/index.ts index 006285c8..9d4842ca 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -1,7 +1,7 @@ export * from './avatar-editor'; export * from './camera'; export * from './catalog'; -export * from './friend-list'; +export * from './friends'; export * from './inventory'; export * from './navigator'; export * from './notification-center'; diff --git a/src/index.scss b/src/index.scss index cbfa7106..d3842a6a 100644 --- a/src/index.scss +++ b/src/index.scss @@ -14,4 +14,8 @@ body { image-rendering: -moz-crisp-edges; } +img { + object-fit: none; +} + @import './App'; diff --git a/src/layout/base/NitroLayoutBase.tsx b/src/layout/base/NitroLayoutBase.tsx new file mode 100644 index 00000000..7007a972 --- /dev/null +++ b/src/layout/base/NitroLayoutBase.tsx @@ -0,0 +1,28 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutBaseProps } from './NitroLayoutBase.types'; + +export const NitroLayoutBase: FC = props => +{ + const { className = '', overflow = null, position = null, gap = null, children = null, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = ''; + + if(overflow && overflow.length) newClassName += ` overflow-${ overflow }`; + + if(position && position.length) newClassName += ` position-${ position }`; + + if(gap && gap >= 1) newClassName += ` gap-${ gap }`; + + if(className && className.length) newClassName += ` ${ className }`; + + return newClassName; + }, [ className, overflow, position, gap ]); + + return ( +
+ { children } +
+ ); +} diff --git a/src/layout/base/NitroLayoutBase.types.ts b/src/layout/base/NitroLayoutBase.types.ts new file mode 100644 index 00000000..fe2219fa --- /dev/null +++ b/src/layout/base/NitroLayoutBase.types.ts @@ -0,0 +1,9 @@ +import { ButtonHTMLAttributes, DetailedHTMLProps } from 'react'; +import { NitroLayoutOverflow, NitroLayoutPosition, NitroLayoutSpacing } from '../common'; + +export interface NitroLayoutBaseProps extends DetailedHTMLProps, HTMLDivElement> +{ + overflow?: NitroLayoutOverflow; + position?: NitroLayoutPosition; + gap?: NitroLayoutSpacing; +} diff --git a/src/layout/base/index.ts b/src/layout/base/index.ts new file mode 100644 index 00000000..f38bd839 --- /dev/null +++ b/src/layout/base/index.ts @@ -0,0 +1,2 @@ +export * from './NitroLayoutBase'; +export * from './NitroLayoutBase.types'; diff --git a/src/layout/button/NitroLayoutButton.tsx b/src/layout/button/NitroLayoutButton.tsx new file mode 100644 index 00000000..0b66a3d0 --- /dev/null +++ b/src/layout/button/NitroLayoutButton.tsx @@ -0,0 +1,26 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutButtonProps } from './NitroLayoutButton.types'; + +export const NitroLayoutButton: FC = props => +{ + const { className = '', variant = 'primary', size = null, children = null, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = 'btn'; + + if(variant && variant.length) newClassName += ` btn-${ variant }`; + + if(size && size.length) newClassName += ` btn-${ size }`; + + if(className && className.length) newClassName += ` ${ className }`; + + return newClassName; + }, [ className, variant, size ]); + + return ( + + ); +} diff --git a/src/layout/button/NitroLayoutButton.types.ts b/src/layout/button/NitroLayoutButton.types.ts new file mode 100644 index 00000000..cc01479d --- /dev/null +++ b/src/layout/button/NitroLayoutButton.types.ts @@ -0,0 +1,8 @@ +import { ButtonHTMLAttributes, DetailedHTMLProps } from 'react'; +import { NitroLayoutButtonSize, NitroLayoutVariant } from '../common'; + +export interface NitroLayoutButtonProps extends DetailedHTMLProps, HTMLButtonElement> +{ + variant?: NitroLayoutVariant; + size?: NitroLayoutButtonSize; +} diff --git a/src/layout/button/index.ts b/src/layout/button/index.ts new file mode 100644 index 00000000..ccfb06b3 --- /dev/null +++ b/src/layout/button/index.ts @@ -0,0 +1,2 @@ +export * from './NitroLayoutButton'; +export * from './NitroLayoutButton.types'; diff --git a/src/layout/card/NitroCardView.scss b/src/layout/card/NitroCardView.scss index 44285071..7e82a515 100644 --- a/src/layout/card/NitroCardView.scss +++ b/src/layout/card/NitroCardView.scss @@ -3,6 +3,7 @@ $nitro-card-tabs-height: 33px; .nitro-card { pointer-events: all; + resize: both; @import './accordion/NitroCardAccordionView'; @import './content/NitroCardContentView'; @@ -19,6 +20,10 @@ $nitro-card-tabs-height: 33px; height: 100%; pointer-events: none; + .theme-primary { + border: $border-width solid $border-color; + } + @include media-breakpoint-down(lg) { .draggable-window { @@ -31,12 +36,13 @@ $nitro-card-tabs-height: 33px; } .nitro-card { - width: 100%; - height: 100%; + max-width: 75%; + max-height: calc(100% - 20px); + margin: 10px auto 10px; - &.rounded { - border-radius: 0 !important; - } + // &.rounded { + // border-radius: 0 !important; + // } } } } diff --git a/src/layout/card/NitroCardView.tsx b/src/layout/card/NitroCardView.tsx index aaf4178a..f44ee67f 100644 --- a/src/layout/card/NitroCardView.tsx +++ b/src/layout/card/NitroCardView.tsx @@ -11,7 +11,7 @@ export const NitroCardView: FC = props =>
-
+
{ children }
diff --git a/src/layout/card/content/NitroCardContentView.scss b/src/layout/card/content/NitroCardContentView.scss index 9ffd6fe9..c56cad8c 100644 --- a/src/layout/card/content/NitroCardContentView.scss +++ b/src/layout/card/content/NitroCardContentView.scss @@ -1,4 +1,5 @@ .content-area { + height: 100%; padding-top: $container-padding-x; padding-bottom: $container-padding-x; overflow: auto; @@ -9,6 +10,5 @@ height: 100% !important; min-height: auto !important; max-height: 100% !important; - resize: none !important; } } diff --git a/src/layout/card/content/NitroCardContentView.tsx b/src/layout/card/content/NitroCardContentView.tsx index 969069b2..8565b3ab 100644 --- a/src/layout/card/content/NitroCardContentView.tsx +++ b/src/layout/card/content/NitroCardContentView.tsx @@ -8,7 +8,7 @@ export const NitroCardContentView: FC = props => const { simple = false } = useNitroCardContext(); return ( -
+
{ children }
); diff --git a/src/layout/card/grid/NitroCardGridView.scss b/src/layout/card/grid/NitroCardGridView.scss index f5794406..948bb63b 100644 --- a/src/layout/card/grid/NitroCardGridView.scss +++ b/src/layout/card/grid/NitroCardGridView.scss @@ -1,71 +1,6 @@ -.nitro-card-grid { - width: 100%; - - .row-cols-3 { - - .col { - padding-right: 0.25rem; - - &:nth-child(3n+3) { - padding-right: 0; - } - } - } - - .row-cols-4 { - - .col { - padding-right: 0.25rem; - - &:nth-child(4n+4) { - padding-right: 0; - } - } - } - - .row-cols-5 { - - .col { - padding-right: 0.25rem; - - &:nth-child(5n+5) { - padding-right: 0; - } - } - } - - .row-cols-6 { - - .col { - padding-right: 0.25rem; - - &:nth-child(6n+6) { - padding-right: 0; - } - } - } - - .row-cols-7 { - - .col { - padding-right: 0.25rem; - - &:nth-child(7n+7) { - padding-right: 0; - } - } - } - - .row-cols-8 { - - .col { - padding-right: 0.25rem; - - &:nth-child(8n+8) { - padding-right: 0; - } - } - } - - @import './item/NitroCardGridItemView.scss'; +.nitro-grid { + --nitro-grid-column-min-width: 45px; + grid-template-columns: repeat(auto-fill, minmax(var(--nitro-grid-column-min-width, 45px), 1fr)); } + +@import './item/NitroCardGridItemView.scss'; diff --git a/src/layout/card/grid/NitroCardGridView.tsx b/src/layout/card/grid/NitroCardGridView.tsx index a9a85c64..a9e611bc 100644 --- a/src/layout/card/grid/NitroCardGridView.tsx +++ b/src/layout/card/grid/NitroCardGridView.tsx @@ -1,18 +1,31 @@ -import { FC } from 'react'; -import { NitroCardGridContextProvider } from './context/NitroCardGridContext'; -import { NitroCardGridThemes, NitroCardGridViewProps } from './NitroCardGridView.types'; +import { FC, useMemo } from 'react'; +import { NitroCardGridViewProps } from './NitroCardGridView.types'; export const NitroCardGridView: FC = props => { - const { columns = 5, theme = NitroCardGridThemes.THEME_DEFAULT, className = '', children = null, ...rest } = props; + const { columns = 5, gap = 2, className = '', style = null, children = null, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = `grid gap-${ gap } nitro-grid overflow-auto`; + + if(className && className.length) newClassName += ' ' + className; + + return newClassName; + }, [ className, gap ]); + + const getStyle = useMemo(() => + { + const newStyle = { ...style }; + + //newStyle['--bs-columns'] = columns.toString(); + + return newStyle; + }, [ style, columns ]); return ( - -
-
- { children } -
-
-
+
+ { children } +
); } diff --git a/src/layout/card/grid/NitroCardGridView.types.ts b/src/layout/card/grid/NitroCardGridView.types.ts index f3cc6c80..55b14648 100644 --- a/src/layout/card/grid/NitroCardGridView.types.ts +++ b/src/layout/card/grid/NitroCardGridView.types.ts @@ -3,11 +3,5 @@ import { DetailsHTMLAttributes } from 'react'; export interface NitroCardGridViewProps extends DetailsHTMLAttributes { columns?: number; - theme?: string; -} - -export class NitroCardGridThemes -{ - public static THEME_DEFAULT: string = 'theme-default'; - public static THEME_SHADOWED: string = 'theme-shadowed'; + gap?: number; } diff --git a/src/layout/card/grid/context/NitroCardGridContext.tsx b/src/layout/card/grid/context/NitroCardGridContext.tsx deleted file mode 100644 index 18661b76..00000000 --- a/src/layout/card/grid/context/NitroCardGridContext.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { createContext, FC, useContext } from 'react'; -import { INitroCardGridContext, NitroCardGridContextProps } from './NitroCardGridContext.types'; - -const NitroCardGridContext = createContext({ - theme: null -}); - -export const NitroCardGridContextProvider: FC = props => -{ - return { props.children } -} - -export const useNitroCardGridContext = () => useContext(NitroCardGridContext); diff --git a/src/layout/card/grid/context/NitroCardGridContext.types.ts b/src/layout/card/grid/context/NitroCardGridContext.types.ts deleted file mode 100644 index a0f97c95..00000000 --- a/src/layout/card/grid/context/NitroCardGridContext.types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ProviderProps } from 'react'; - -export interface INitroCardGridContext -{ - theme: string; -} - -export interface NitroCardGridContextProps extends ProviderProps -{ - -} diff --git a/src/layout/card/grid/context/index.ts b/src/layout/card/grid/context/index.ts deleted file mode 100644 index 9e3f79e8..00000000 --- a/src/layout/card/grid/context/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './NitroCardGridContext'; -export * from './NitroCardGridContext.types'; diff --git a/src/layout/card/grid/index.ts b/src/layout/card/grid/index.ts index 4b3dea50..8a191eec 100644 --- a/src/layout/card/grid/index.ts +++ b/src/layout/card/grid/index.ts @@ -1,4 +1,3 @@ -export * from './context'; export * from './item'; export * from './NitroCardGridView'; export * from './NitroCardGridView.types'; diff --git a/src/layout/card/grid/item/NitroCardGridItemView.scss b/src/layout/card/grid/item/NitroCardGridItemView.scss index b2959864..ab6ad600 100644 --- a/src/layout/card/grid/item/NitroCardGridItemView.scss +++ b/src/layout/card/grid/item/NitroCardGridItemView.scss @@ -1,86 +1,48 @@ -.grid-item-container { +.grid-item { + position: relative; + display: flex; + justify-content: center; + align-items: center; height: 50px; max-height: 50px; + width: 100%; + background-position: center; + background-repeat: no-repeat; + border-radius: $border-radius; + border-color: $grid-border-color !important; + background-color: $grid-bg-color; + border: nth(map-values($border-widths), 2) solid; - .grid-item { - display: flex; - justify-content: center; - align-items: center; - position: relative; - width: 100%; - height: 100%; - background-position: center; - background-repeat: no-repeat; - overflow: hidden; + &.active { + border-color: $grid-active-border-color !important; + background-color: $grid-active-bg-color !important; + } - &.theme-default { - border-radius: $border-radius; - border-color: $grid-border-color !important; - background-color: $grid-bg-color; - border: nth(map-values($border-widths), 2) solid; - } + &.unseen { + background-color: rgba($success, 0.4); + } - &.theme-shadowed { - border-radius: $border-radius; - background-color: $light; + .badge { + top: 2px; + right: 2px; + font-size: 8px; + } - &::after { - position: absolute; - content: ''; - top: 0; - bottom: 0; - left: 0; - right: 0; - border-radius: $border-radius; - border-bottom: 2px solid white; - border-right: 2px solid white; - box-shadow: -2px -2px rgba(0, 0, 0, .4), inset 3px 3px rgba(0, 0, 0, .2); - } + .avatar-image { + background-position-y: 10px; + } - &.active { - border: nth(map-values($border-widths), 2) solid; - border-color: $oslo-gray !important; - background-color: #F5F5F5; + .trade-button { + position: absolute; + bottom: 2px; + right: 2px; + font-size: 5px; + padding: 3px; + min-height: unset; - &:after { - content: unset; - } - } - } - - &.active { - border-color: $grid-active-border-color !important; - background-color: $grid-active-bg-color !important; - } - - &.unseen { - background-color: rgba($success, 0.4); - } - - .badge { - top: 2px; - right: 2px; - font-size: 8px; - } - - .avatar-image { - background-position: center; - background-repeat: no-repeat; - background-position-y: 12px !important; - } - - .trade-button { - position: absolute; - bottom: 2px; - right: 2px; - font-size: 5px; - padding: 3px; - min-height: unset; - - &.left { - right: unset; - left: 2px; - } + &.left { + right: unset; + left: 2px; } } } diff --git a/src/layout/card/grid/item/NitroCardGridItemView.tsx b/src/layout/card/grid/item/NitroCardGridItemView.tsx index a1e4b253..3bc431ef 100644 --- a/src/layout/card/grid/item/NitroCardGridItemView.tsx +++ b/src/layout/card/grid/item/NitroCardGridItemView.tsx @@ -1,27 +1,50 @@ -import { FC } from 'react'; +import { FC, useMemo } from 'react'; import { LimitedEditionStyledNumberView } from '../../../../views/shared/limited-edition/styled-number/LimitedEditionStyledNumberView'; -import { useNitroCardGridContext } from '../context'; -import { NitroCardGridThemes } from '../NitroCardGridView.types'; import { NitroCardGridItemViewProps } from './NitroCardGridItemView.types'; export const NitroCardGridItemView: FC = props => { - const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUnique = false, itemUniqueNumber = 0, itemUnseen = false, columns = undefined, className = '', style = {}, children = null, ...rest } = props; - const { theme = NitroCardGridThemes.THEME_DEFAULT } = useNitroCardGridContext(); + const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUniqueNumber = -2, itemUnseen = false, className = '', style = {}, children = null, ...rest } = props; - const imageUrl = `url(${ itemImage })`; + const getClassName = useMemo(() => + { + let newClassName = 'grid-item gap-1 cursor-pointer overflow-hidden'; + + if(itemActive) newClassName += ' active'; + + if(itemUniqueNumber === -1) newClassName += ' unique-item sold-out'; + + if(itemUniqueNumber > 0) newClassName += ' unique-item'; + + if(itemUnseen) newClassName += ' unseen'; + + if(itemImage === null) newClassName += ' icon loading-icon'; + + if(className && className.length) newClassName += ' ' + className; + + return newClassName; + }, [ className, itemActive, itemUniqueNumber, itemUnseen, itemImage ]); + + const getStyle = useMemo(() => + { + const newStyle = { ...style }; + + if(itemImage) newStyle.backgroundImage = `url(${ itemImage })`; + + if(itemColor) newStyle.backgroundColor = itemColor; + + return newStyle; + }, [ style, itemImage, itemColor ]); return ( -
-
- { (itemCount > 1) && - { itemCount } } - { itemUnique && -
- -
} - { children } -
+
+ { (itemCount > 1) && + { itemCount } } + { (itemUniqueNumber > 0) && +
+ +
} + { children }
); } diff --git a/src/layout/card/grid/item/NitroCardGridItemView.types.ts b/src/layout/card/grid/item/NitroCardGridItemView.types.ts index bf005811..97861569 100644 --- a/src/layout/card/grid/item/NitroCardGridItemView.types.ts +++ b/src/layout/card/grid/item/NitroCardGridItemView.types.ts @@ -6,8 +6,6 @@ export interface NitroCardGridItemViewProps extends DetailsHTMLAttributes = props => +{ + const { className = '', ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = 'flex-column'; + + if(className && className.length) newClassName += ` ${ className }`; + + return newClassName; + }, [ className ]); + + return ; +} diff --git a/src/layout/flex-column/NitroLayoutFlexColumn.types.ts b/src/layout/flex-column/NitroLayoutFlexColumn.types.ts new file mode 100644 index 00000000..96ab418d --- /dev/null +++ b/src/layout/flex-column/NitroLayoutFlexColumn.types.ts @@ -0,0 +1,6 @@ +import { NitroLayoutFlexProps } from '../flex/NitroLayoutFlex.types'; + +export interface NitroLayoutFlexColumnProps extends NitroLayoutFlexProps +{ + +} diff --git a/src/layout/flex-column/index.ts b/src/layout/flex-column/index.ts new file mode 100644 index 00000000..4ef3d667 --- /dev/null +++ b/src/layout/flex-column/index.ts @@ -0,0 +1,2 @@ +export * from './NitroLayoutFlexColumn'; +export * from './NitroLayoutFlexColumn.types'; diff --git a/src/layout/flex/NitroLayoutFlex.tsx b/src/layout/flex/NitroLayoutFlex.tsx new file mode 100644 index 00000000..00e83a0a --- /dev/null +++ b/src/layout/flex/NitroLayoutFlex.tsx @@ -0,0 +1,19 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutBase } from '../base/NitroLayoutBase'; +import { NitroLayoutFlexProps } from './NitroLayoutFlex.types'; + +export const NitroLayoutFlex: FC = props => +{ + const { className = '', ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = 'd-flex'; + + if(className && className.length) newClassName += ` ${ className }`; + + return newClassName; + }, [ className ]); + + return ; +} diff --git a/src/layout/flex/NitroLayoutFlex.types.ts b/src/layout/flex/NitroLayoutFlex.types.ts new file mode 100644 index 00000000..25a3818c --- /dev/null +++ b/src/layout/flex/NitroLayoutFlex.types.ts @@ -0,0 +1,6 @@ +import { NitroLayoutBaseProps } from '../base/NitroLayoutBase.types'; + +export interface NitroLayoutFlexProps extends NitroLayoutBaseProps +{ + +} diff --git a/src/layout/flex/index.ts b/src/layout/flex/index.ts new file mode 100644 index 00000000..9d9dd4c9 --- /dev/null +++ b/src/layout/flex/index.ts @@ -0,0 +1,2 @@ +export * from './NitroLayoutFlex'; +export * from './NitroLayoutFlex.types'; diff --git a/src/layout/grid/NitroLayoutGrid.tsx b/src/layout/grid/NitroLayoutGrid.tsx new file mode 100644 index 00000000..531e3b3c --- /dev/null +++ b/src/layout/grid/NitroLayoutGrid.tsx @@ -0,0 +1,19 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutBase } from '../base'; +import { NitroLayoutGridProps } from './NitroLayoutGrid.types'; + +export const NitroLayoutGrid: FC = props => +{ + const { className = '', gap = 3, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = 'grid h-100'; + + if(className && className.length) newClassName += ' ' + className; + + return newClassName; + }, [ className ]); + + return ; +} diff --git a/src/layout/grid/NitroLayoutGrid.types.ts b/src/layout/grid/NitroLayoutGrid.types.ts new file mode 100644 index 00000000..537d9003 --- /dev/null +++ b/src/layout/grid/NitroLayoutGrid.types.ts @@ -0,0 +1,6 @@ +import { NitroLayoutBaseProps } from '../base'; + +export interface NitroLayoutGridProps extends NitroLayoutBaseProps +{ + +} diff --git a/src/layout/grid/column/NitroLayoutGridColumn.tsx b/src/layout/grid/column/NitroLayoutGridColumn.tsx new file mode 100644 index 00000000..f169ca09 --- /dev/null +++ b/src/layout/grid/column/NitroLayoutGridColumn.tsx @@ -0,0 +1,19 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutFlexColumn } from '../../flex-column/NitroLayoutFlexColumn'; +import { NitroLayoutGridColumnProps } from './NitroLayoutGridColumn.types'; + +export const NitroLayoutGridColumn: FC = props => +{ + const { className = '', size = 12, gap = 3, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = `g-col-${ size }`; + + if(className && className.length) newClassName += ' ' + className; + + return newClassName; + }, [ className, size ]); + + return +} diff --git a/src/layout/grid/column/NitroLayoutGridColumn.types.ts b/src/layout/grid/column/NitroLayoutGridColumn.types.ts new file mode 100644 index 00000000..c88c3fb0 --- /dev/null +++ b/src/layout/grid/column/NitroLayoutGridColumn.types.ts @@ -0,0 +1,8 @@ +import { NitroLayoutColumns, NitroLayoutSpacing } from '../../common'; +import { NitroLayoutFlexColumnProps } from '../../flex-column/NitroLayoutFlexColumn.types'; + +export interface NitroLayoutGridColumnProps extends NitroLayoutFlexColumnProps +{ + size?: NitroLayoutColumns; + gap?: NitroLayoutSpacing; +} diff --git a/src/layout/grid/column/index.ts b/src/layout/grid/column/index.ts new file mode 100644 index 00000000..a613fa34 --- /dev/null +++ b/src/layout/grid/column/index.ts @@ -0,0 +1,2 @@ +export * from './NitroLayoutGridColumn'; +export * from './NitroLayoutGridColumn.types'; diff --git a/src/layout/grid/index.ts b/src/layout/grid/index.ts new file mode 100644 index 00000000..48709bda --- /dev/null +++ b/src/layout/grid/index.ts @@ -0,0 +1,3 @@ +export * from './column'; +export * from './NitroLayoutGrid'; +export * from './NitroLayoutGrid.types'; diff --git a/src/layout/index.ts b/src/layout/index.ts index 81e87964..2859e2a3 100644 --- a/src/layout/index.ts +++ b/src/layout/index.ts @@ -1,6 +1,12 @@ +export * from './button'; export * from './card'; +export * from './common'; export * from './draggable-window'; +export * from './flex'; +export * from './flex-column'; export * from './gift-card'; +export * from './grid'; +export * from './loading-habbos'; export * from './loading-spinner'; export * from './mini-camera'; export * from './notification-alert'; diff --git a/src/layout/loading-habbos/index.ts b/src/layout/loading-habbos/index.ts new file mode 100644 index 00000000..2b36c9c4 --- /dev/null +++ b/src/layout/loading-habbos/index.ts @@ -0,0 +1 @@ +export * from './LoadingHabbosView'; diff --git a/src/views/achievements/AchievementsView.scss b/src/views/achievements/AchievementsView.scss index fa6343fb..f9f69f5d 100644 --- a/src/views/achievements/AchievementsView.scss +++ b/src/views/achievements/AchievementsView.scss @@ -1,6 +1,7 @@ .nitro-achievements { - width: 650px; - + width: $achievement-width; + height: $achievement-height; + .score { border-color: $grid-border-color !important; background-color: $grid-bg-color; diff --git a/src/views/avatar-editor/AvatarEditorView.scss b/src/views/avatar-editor/AvatarEditorView.scss index 8c2f6b0d..d0704723 100644 --- a/src/views/avatar-editor/AvatarEditorView.scss +++ b/src/views/avatar-editor/AvatarEditorView.scss @@ -1,10 +1,6 @@ .nitro-avatar-editor { - width: 620px; - - .content-area { - min-height: 300px; - height: 300px; - } + width: $avatar-editor-width; + height: $avatar-editor-height; .category-item { height: 40px; @@ -82,6 +78,37 @@ .wardrobe-grid { + .grid-item { + height: 140px; + max-height: 140px; + background-color: $ghost; + + &:after { + position: absolute; + content: ''; + top: 75%; + bottom: 0; + left: 0; + right: 0; + border-radius: 50%; + background-color: $gray-chateau; + box-shadow: 0 0 8px 2px rgba($white,.6); + transform: scale(2); + } + + .avatar-image { + position: absolute; + bottom: 0; + background-position-y: -23px !important; + z-index: 4; + } + + .figure-button-container { + background-color: $gray-chateau; + z-index: 3; + } + } + .grid-item-container { height: 142px !important; max-height: 142px !important; diff --git a/src/views/avatar-editor/views/figure-set/AvatarEditorFigureSetView.tsx b/src/views/avatar-editor/views/figure-set/AvatarEditorFigureSetView.tsx index c97fffdd..f664453c 100644 --- a/src/views/avatar-editor/views/figure-set/AvatarEditorFigureSetView.tsx +++ b/src/views/avatar-editor/views/figure-set/AvatarEditorFigureSetView.tsx @@ -1,6 +1,5 @@ import { FC, useCallback } from 'react'; import { NitroCardGridView } from '../../../../layout/card/grid/NitroCardGridView'; -import { NitroCardGridThemes } from '../../../../layout/card/grid/NitroCardGridView.types'; import { AvatarEditorGridPartItem } from '../../common/AvatarEditorGridPartItem'; import { AvatarEditorFigureSetItemView } from '../figure-set-item/AvatarEditorFigureSetItemView'; import { AvatarEditorFigureSetViewProps } from './AvatarEditorFigureSetView.types'; @@ -23,7 +22,7 @@ export const AvatarEditorFigureSetView: FC = pro }, [ model, category, setMaxPaletteCount ]); return ( - + { (category.parts.length > 0) && category.parts.map((item, index) => { return ; diff --git a/src/views/avatar-editor/views/model/AvatarEditorModelView.tsx b/src/views/avatar-editor/views/model/AvatarEditorModelView.tsx index 68e1645b..7bce299c 100644 --- a/src/views/avatar-editor/views/model/AvatarEditorModelView.tsx +++ b/src/views/avatar-editor/views/model/AvatarEditorModelView.tsx @@ -71,7 +71,7 @@ export const AvatarEditorModelView: FC = props =>
-
+
{ (maxPaletteCount >= 1) && } { (maxPaletteCount === 2) && diff --git a/src/views/avatar-editor/views/palette-set/AvatarEditorPaletteSetView.tsx b/src/views/avatar-editor/views/palette-set/AvatarEditorPaletteSetView.tsx index 65c2968f..8b32c044 100644 --- a/src/views/avatar-editor/views/palette-set/AvatarEditorPaletteSetView.tsx +++ b/src/views/avatar-editor/views/palette-set/AvatarEditorPaletteSetView.tsx @@ -1,6 +1,5 @@ import { FC, useCallback } from 'react'; import { NitroCardGridView } from '../../../../layout/card/grid/NitroCardGridView'; -import { NitroCardGridThemes } from '../../../../layout/card/grid/NitroCardGridView.types'; import { AvatarEditorGridColorItem } from '../../common/AvatarEditorGridColorItem'; import { AvatarEditorPaletteSetItem } from '../palette-set-item/AvatarEditorPaletteSetItem'; import { AvatarEditorPaletteSetViewProps } from './AvatarEditorPaletteSetView.types'; @@ -19,7 +18,7 @@ export const AvatarEditorPaletteSetView: FC = p }, [ model, category, paletteSet, paletteIndex ]); return ( - + { (paletteSet.length > 0) && paletteSet.map((item, index) => { return selectColor(item) } />; diff --git a/src/views/avatar-editor/views/wardrobe/AvatarEditorWardrobeView.tsx b/src/views/avatar-editor/views/wardrobe/AvatarEditorWardrobeView.tsx index fd0e756b..f6c4e68d 100644 --- a/src/views/avatar-editor/views/wardrobe/AvatarEditorWardrobeView.tsx +++ b/src/views/avatar-editor/views/wardrobe/AvatarEditorWardrobeView.tsx @@ -5,7 +5,6 @@ import { GetAvatarRenderManager, GetSessionDataManager } from '../../../../api'; import { SendMessageHook } from '../../../../hooks'; import { NitroCardGridItemView } from '../../../../layout/card/grid/item/NitroCardGridItemView'; import { NitroCardGridView } from '../../../../layout/card/grid/NitroCardGridView'; -import { NitroCardGridThemes } from '../../../../layout/card/grid/NitroCardGridView.types'; import { AvatarImageView } from '../../../shared/avatar-image/AvatarImageView'; import { CurrencyIcon } from '../../../shared/currency-icon/CurrencyIcon'; import { AvatarEditorWardrobeViewProps } from './AvatarEditorWardrobeView.types'; @@ -68,7 +67,7 @@ export const AvatarEditorWardrobeView: FC = props return (
- + { figures }
diff --git a/src/views/catalog/CatalogView.scss b/src/views/catalog/CatalogView.scss index 4061767a..ec71c0ad 100644 --- a/src/views/catalog/CatalogView.scss +++ b/src/views/catalog/CatalogView.scss @@ -1,11 +1,6 @@ .nitro-catalog { - width: 620px; - - .content-area { - min-height: 350px; - height: 350px; - resize: vertical; - } + width: $catalog-width; + height: $catalog-height; font[size="16"] { font-size: 20px; 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/common/AttemptCatalogPlacement.ts b/src/views/catalog/common/AttemptCatalogPlacement.ts new file mode 100644 index 00000000..af342ee3 --- /dev/null +++ b/src/views/catalog/common/AttemptCatalogPlacement.ts @@ -0,0 +1,30 @@ +import { CatalogPageMessageOfferData, RoomObjectCategory, RoomObjectPlacementSource } from '@nitrots/nitro-renderer'; +import { GetRoomEngine } from '../../../api'; +import { IsCatalogOfferDraggable } from './IsCatalogOfferDraggable'; +import { ProductTypeEnum } from './ProductTypeEnum'; + +export const AttemptCatalogPlacement = (offer: CatalogPageMessageOfferData) => +{ + if(!IsCatalogOfferDraggable(offer)) return; + + const product = offer.products[0]; + + let category: number = -1; + + switch(product.productType) + { + case ProductTypeEnum.FLOOR: + category = RoomObjectCategory.FLOOR; + break; + case ProductTypeEnum.WALL: + category = RoomObjectCategory.WALL; + break; + } + + if(category === -1) return; + + if(GetRoomEngine().processRoomObjectPlacement(RoomObjectPlacementSource.CATALOG, -(offer.offerId), category, product.furniClassId, (product.extraParam) ? product.extraParam.toString() : null)) + { + + } +} diff --git a/src/views/catalog/common/GetProuductIconUrl.ts b/src/views/catalog/common/GetProuductIconUrl.ts new file mode 100644 index 00000000..c775dd37 --- /dev/null +++ b/src/views/catalog/common/GetProuductIconUrl.ts @@ -0,0 +1,47 @@ +import { FurnitureType } from '@nitrots/nitro-renderer'; +import { GetConfiguration, GetRoomEngine, GetSessionDataManager } from '../../../api'; + +export const GetProductIconUrl = (furniClassId: number, productType: string, customParams: string = null) => +{ + switch(productType.toUpperCase()) + { + case FurnitureType.BADGE: + return GetSessionDataManager().getBadgeUrl(customParams); + case FurnitureType.ROBOT: + return undefined; + case FurnitureType.FLOOR: + return GetRoomEngine().getFurnitureFloorIconUrl(furniClassId); + case FurnitureType.WALL: { + const furniData = GetSessionDataManager().getWallItemData(furniClassId); + + let iconName = ''; + + if(furniData) + { + switch(furniData.className) + { + case 'floor': + iconName = [ 'th', furniData.className, customParams ].join('_'); + break; + case 'wallpaper': + iconName = [ 'th', 'wall', customParams ].join('_'); + break; + case 'landscape': + iconName = [ 'th', furniData.className, customParams.replace('.', '_'), '001' ].join('_'); + break; + } + + if(iconName !== '') + { + const assetUrl = GetConfiguration('catalog.asset.url'); + + return `${ assetUrl }/${ iconName }.png`; + } + } + + return GetRoomEngine().getFurnitureWallIconUrl(furniClassId, customParams); + } + } + + return null; +} diff --git a/src/views/catalog/common/IsCatalogOfferDraggable.ts b/src/views/catalog/common/IsCatalogOfferDraggable.ts new file mode 100644 index 00000000..174ce4d0 --- /dev/null +++ b/src/views/catalog/common/IsCatalogOfferDraggable.ts @@ -0,0 +1,8 @@ +import { CatalogPageMessageOfferData, RoomControllerLevel } from '@nitrots/nitro-renderer'; +import { GetRoomSession } from '../../../api'; +import { ProductTypeEnum } from './ProductTypeEnum'; + +export const IsCatalogOfferDraggable = (offer: CatalogPageMessageOfferData) => +{ + return ((GetRoomSession().isRoomOwner || (GetRoomSession().isGuildRoom && (GetRoomSession().controllerLevel >= RoomControllerLevel.GUILD_MEMBER))) && (offer.products.length === 1) && (offer.products[0].productType !== ProductTypeEnum.EFFECT) && (offer.products[0].productType !== ProductTypeEnum.HABBO_CLUB)) +} diff --git a/src/views/catalog/views/CatalogViews.scss b/src/views/catalog/views/CatalogViews.scss index 0a5f6295..f6973ade 100644 --- a/src/views/catalog/views/CatalogViews.scss +++ b/src/views/catalog/views/CatalogViews.scss @@ -1,5 +1,4 @@ @import './catalog-icon/CatalogIconView'; +@import './gift/CatalogGiftView'; @import './navigation/CatalogNavigationView'; @import './page/CatalogPageView'; -@import './search/CatalogSearchView'; -@import './gift/CatalogGiftView'; diff --git a/src/views/catalog/views/gift/CatalogGiftView.scss b/src/views/catalog/views/gift/CatalogGiftView.scss index 9f43a086..db61d248 100644 --- a/src/views/catalog/views/gift/CatalogGiftView.scss +++ b/src/views/catalog/views/gift/CatalogGiftView.scss @@ -1,4 +1,5 @@ .nitro-catalog-gift { + width: 325px; .gift-preview { width: 80px; diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.scss b/src/views/catalog/views/navigation/CatalogNavigationView.scss index e094aaac..cd6cc820 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.scss +++ b/src/views/catalog/views/navigation/CatalogNavigationView.scss @@ -1,11 +1,21 @@ -.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; + } } } - -@import './item/CatalogNavigationItemView'; -@import './set/CatalogNavigationSetView'; 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.scss b/src/views/catalog/views/navigation/item/CatalogNavigationItemView.scss deleted file mode 100644 index b5adfc1c..00000000 --- a/src/views/catalog/views/navigation/item/CatalogNavigationItemView.scss +++ /dev/null @@ -1,18 +0,0 @@ -.catalog-navigation-item-container { - - .catalog-navigation-item { - font-size: $font-size-sm; - border-radius: $border-radius; - - i.fas { - color: $black; - font-size: 10px; - padding: 1px; - } - - &.active { - padding: 1px 2px; - background-color: $grid-active-bg-color; - } - } -} 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.scss b/src/views/catalog/views/navigation/set/CatalogNavigationSetView.scss deleted file mode 100644 index 56d8034c..00000000 --- a/src/views/catalog/views/navigation/set/CatalogNavigationSetView.scss +++ /dev/null @@ -1,14 +0,0 @@ -.catalog-navigation-set-container { - - .catalog-navigation-set-container { - padding-left: 5px; - - .catalog-navigation-item-container { - padding-right: 0px !important; - } - } - - > :last-child { - padding-bottom: 0px !important; - } -} 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/page-details/CatalogPageDetailsView.tsx b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx new file mode 100644 index 00000000..390aed62 --- /dev/null +++ b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx @@ -0,0 +1,19 @@ +import { FC } from 'react'; +import { GetCatalogPageImage, GetCatalogPageText } from '../../common/CatalogUtilities'; +import { CatalogPageDetailsViewProps } from './CatalogPageDetailsView.types'; + +export const CatalogPageDetailsView: FC = props => +{ + const { pageParser = null } = props; + + if(!pageParser) return null; + + const imageUrl = GetCatalogPageImage(pageParser, 1); + + return ( +
+ { imageUrl && } +
+
+ ); +} diff --git a/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts b/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts new file mode 100644 index 00000000..a02c3b6c --- /dev/null +++ b/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts @@ -0,0 +1,6 @@ +import { CatalogPageMessageParser } from '@nitrots/nitro-renderer'; + +export interface CatalogPageDetailsViewProps +{ + pageParser: CatalogPageMessageParser; +} diff --git a/src/views/catalog/views/page/CatalogPageView.scss b/src/views/catalog/views/page/CatalogPageView.scss index 7a00d29e..7a24edf7 100644 --- a/src/views/catalog/views/page/CatalogPageView.scss +++ b/src/views/catalog/views/page/CatalogPageView.scss @@ -1,6 +1,2 @@ @import './layout/CatalogLayout'; -@import './offer/CatalogPageOfferView'; -@import './offers/CatalogPageOffersView'; -@import './product/CatalogProductView'; @import './purchase/CatalogPurchaseView'; -@import './search-result/CatalogLayoutSearchResultView'; diff --git a/src/views/catalog/views/page/layout/CatalogLayout.scss b/src/views/catalog/views/page/layout/CatalogLayout.scss index ff111f8a..d71c9f8a 100644 --- a/src/views/catalog/views/page/layout/CatalogLayout.scss +++ b/src/views/catalog/views/page/layout/CatalogLayout.scss @@ -1,10 +1,3 @@ -@import './badge-display/CatalogLayoutBadgeDisplayView'; -@import './default/CatalogLayoutDefaultView'; @import './frontpage4/CatalogLayoutFrontpage4View'; -@import './pets/CatalogLayoutPetView'; -@import './pets3/CatalogLayoutPets3View'; -@import './single-bundle/CatalogLayoutSingleBundleView'; -@import './spaces-new/CatalogLayoutSpacesView'; -@import './trophies/CatalogLayoutTrophiesView'; -@import './vip-buy/CatalogLayoutVipBuyView'; @import './info-loyalty/CatalogLayoutInfoLoyaltyView.scss'; +@import './vip-buy/CatalogLayoutVipBuyView'; diff --git a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss deleted file mode 100644 index 1229e018..00000000 --- a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss +++ /dev/null @@ -1,7 +0,0 @@ -.nitro-catalog-layout-badge-display { - - .inventory-badge-grid { - height: 200px; - max-height: 200px; - } -} diff --git a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx index 4cb90755..1826c10a 100644 --- a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx +++ b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx @@ -1,5 +1,5 @@ import { StringDataType } from '@nitrots/nitro-renderer'; -import { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { FC, useCallback, useEffect, useState } from 'react'; import { LocalizeText } from '../../../../../../api'; import { InventoryBadgesUpdatedEvent, SetRoomPreviewerStuffDataEvent } from '../../../../../../events'; import { InventoryBadgesRequestEvent } from '../../../../../../events/inventory/InventoryBadgesRequestEvent'; @@ -7,11 +7,9 @@ import { dispatchUiEvent, useUiEvent } from '../../../../../../hooks'; import { NitroCardGridItemView } from '../../../../../../layout/card/grid/item/NitroCardGridItemView'; import { NitroCardGridView } from '../../../../../../layout/card/grid/NitroCardGridView'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; -import { GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutBadgeDisplayViewProps } from './CatalogLayoutBadgeDisplayView.types'; export const CatalogLayoutBadgeDisplayView: FC = props => @@ -32,18 +30,6 @@ export const CatalogLayoutBadgeDisplayView: FC - { - return badges.map(code => - { - return ( - setCurrentBadge(code) }> - - - ); - }); - }, [ badges, currentBadge ]); - useEffect(() => { dispatchUiEvent(new InventoryBadgesRequestEvent(InventoryBadgesRequestEvent.REQUEST_BADGES)); @@ -67,22 +53,26 @@ export const CatalogLayoutBadgeDisplayView: FC -
- -
+
+
+ +
{ LocalizeText('catalog_selectbadge') }
- - { badgeElements } + + { badges && (badges.length > 0) && badges.map(code => + { + return ( + setCurrentBadge(code) }> + + + ); + }) }
- { product && -
- -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.scss b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx index db599364..86d2bd1b 100644 --- a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx +++ b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx @@ -1,10 +1,7 @@ import { FC } from 'react'; -import { LimitedEditionCompletePlateView } from '../../../../../shared/limited-edition/complete-plate/LimitedEditionCompletePlateView'; -import { GetCatalogPageImage, GetCatalogPageText, GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutDefaultViewProps } from './CatalogLayoutDefaultView.types'; export const CatalogLayoutDefaultView: FC = props => @@ -17,24 +14,12 @@ export const CatalogLayoutDefaultView: FC = props return (
-
+
- { !product && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { product && -
- - { product.uniqueLimitedItem && - } -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.scss b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.scss deleted file mode 100644 index 268769fb..00000000 --- a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.scss +++ /dev/null @@ -1,10 +0,0 @@ -.nitro-catalog-layout-pets { - - .color-button { - position: absolute; - left: 5px; - bottom: 5px; - } - - @import './name-approval/CatalogPetNameApprovalView'; -} diff --git a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx index f70afb5d..edf293c2 100644 --- a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx +++ b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx @@ -2,11 +2,13 @@ import { ColorConverter, GetSellablePetPalettesComposer, SellablePetPaletteData import { FC, useEffect, useMemo, useState } from 'react'; import { GetProductDataForLocalization, LocalizeText } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks/messages/message-event'; +import { NitroCardGridItemView, NitroCardGridView } from '../../../../../../layout'; import { PetImageView } from '../../../../../shared/pet-image/PetImageView'; -import { GetCatalogPageImage, GetCatalogPageText, GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities'; +import { GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogActions } from '../../../../reducers/CatalogReducer'; import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; +import { CatalogPageDetailsView } from '../../../page-details/CatalogPageDetailsView'; import { CatalogLayoutPetViewProps } from './CatalogLayoutPetView.types'; import { CatalogLayoutPetPurchaseView } from './purchase/CatalogLayoutPetPurchaseView'; @@ -139,44 +141,40 @@ export const CatalogLayoutPetView: FC = props => if(!activeOffer) return null; return ( -
-
-
- { colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) => - { - return
-
setSelectedColorIndex(index) }> -
-
; - })} +
+
+ { !colorsShowing && (sellablePalettes.length > 0) && sellablePalettes.map((palette, index) => { - return
-
setSelectedPaletteIndex(index) }> + return ( + setSelectedPaletteIndex(index) }> -
-
; - }) } -
+ + ); + })} + { colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) => + { + return ( + setSelectedColorIndex(index) } /> + ); + })} + +
+
+ { (petIndex === -1) && + } + { (petIndex >= 0) && + <> + + { (petIndex > -1 && petIndex <= 7) && + } + +
{ petBreedName }
+ + }
- { (petIndex === -1) && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { (petIndex >= 0) && -
- - { (petIndex > -1 && petIndex <= 7) && - } - -
{ petBreedName }
- -
}
); } diff --git a/src/views/catalog/views/page/layout/pets/name-approval/CatalogPetNameApprovalView.scss b/src/views/catalog/views/page/layout/pets/name-approval/CatalogPetNameApprovalView.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx b/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx index 9f1ebb31..c7b02518 100644 --- a/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx +++ b/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx @@ -6,6 +6,7 @@ import { useUiEvent } from '../../../../../../../hooks/events/ui/ui-event'; import { SendMessageHook } from '../../../../../../../hooks/messages/message-event'; import { CurrencyIcon } from '../../../../../../shared/currency-icon/CurrencyIcon'; import { CatalogPurchaseButtonView } from '../../../purchase/purchase-button/CatalogPurchaseButtonView'; +import { CatalogPurchaseGiftButtonView } from '../../../purchase/purchase-gift-button/CatalogPurchaseGiftButtonView'; import { CatalogPetNameApprovalView } from '../name-approval/CatalogPetNameApprovalView'; import { CatalogLayoutPetPurchaseViewProps } from './CatalogLayoutPetPurchaseView.types'; @@ -59,6 +60,8 @@ export const CatalogLayoutPetPurchaseView: FC
+ { offer.giftable && + }
diff --git a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss deleted file mode 100644 index 1b85077d..00000000 --- a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss +++ /dev/null @@ -1,2 +0,0 @@ -.nitro-catalog-layout-pets2 { -} diff --git a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx index 3e901711..06dd970c 100644 --- a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx +++ b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx @@ -1,23 +1,8 @@ import { FC } from 'react'; -import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; +import { CatalogLayoutPets3View } from '../pets3/CatalogLayoutPets3View'; import { CatalogLayoutPets2ViewProps } from './CatalogLayoutPets2View.types'; export const CatalogLayoutPets2View: FC = props => { - const { pageParser = null } = props; - - return ( -
-
-
-
- -
-
{ GetCatalogPageText(pageParser, 1) }
-
-
- {GetCatalogPageText(pageParser, 3) &&
} -
-
- ); + return } diff --git a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss deleted file mode 100644 index 2f2bc31c..00000000 --- a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss +++ /dev/null @@ -1,2 +0,0 @@ -.nitro-catalog-layout-pets3 { -} diff --git a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx index 23fa4048..94ab0a81 100644 --- a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx +++ b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx @@ -5,18 +5,24 @@ import { CatalogLayoutPets3ViewProps } from './CatalogLayoutPets3View.types'; export const CatalogLayoutPets3View: FC = props => { const { pageParser = null } = props; + + const imageUrl = GetCatalogPageImage(pageParser, 1); return ( -
-
-
-
- +
+
+
+
+ { imageUrl && } +
+
+
+
+
+
+
-
{ GetCatalogPageText(pageParser, 1) }
-
- {GetCatalogPageText(pageParser, 3) &&
}
); diff --git a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss deleted file mode 100644 index 664041a9..00000000 --- a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss +++ /dev/null @@ -1,6 +0,0 @@ -.nitro-catalog-layout-single-bundle { - - .single-bundle-items-container { - - } -} diff --git a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx index c85baeae..bab6711f 100644 --- a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx +++ b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx @@ -1,6 +1,7 @@ import { FC } from 'react'; -import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; +import { NitroCardGridView } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; +import { CatalogPageDetailsView } from '../../../page-details/CatalogPageDetailsView'; import { CatalogProductView } from '../../product/CatalogProductView'; import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; import { CatalogLayoutSingleBundleViewProps } from './CatalogLayoutSingleBundleView.types'; @@ -12,20 +13,17 @@ export const CatalogLayoutSingleBundleView: FC -
-
+
+
+ { activeOffer && activeOffer.products && (activeOffer.products.length > 0) && activeOffer.products.map((product, index) => { return }) } -
+
-
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
+
+ { activeOffer && }
diff --git a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss deleted file mode 100644 index ce1e1c03..00000000 --- a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss +++ /dev/null @@ -1,3 +0,0 @@ -.nitro-catalog-layout-spaces { - -} diff --git a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx index c2c15a26..65da4622 100644 --- a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx +++ b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx @@ -1,12 +1,10 @@ import { CatalogPageMessageOfferData, IFurnitureData } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; import { GetSessionDataManager, LocalizeText } from '../../../../../../api'; -import { GetCatalogPageImage, GetCatalogPageText, GetOfferName } from '../../../../common/CatalogUtilities'; import { ProductTypeEnum } from '../../../../common/ProductTypeEnum'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutSpacesViewProps } from './CatalogLayoutSpacesView.types'; export const CatalogLayoutSpacesView: FC = props => @@ -68,9 +66,9 @@ export const CatalogLayoutSpacesView: FC = props = const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
-
+
+
+
{ groupNames.map((name, index) => { return @@ -78,19 +76,9 @@ export const CatalogLayoutSpacesView: FC = props =
- { !product && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { product && -
- -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss deleted file mode 100644 index 58637ed9..00000000 --- a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss +++ /dev/null @@ -1,8 +0,0 @@ -.nitro-catalog-layout-trophies { - - textarea { - height: 119px; - resize: none; - } - -} diff --git a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx index 471001a1..03379cf0 100644 --- a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx +++ b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx @@ -1,9 +1,7 @@ import { FC, useState } from 'react'; -import { GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutTrophiesViewProps } from './CatalogLayoutTrophiesView.types'; export const CatalogLayoutTrophiesView: FC = props => @@ -16,19 +14,14 @@ export const CatalogLayoutTrophiesView: FC = pro const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
+
+
-
- -
+