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 ae6999e5..9d050bd9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -125,7 +125,8 @@ 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 5b3d1c06..8517fcce 100644 --- a/src/assets/styles/icons.scss +++ b/src/assets/styles/icons.scss @@ -10,11 +10,11 @@ background-position: center; &.icon-nitro-light { - background-image: url('../images/nitro/nitro-n-light.svg'); + background-image: url("../images/nitro/nitro-n-light.svg"); } &.icon-nitro-dark { - background-image: url('../images/nitro/nitro-n-dark.svg'); + background-image: url("../images/nitro/nitro-n-dark.svg"); } &.icon-nitro-light, @@ -24,686 +24,697 @@ } &.icon-catalog { - background-image: url('../images/toolbar/icons/catalog.png'); + background-image: url("../images/toolbar/icons/catalog.png"); width: 37px; height: 36px; } &.icon-rooms { - background-image: url('../images/toolbar/icons/rooms.png'); + background-image: url("../images/toolbar/icons/rooms.png"); width: 44px; height: 30px; } &.icon-house { - background-image: url('../images/toolbar/icons/house.png'); + background-image: url("../images/toolbar/icons/house.png"); height: 30px; width: 32px; } &.icon-inventory { - background-image: url('../images/toolbar/icons/inventory.png'); + background-image: url("../images/toolbar/icons/inventory.png"); height: 41px; width: 44px; } &.icon-modtools { - background-image: url('../images/toolbar/icons/modtools.png'); + background-image: url("../images/toolbar/icons/modtools.png"); height: 34px; width: 29px; } &.icon-friendall { - background-image: url('../images/toolbar/icons/friend_all.png'); + background-image: url("../images/toolbar/icons/friend_all.png"); height: 33px; width: 32px; } &.icon-friendsearch { - background-image: url('../images/toolbar/icons/friend_search.png'); + background-image: url("../images/toolbar/icons/friend_search.png"); height: 33px; width: 29px; } &.icon-sendmessage { - background-image: url('../images/toolbar/icons/sendmessage.png'); + background-image: url("../images/toolbar/icons/sendmessage.png"); width: 20px; height: 21px; } &.icon-me-talents { - background-image: url('../images/toolbar/icons/me-menu/talents.png'); + background-image: url("../images/toolbar/icons/me-menu/talents.png"); width: 32px; height: 30px; } &.icon-me-helper-tool { - background-image: url('../images/toolbar/icons/me-menu/helper-tool.png'); + background-image: url("../images/toolbar/icons/me-menu/helper-tool.png"); width: 32px; height: 30px; } &.icon-me-profile { - background-image: url('../images/toolbar/icons/me-menu/profile.png'); + background-image: url("../images/toolbar/icons/me-menu/profile.png"); width: 32px; height: 30px; } &.icon-me-forums { - background-image: url('../images/toolbar/icons/me-menu/forums.png'); + background-image: url("../images/toolbar/icons/me-menu/forums.png"); width: 32px; height: 30px; } &.icon-me-rooms { - background-image: url('../images/toolbar/icons/me-menu/my-rooms.png'); + background-image: url("../images/toolbar/icons/me-menu/my-rooms.png"); width: 30px; height: 30px; } &.icon-me-achievements { - background-image: url('../images/toolbar/icons/me-menu/achievements.png'); + background-image: url("../images/toolbar/icons/me-menu/achievements.png"); width: 31px; height: 30px; } &.icon-me-clothing { - background-image: url('../images/toolbar/icons/me-menu/clothing.png'); + background-image: url("../images/toolbar/icons/me-menu/clothing.png"); width: 27px; height: 30px; } &.icon-me-settings { - background-image: url('../images/toolbar/icons/me-menu/cog.png'); + background-image: url("../images/toolbar/icons/me-menu/cog.png"); width: 28px; height: 34px; } &.icon-cog { - background: url('../images/icons/icon_cog.png'); + background: url("../images/icons/icon_cog.png"); width: 14px; height: 15px; } &.icon-help { - background: url('../images/icons/help.png'); + background: url("../images/icons/help.png"); width: 13px; height: 23px; } &.icon-joinroom { - background-image: url('../images/toolbar/icons/joinroom.png'); + background-image: url("../images/toolbar/icons/joinroom.png"); width: 21px; height: 21px; } &.icon-habbo { - background-image: url('../images/toolbar/icons/habbo.png'); + background-image: url("../images/toolbar/icons/habbo.png"); width: 28px; height: 28px; } &.icon-camera { - background-image: url('../images/toolbar/icons/camera.png'); + background-image: url("../images/toolbar/icons/camera.png"); width: 38px; height: 45px; } &.icon-message { - background-image: url('../images/toolbar/icons/message.png'); + background-image: url("../images/toolbar/icons/message.png"); width: 36px; height: 32px; &.is-unseen { - background-image: url('../images/toolbar/icons/message_unsee.gif'); + background-image: url("../images/toolbar/icons/message_unsee.gif"); } } &.icon-deny { - background: url('../images/icons/deny.png'); + background: url("../images/icons/deny.png"); width: 13px; height: 14px; } &.icon-accept { - background: url('../images/icons/accept.png'); + background: url("../images/icons/accept.png"); width: 13px; height: 14px; } &.icon-wired-trigger { - background-image: url('../images/wired/icon_trigger.png'); + background-image: url("../images/wired/icon_trigger.png"); width: 13px; height: 14px; } &.icon-wired-condition { - background-image: url('../images/wired/icon_condition.png'); + background-image: url("../images/wired/icon_condition.png"); width: 13px; height: 14px; } &.icon-wired-action { - background-image: url('../images/wired/icon_action.png'); + background-image: url("../images/wired/icon_action.png"); width: 13px; height: 14px; } &.arrow-left-icon { - background-image: url('../images/avatareditor/arrow-left-icon.png'); + background-image: url("../images/avatareditor/arrow-left-icon.png"); width: 28px; height: 21px; } &.arrow-right-icon { - background-image: url('../images/avatareditor/arrow-right-icon.png'); + background-image: url("../images/avatareditor/arrow-right-icon.png"); width: 28px; height: 21px; } &.clear-icon { - background-image: url('../images/avatareditor/clear-icon.png'); + background-image: url("../images/avatareditor/clear-icon.png"); width: 27px; height: 27px; } &.ca-icon { - background-image: url('../images/avatareditor/ca-icon.png'); + background-image: url("../images/avatareditor/ca-icon.png"); width: 25px; height: 25px; &.selected { - background-image: url('../images/avatareditor/ca-selected-icon.png'); + background-image: url("../images/avatareditor/ca-selected-icon.png"); } } &.cc-icon { - background-image: url('../images/avatareditor/cc-icon.png'); + background-image: url("../images/avatareditor/cc-icon.png"); width: 31px; height: 29px; &.selected { - background-image: url('../images/avatareditor/cc-selected-icon.png'); + background-image: url("../images/avatareditor/cc-selected-icon.png"); } } &.ch-icon { - background-image: url('../images/avatareditor/ch-icon.png'); + background-image: url("../images/avatareditor/ch-icon.png"); width: 29px; height: 24px; &.selected { - background-image: url('../images/avatareditor/ch-selected-icon.png'); + background-image: url("../images/avatareditor/ch-selected-icon.png"); } } &.cp-icon { - background-image: url('../images/avatareditor/cp-icon.png'); + background-image: url("../images/avatareditor/cp-icon.png"); width: 30px; height: 24px; &.selected { - background-image: url('../images/avatareditor/cp-selected-icon.png'); + background-image: url("../images/avatareditor/cp-selected-icon.png"); } } &.ea-icon { - background-image: url('../images/avatareditor/ea-icon.png'); + background-image: url("../images/avatareditor/ea-icon.png"); width: 35px; height: 16px; &.selected { - background-image: url('../images/avatareditor/ea-selected-icon.png'); + background-image: url("../images/avatareditor/ea-selected-icon.png"); } } &.fa-icon { - background-image: url('../images/avatareditor/fa-icon.png'); + background-image: url("../images/avatareditor/fa-icon.png"); width: 27px; height: 20px; &.selected { - background-image: url('../images/avatareditor/fa-selected-icon.png'); + background-image: url("../images/avatareditor/fa-selected-icon.png"); } } &.female-icon { - background-image: url('../images/avatareditor/female-icon.png'); + background-image: url("../images/avatareditor/female-icon.png"); width: 18px; height: 27px; &.selected { - background-image: url('../images/avatareditor/female-selected-icon.png'); + background-image: url("../images/avatareditor/female-selected-icon.png"); } } &.ha-icon { - background-image: url('../images/avatareditor/ha-icon.png'); + background-image: url("../images/avatareditor/ha-icon.png"); width: 25px; height: 22px; &.selected { - background-image: url('../images/avatareditor/ha-selected-icon.png'); + background-image: url("../images/avatareditor/ha-selected-icon.png"); } } &.he-icon { - background-image: url('../images/avatareditor/he-icon.png'); + background-image: url("../images/avatareditor/he-icon.png"); width: 31px; height: 27px; &.selected { - background-image: url('../images/avatareditor/he-selected-icon.png'); + background-image: url("../images/avatareditor/he-selected-icon.png"); } } &.hr-icon { - background-image: url('../images/avatareditor/hr-icon.png'); + background-image: url("../images/avatareditor/hr-icon.png"); width: 29px; height: 25px; &.selected { - background-image: url('../images/avatareditor/hr-selected-icon.png'); + background-image: url("../images/avatareditor/hr-selected-icon.png"); } } &.lg-icon { - background-image: url('../images/avatareditor/lg-icon.png'); + background-image: url("../images/avatareditor/lg-icon.png"); width: 19px; height: 20px; &.selected { - background-image: url('../images/avatareditor/lg-selected-icon.png'); + background-image: url("../images/avatareditor/lg-selected-icon.png"); } } &.loading-icon { - background-image: url('../images/icons/loading-icon.png'); + background-image: url("../images/icons/loading-icon.png"); width: 17px; height: 21px; } &.male-icon { - background-image: url('../images/avatareditor/male-icon.png'); + background-image: url("../images/avatareditor/male-icon.png"); width: 21px; height: 21px; &.selected { - background-image: url('../images/avatareditor/male-selected-icon.png'); + background-image: url("../images/avatareditor/male-selected-icon.png"); } } &.sh-icon { - background-image: url('../images/avatareditor/sh-icon.png'); + background-image: url("../images/avatareditor/sh-icon.png"); width: 37px; height: 10px; &.selected { - background-image: url('../images/avatareditor/sh-selected-icon.png'); + background-image: url("../images/avatareditor/sh-selected-icon.png"); } } &.wa-icon { - background-image: url('../images/avatareditor/wa-icon.png'); + background-image: url("../images/avatareditor/wa-icon.png"); width: 36px; height: 18px; &.selected { - background-image: url('../images/avatareditor/wa-selected-icon.png'); + background-image: url("../images/avatareditor/wa-selected-icon.png"); } } &.sellable-icon { - background-image: url('../images/avatareditor/sellable-icon.png'); + background-image: url("../images/avatareditor/sellable-icon.png"); width: 17px; height: 15px; } &.chatstyles-icon { - background-image: url('../images/chat/styles-icon.png'); + background-image: url("../images/chat/styles-icon.png"); width: 17px; height: 19px; } &.pencil-icon { - background-image: url('../images/infostand/pencil-icon.png'); + background-image: url("../images/infostand/pencil-icon.png"); width: 17px; height: 18px; } &.trade-locked-icon { - background-image: url('../images/inventory/trading/locked-icon.png'); + background-image: url("../images/inventory/trading/locked-icon.png"); width: 29px; height: 43px; } &.trade-unlocked-icon { - background-image: url('../images/inventory/trading/unlocked-icon.png'); + background-image: url("../images/inventory/trading/unlocked-icon.png"); width: 29px; height: 43px; } &.modtool-room-icon { - background-image: url('../images/modtool/room.png'); + background-image: url("../images/modtool/room.png"); width: 20px; height: 15px; } &.modtool-chatlog-icon { - background-image: url('../images/modtool/chatlog.gif'); + background-image: url("../images/modtool/chatlog.gif"); width: 20px; height: 15px; } - &.modtool-user-icon{ - background-image: url('../images/modtool/user.gif'); + &.modtool-user-icon { + background-image: url("../images/modtool/user.gif"); width: 20px; height: 15px; } &.modtool-reports-icon { - background-image: url('../images/modtool/reports.png'); + background-image: url("../images/modtool/reports.png"); width: 20px; height: 15px; } &.modtool-wrench-icon { - background-image: url('../images/modtool/wrench.gif'); + background-image: url("../images/modtool/wrench.gif"); width: 20px; height: 15px; } &.modtool-key-icon { - background-image: url('../images/modtool/key.gif'); + background-image: url("../images/modtool/key.gif"); width: 20px; height: 15px; } &.icon-catalogue-hc_small { - background-image: url('../images/catalog/hc_small.png'); + background-image: url("../images/catalog/hc_small.png"); height: 17px; width: 31px; } &.icon-catalogue-hc_big { - background: url('../images/catalog/hc_big.png'); + background: url("../images/catalog/hc_big.png"); width: 68px; height: 40px; } &.icon-sign-exclamation { - background: url('../images/icons/sign-exclamation.png'); + background: url("../images/icons/sign-exclamation.png"); width: 7px; height: 17px; } &.icon-sign-heart { - background: url('../images/icons/sign-heart.png'); + background: url("../images/icons/sign-heart.png"); width: 15px; height: 13px; } &.icon-sign-red { - background: url('../images/icons/sign-red.png'); + background: url("../images/icons/sign-red.png"); width: 11px; height: 19px; } &.icon-sign-yellow { - background: url('../images/icons/sign-yellow.png'); + background: url("../images/icons/sign-yellow.png"); width: 11px; height: 19px; } &.icon-sign-skull { - background: url('../images/icons/sign-skull.png'); + background: url("../images/icons/sign-skull.png"); width: 12px; height: 12px; } &.icon-sign-smile { - background: url('../images/icons/sign-smile.png'); + background: url("../images/icons/sign-smile.png"); width: 7px; height: 14px; } - + &.icon-sign-soccer { - background: url('../images/icons/sign-soccer.png'); + background: url("../images/icons/sign-soccer.png"); width: 20px; height: 20px; } - + &.icon-house-small { - background: url('../images/icons/house-small.png'); + background: url("../images/icons/house-small.png"); width: 19px; height: 14px; } &.icon-camera-small { - background: url('../images/icons/camera-small.png'); + background: url("../images/icons/camera-small.png"); width: 17px; height: 15px; } &.icon-arrows { - background: url('../images/icons/arrows.png'); + background: url("../images/icons/arrows.png"); width: 17px; height: 15px; } - + &.icon-fb-profile { - background: url('../images/toolbar/icons/friend-bar/profile.png'); + background: url("../images/toolbar/icons/friend-bar/profile.png"); width: 21px; height: 21px; } &.icon-camera-colormatrix { - background: url('../images/icons/camera-colormatrix.png'); + background: url("../images/icons/camera-colormatrix.png"); width: 32px; height: 21px; } &.icon-camera-composite { - background: url('../images/icons/camera-composite.png'); + background: url("../images/icons/camera-composite.png"); width: 32px; height: 21px; } &.icon-user-profile { - background: url('../images/icons/user-profile.png'); + background: url("../images/icons/user-profile.png"); width: 13px; height: 11px; &:hover { - background: url('../images/icons/user-profile-hover.png'); + background: url("../images/icons/user-profile-hover.png"); } } &.icon-fb-profile { - background: url('../images/toolbar/icons/friend-bar/profile.png'); + background: url("../images/toolbar/icons/friend-bar/profile.png"); width: 21px; height: 21px; } &.icon-fb-chat { - background: url('../images/toolbar/icons/friend-bar/chat.png'); + background: url("../images/toolbar/icons/friend-bar/chat.png"); width: 20px; height: 21px; } &.icon-fb-visit { - background: url('../images/toolbar/icons/friend-bar/visit.png'); + background: url("../images/toolbar/icons/friend-bar/visit.png"); width: 21px; height: 21px; } &.icon-pf-online { - background: url('../images/profile/icons/online.gif'); + background: url("../images/profile/icons/online.gif"); width: 40px; height: 16px; } &.icon-pf-offline { - background: url('../images/profile/icons/offline.png'); + background: url("../images/profile/icons/offline.png"); width: 39px; height: 16px; } &.icon-pf-tick { - background: url('../images/profile/icons/tick.png'); + background: url("../images/profile/icons/tick.png"); width: 11px; height: 10px; } &.icon-relationship-none { - background: url('../images/friendlist/icons/icon_relationship_none.png'); + background: url("../images/friendlist/icons/icon_relationship_none.png"); width: 16px; height: 14px; } &.icon-relationship-heart { - background: url('../images/profile/icons/heart.png'); + background: url("../images/profile/icons/heart.png"); width: 16px; height: 14px; } &.icon-relationship-bobba { - background: url('../images/profile/icons/bobba.png'); + background: url("../images/profile/icons/bobba.png"); width: 16px; height: 14px; } &.icon-relationship-smile { - background: url('../images/profile/icons/smile.png'); + background: url("../images/profile/icons/smile.png"); width: 16px; height: 14px; } &.icon-group-type-0 { - background: url('../images/groups/icons/grouptype_icon_0.png'); + background: url("../images/groups/icons/grouptype_icon_0.png"); width: 16px; height: 16px; } &.icon-group-type-1 { - background: url('../images/groups/icons/grouptype_icon_1.png'); + background: url("../images/groups/icons/grouptype_icon_1.png"); width: 16px; height: 16px; } &.icon-group-type-2 { - background: url('../images/groups/icons/grouptype_icon_2.png'); + background: url("../images/groups/icons/grouptype_icon_2.png"); width: 16px; height: 16px; } &.icon-group-decorate { - background: url('../images/groups/icons/group_decorate_icon.png'); + background: url("../images/groups/icons/group_decorate_icon.png"); width: 15px; height: 15px; } &.icon-group-member { - background: url('../images/groups/icons/group_icon_big_member.png'); + background: url("../images/groups/icons/group_icon_big_member.png"); width: 20px; height: 20px; } &.icon-group-admin { - background: url('../images/groups/icons/group_icon_big_admin.png'); + background: url("../images/groups/icons/group_icon_big_admin.png"); width: 20px; height: 20px; } &.icon-group-owner { - background: url('../images/groups/icons/group_icon_big_owner.png'); + background: url("../images/groups/icons/group_icon_big_owner.png"); width: 20px; height: 20px; } &.icon-group-favorite { - background: url('../images/groups/icons/group_favorite.png'); + background: url("../images/groups/icons/group_favorite.png"); width: 14px; height: 14px; } &.icon-group-not-favorite { - background: url('../images/groups/icons/group_notfavorite.png'); + background: url("../images/groups/icons/group_notfavorite.png"); width: 14px; height: 14px; } &.icon-group-small-admin { - background: url('../images/groups/icons/group_icon_admin.png'); + background: url("../images/groups/icons/group_icon_admin.png"); width: 11px; height: 13px; } &.icon-group-small-not-admin { - background: url('../images/groups/icons/group_icon_not_admin.png'); + background: url("../images/groups/icons/group_icon_not_admin.png"); width: 11px; height: 13px; } &.icon-group-small-owner { - background: url('../images/groups/icons/group_icon_small_owner.png'); + background: url("../images/groups/icons/group_icon_small_owner.png"); width: 13px; height: 13px; } &.icon-navigator-info { - background: url('../images/navigator/icons/info.png'); + background: url("../images/navigator/icons/info.png"); width: 18px; height: 18px; } &.icon-navigator-room-locked { - background: url('../images/navigator/icons/room_locked.png'); + background: url("../images/navigator/icons/room_locked.png"); width: 13px; height: 16px; } &.icon-navigator-room-password { - background: url('../images/navigator/icons/room_password.png'); + background: url("../images/navigator/icons/room_password.png"); width: 13px; height: 16px; } &.icon-navigator-room-invisible { - background: url('../images/navigator/icons/room_invisible.png'); + background: url("../images/navigator/icons/room_invisible.png"); width: 13px; height: 16px; } &.icon-navigator-room-group { - background: url('../images/navigator/icons/room_group.png'); + background: url("../images/navigator/icons/room_group.png"); width: 13px; height: 11px; } &.icon-friendlist-follow { - background: url('../images/friendlist/icons/icon_follow.png'); + background: url("../images/friendlist/icons/icon_follow.png"); width: 16px; height: 14px; } &.icon-friendlist-chat { - background: url('../images/friendlist/icons/icon_chat.png'); + background: url("../images/friendlist/icons/icon_chat.png"); width: 17px; height: 16px; } &.icon-youtube-next { - background: url('../images/room-widgets/youtube-widget/next.png'); + background: url("../images/room-widgets/youtube-widget/next.png"); width: 21px; height: 16px; } &.icon-youtube-prev { - background: url('../images/room-widgets/youtube-widget/prev.png'); + background: url("../images/room-widgets/youtube-widget/prev.png"); width: 21px; 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/events/notification-center/SimpleAlertUIEvent.ts b/src/events/notification-center/NotificationAlertEvent.ts similarity index 52% rename from src/events/notification-center/SimpleAlertUIEvent.ts rename to src/events/notification-center/NotificationAlertEvent.ts index d869d0b7..4f64acc9 100644 --- a/src/events/notification-center/SimpleAlertUIEvent.ts +++ b/src/events/notification-center/NotificationAlertEvent.ts @@ -1,29 +1,36 @@ import { NitroEvent } from '@nitrots/nitro-renderer'; -export class SimpleAlertUIEvent extends NitroEvent +export class NotificationAlertEvent extends NitroEvent { - public static ALERT: string = 'SAUE_ALERT'; + public static ALERT: string = 'NAE_ALERT'; - private _message: string; + private _messages: string[]; + private _alertType: string; private _clickUrl: string; private _clickUrlText: string; private _title: string; private _imageUrl: string; - constructor(message: string, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null) + constructor(messages: string[], alertType: string = null, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null) { - super(SimpleAlertUIEvent.ALERT); + super(NotificationAlertEvent.ALERT); - this._message = message; + this._messages = messages; + this._alertType = alertType; this._clickUrl = clickUrl; this._clickUrlText = clickUrlText; this._title = title; this._imageUrl = imageUrl; } - public get message(): string + public get messages(): string[] { - return this._message; + return this._messages; + } + + public get alertType(): string + { + return this._alertType; } public get clickUrl(): string diff --git a/src/events/notification-center/NotificationBubbleEvent.ts b/src/events/notification-center/NotificationBubbleEvent.ts index 11a343a2..55383655 100644 --- a/src/events/notification-center/NotificationBubbleEvent.ts +++ b/src/events/notification-center/NotificationBubbleEvent.ts @@ -2,7 +2,7 @@ import { NitroEvent } from '@nitrots/nitro-renderer'; export class NotificationBubbleEvent extends NitroEvent { - public static NEW_BUBBLE: string = 'NNBE_NEW_BUBBLE'; + public static NEW_BUBBLE: string = 'NBE_NEW_BUBBLE'; private _message: string; private _notificationType: string; diff --git a/src/events/notification-center/NotificationCenterAddNotificationEvent.ts b/src/events/notification-center/NotificationCenterAddNotificationEvent.ts deleted file mode 100644 index 200fda47..00000000 --- a/src/events/notification-center/NotificationCenterAddNotificationEvent.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NitroNotification } from '../../views/notification-center/common/Notification'; -import { NotificationCenterEvent } from './NotificationCenterEvent'; - -export class NotificationCenterAddNotificationEvent extends NotificationCenterEvent -{ - private _notification: NitroNotification; - - constructor(notification: NitroNotification) - { - super(NotificationCenterEvent.ADD_NOTIFICATION); - - this._notification = notification; - } - - public get notification(): NitroNotification - { - return this._notification; - } -} diff --git a/src/events/notification-center/index.ts b/src/events/notification-center/index.ts index 2951cdfb..cac7d708 100644 --- a/src/events/notification-center/index.ts +++ b/src/events/notification-center/index.ts @@ -1,4 +1,4 @@ -export * from './NotificationCenterAddNotificationEvent'; +export * from './NotificationAlertEvent'; +export * from './NotificationBubbleEvent'; export * from './NotificationCenterAlertEvent'; export * from './NotificationCenterEvent'; -export * from './SimpleAlertUIEvent'; 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/Layout.scss b/src/layout/Layout.scss index 3b613a5f..9e435e47 100644 --- a/src/layout/Layout.scss +++ b/src/layout/Layout.scss @@ -27,6 +27,7 @@ @import './loading-habbos/LoadingHabbosView'; @import './loading-spinner/LoadingSpinnerView'; @import './mini-camera/NitroLayoutMiniCameraView'; +@import './notification-alert/NotificationAlertView'; @import './notification-bubble/NotificationBubbleView'; @import './trophy/NitroLayoutTrophyView'; @import './gift-card/NitroLayoutGiftCardView'; 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 c681fd34..c56cad8c 100644 --- a/src/layout/card/content/NitroCardContentView.scss +++ b/src/layout/card/content/NitroCardContentView.scss @@ -1,20 +1,14 @@ .content-area { + height: 100%; padding-top: $container-padding-x; padding-bottom: $container-padding-x; overflow: auto; - - &.simple { - padding-left: ($container-padding-x + 25px); - padding-right: ($container-padding-x + 25px); - } } @include media-breakpoint-down(lg) { - .content-area { 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..97c17237 100644 --- a/src/layout/card/grid/NitroCardGridView.tsx +++ b/src/layout/card/grid/NitroCardGridView.tsx @@ -1,18 +1,35 @@ -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 = 0, 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 }; + + if(columns && (columns >= 1)) + { + newStyle['grid-template-columns'] = 'unset'; + 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 => return (
-
-
{ headerText }
+
+
{ headerText }
diff --git a/src/layout/common/NitroLayoutButtonSize.type.ts b/src/layout/common/NitroLayoutButtonSize.type.ts new file mode 100644 index 00000000..06e59028 --- /dev/null +++ b/src/layout/common/NitroLayoutButtonSize.type.ts @@ -0,0 +1 @@ +export type NitroLayoutButtonSize = 'sm' | 'lg'; diff --git a/src/layout/common/NitroLayoutColumns.type.ts b/src/layout/common/NitroLayoutColumns.type.ts new file mode 100644 index 00000000..242c622d --- /dev/null +++ b/src/layout/common/NitroLayoutColumns.type.ts @@ -0,0 +1 @@ +export type NitroLayoutColumns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; diff --git a/src/layout/common/NitroLayoutOverflow.type.ts b/src/layout/common/NitroLayoutOverflow.type.ts new file mode 100644 index 00000000..0ee52c0f --- /dev/null +++ b/src/layout/common/NitroLayoutOverflow.type.ts @@ -0,0 +1 @@ +export type NitroLayoutOverflow = 'hidden' | 'auto'; diff --git a/src/layout/common/NitroLayoutPosition.type.ts b/src/layout/common/NitroLayoutPosition.type.ts new file mode 100644 index 00000000..41f7dd67 --- /dev/null +++ b/src/layout/common/NitroLayoutPosition.type.ts @@ -0,0 +1 @@ +export type NitroLayoutPosition = 'static' | 'relative' | 'fixed' | 'absolute' | 'sticky'; diff --git a/src/layout/common/NitroLayoutSpacing.type.ts b/src/layout/common/NitroLayoutSpacing.type.ts new file mode 100644 index 00000000..96e53311 --- /dev/null +++ b/src/layout/common/NitroLayoutSpacing.type.ts @@ -0,0 +1 @@ +export type NitroLayoutSpacing = 1 | 2 | 3 | 4 | 5; diff --git a/src/layout/common/NitroLayoutVariant.type.ts b/src/layout/common/NitroLayoutVariant.type.ts new file mode 100644 index 00000000..69c4699a --- /dev/null +++ b/src/layout/common/NitroLayoutVariant.type.ts @@ -0,0 +1 @@ +export type NitroLayoutVariant = 'primary' | 'success' | 'danger'; diff --git a/src/layout/common/index.ts b/src/layout/common/index.ts new file mode 100644 index 00000000..d5d007cc --- /dev/null +++ b/src/layout/common/index.ts @@ -0,0 +1,6 @@ +export * from './NitroLayoutButtonSize.type'; +export * from './NitroLayoutColumns.type'; +export * from './NitroLayoutOverflow.type'; +export * from './NitroLayoutPosition.type'; +export * from './NitroLayoutSpacing.type'; +export * from './NitroLayoutVariant.type'; diff --git a/src/layout/flex-column/NitroLayoutFlexColumn.tsx b/src/layout/flex-column/NitroLayoutFlexColumn.tsx new file mode 100644 index 00000000..7301b619 --- /dev/null +++ b/src/layout/flex-column/NitroLayoutFlexColumn.tsx @@ -0,0 +1,19 @@ +import { FC, useMemo } from 'react'; +import { NitroLayoutFlex } from '../flex/NitroLayoutFlex'; +import { NitroLayoutFlexColumnProps } from './NitroLayoutFlexColumn.types'; + +export const NitroLayoutFlexColumn: FC = 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 f02a74e0..2859e2a3 100644 --- a/src/layout/index.ts +++ b/src/layout/index.ts @@ -1,8 +1,15 @@ +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'; export * from './notification-bubble'; export * from './transitions'; export * from './trophy'; 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/layout/notification-alert/NotificationAlertView.scss b/src/layout/notification-alert/NotificationAlertView.scss new file mode 100644 index 00000000..d6dbe418 --- /dev/null +++ b/src/layout/notification-alert/NotificationAlertView.scss @@ -0,0 +1,8 @@ +.nitro-alert { + width: 350px; + + .content-area { + min-height: 125px; + max-height: 300px; + } +} diff --git a/src/layout/notification-alert/NotificationAlertView.tsx b/src/layout/notification-alert/NotificationAlertView.tsx new file mode 100644 index 00000000..f5281398 --- /dev/null +++ b/src/layout/notification-alert/NotificationAlertView.tsx @@ -0,0 +1,17 @@ +import { FC } from 'react'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../card'; +import { NotificationAlertViewProps } from './NotificationAlertView.types'; + +export const NotificationAlertView: FC = props => +{ + const { title = '', close = null, className = '', children = null, ...rest } = props; + + return ( + + + + { children } + + + ); +} diff --git a/src/layout/notification-alert/NotificationAlertView.types.ts b/src/layout/notification-alert/NotificationAlertView.types.ts new file mode 100644 index 00000000..9d1817e5 --- /dev/null +++ b/src/layout/notification-alert/NotificationAlertView.types.ts @@ -0,0 +1,7 @@ +import { DetailsHTMLAttributes } from 'react'; + +export interface NotificationAlertViewProps extends DetailsHTMLAttributes +{ + title: string; + close: () => void; +} diff --git a/src/layout/notification-alert/index.ts b/src/layout/notification-alert/index.ts new file mode 100644 index 00000000..91f80b3d --- /dev/null +++ b/src/layout/notification-alert/index.ts @@ -0,0 +1,2 @@ +export * from './NotificationAlertView'; +export * from './NotificationAlertView.types'; diff --git a/src/views/achievements/AchievementsView.scss b/src/views/achievements/AchievementsView.scss index 00014327..f9f69f5d 100644 --- a/src/views/achievements/AchievementsView.scss +++ b/src/views/achievements/AchievementsView.scss @@ -1,10 +1,6 @@ .nitro-achievements { - width: 650px; - - .content-area { - min-height: 376px; - height: 376px; - } + width: $achievement-width; + height: $achievement-height; .score { border-color: $grid-border-color !important; @@ -12,13 +8,22 @@ } .category { + border-color: $grid-border-color !important; + background-color: $grid-bg-color; + cursor: pointer; + + &.active { + border-color: $grid-active-border-color !important; + background-color: $grid-active-bg-color; + } + .category-score { margin-top: 43.5px; } } .achievements { - height: 230px; + height: 152px; overflow-y: auto; overflow-x: hidden; @@ -44,4 +49,15 @@ } } } + + .achievement-image { + height: 80px; + width: 80px; + + .badge-image { + width: 80px; + height: 80px; + background-size: contain; + } + } } diff --git a/src/views/achievements/AchievementsView.tsx b/src/views/achievements/AchievementsView.tsx index 38cdcf6c..48bb619b 100644 --- a/src/views/achievements/AchievementsView.tsx +++ b/src/views/achievements/AchievementsView.tsx @@ -40,7 +40,7 @@ export const AchievementsView: FC = props => { isVisible && - + setIsVisible(false) } />
diff --git a/src/views/achievements/reducers/AchievementsReducer.tsx b/src/views/achievements/reducers/AchievementsReducer.tsx index 460d998a..6f8e2b11 100644 --- a/src/views/achievements/reducers/AchievementsReducer.tsx +++ b/src/views/achievements/reducers/AchievementsReducer.tsx @@ -43,13 +43,16 @@ export const AchievementsReducer: Reducer 0) { - selectedCategoryName = categories[0].name; + selectedCategoryName = categories[0].name; + + if(categories[0].achievements.length > 0) selectedAchievementId = categories[0].achievements[0].achievementId; } - return { ...state, categories, selectedCategoryName }; + return { ...state, categories, selectedCategoryName, selectedAchievementId }; } case AchievementsActions.SET_SCORE: { const score = (action.payload.score || state.score || null); diff --git a/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx b/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx index 21ebb6a7..ddc6ed24 100644 --- a/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx +++ b/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx @@ -1,6 +1,6 @@ +import classNames from 'classnames'; import { FC, useCallback, useMemo } from 'react'; import { GetConfiguration } from '../../../../api'; -import { NitroCardGridItemView } from '../../../../layout/card/grid/item/NitroCardGridItemView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementsActions } from '../../reducers/AchievementsReducer'; import { AchievementCategoryListItemViewProps } from './AchievementCategoryListItemView.types'; @@ -58,8 +58,11 @@ export const AchievementCategoryListItemView: FC selectCategory(category.name) }> -
{ getCategoryProgress }
- +
+
selectCategory(category.name) }> + +
{ getCategoryProgress }
+
+
); } diff --git a/src/views/achievements/views/category-list/AchievementsListView.tsx b/src/views/achievements/views/category-list/AchievementsListView.tsx index 216a3c3c..2ca173c7 100644 --- a/src/views/achievements/views/category-list/AchievementsListView.tsx +++ b/src/views/achievements/views/category-list/AchievementsListView.tsx @@ -1,5 +1,4 @@ import { FC } from 'react'; -import { NitroCardGridView } from '../../../../layout/card/grid/NitroCardGridView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementCategoryListItemView } from '../category-list-item/AchievementCategoryListItemView'; @@ -9,11 +8,11 @@ export const AchievementsListView: FC<{}> = props => const { categories = null, selectedCategoryName = null } = achievementsState; return ( - +
{ categories && categories.map((category, index) => { - return ; + return ; }) } - +
); }; diff --git a/src/views/achievements/views/category/AchievementCategoryView.tsx b/src/views/achievements/views/category/AchievementCategoryView.tsx index 050d6a64..879c4d84 100644 --- a/src/views/achievements/views/category/AchievementCategoryView.tsx +++ b/src/views/achievements/views/category/AchievementCategoryView.tsx @@ -1,7 +1,7 @@ import { AchievementData } from '@nitrots/nitro-renderer'; import classNames from 'classnames'; -import { FC, useCallback } from 'react'; -import { LocalizeText } from '../../../../api'; +import { FC, useCallback, useMemo } from 'react'; +import { LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../../api'; import { BadgeImageView } from '../../../shared/badge-image/BadgeImageView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementsActions } from '../../reducers/AchievementsReducer'; @@ -34,7 +34,7 @@ export const AchievementCategoryView: FC = props = return badgeId; }, []); - const getSelectedAchievement = useCallback(() => + const selectedAchievement = useMemo(() => { if(!getSelectedCategory()) return null; @@ -54,15 +54,19 @@ export const AchievementCategoryView: FC = props = return (
-
+
{ LocalizeText('quests.' + selectedCategoryName + '.name') }
IMAGE
-
-
- + { selectedAchievement &&
+
+
-
+
+
{ LocalizeBadgeName(selectedAchievement.badgeId) }
+
{ LocalizeBadgeDescription(selectedAchievement.badgeId) }
+
+
}
{ getSelectedCategory().achievements.map((achievement, index) => 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..28562fe8 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..31a113c0 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..840736ce 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 d49b167e..ec06d572 100644 --- a/src/views/catalog/CatalogView.tsx +++ b/src/views/catalog/CatalogView.tsx @@ -10,7 +10,7 @@ import { CatalogMode, CatalogViewProps } from './CatalogView.types'; import { BuildCatalogPageTree } from './common/CatalogUtilities'; import { CatalogContextProvider } from './context/CatalogContext'; import { CatalogReducer, initialCatalog } from './reducers/CatalogReducer'; -import { CatalogPageGiftView } from './views/gift/CatalogPageGiftView'; +import { CatalogGiftView } from './views/gift/CatalogGiftView'; import { ACTIVE_PAGES, CatalogNavigationView } from './views/navigation/CatalogNavigationView'; import { CatalogPageView } from './views/page/CatalogPageView'; @@ -205,7 +205,7 @@ export const CatalogView: FC = props =>
{ currentNavigationPage && !navigationHidden && -
+
}
@@ -214,7 +214,7 @@ export const CatalogView: FC = props =>
} - + ); } 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 d5d8464b..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/CatalogPageGiftView'; diff --git a/src/views/catalog/views/gift/CatalogPageGiftView.scss b/src/views/catalog/views/gift/CatalogGiftView.scss similarity index 92% rename from src/views/catalog/views/gift/CatalogPageGiftView.scss rename to src/views/catalog/views/gift/CatalogGiftView.scss index 9f43a086..db61d248 100644 --- a/src/views/catalog/views/gift/CatalogPageGiftView.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/gift/CatalogPageGiftView.tsx b/src/views/catalog/views/gift/CatalogGiftView.tsx similarity index 99% rename from src/views/catalog/views/gift/CatalogPageGiftView.tsx rename to src/views/catalog/views/gift/CatalogGiftView.tsx index 1d7a1bf1..d466d5b6 100644 --- a/src/views/catalog/views/gift/CatalogPageGiftView.tsx +++ b/src/views/catalog/views/gift/CatalogGiftView.tsx @@ -10,7 +10,7 @@ import { CurrencyIcon } from '../../../shared/currency-icon/CurrencyIcon'; import { FurniImageView } from '../../../shared/furni-image/FurniImageView'; import { useCatalogContext } from '../../context/CatalogContext'; -export const CatalogPageGiftView: FC<{}> = props => +export const CatalogGiftView: FC<{}> = props => { const { catalogState = null } = useCatalogContext(); const { giftConfiguration = null } = catalogState; 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 b36ce01b..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)); @@ -63,28 +49,30 @@ 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..f68c2c50 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..fe5eaf41 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 ( -
-
+
+
-
- -
+