mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
Merge pull request #52 from billsonnn/feature/vip-gifts
Feature/vip gifts
This commit is contained in:
commit
343600ef93
@ -1,6 +1,5 @@
|
||||
import { CatalogPageMessageParser, RoomPreviewer } from '@nitrots/nitro-renderer';
|
||||
import { CatalogLayoutBadgeDisplayView } from './badge-display/CatalogLayoutBadgeDisplayView';
|
||||
import { CatalogLayoutColorGroupingView } from './color-grouping/CatalogLayoutColorGroupingView';
|
||||
import { CatalogLayoutDefaultView } from './default/CatalogLayoutDefaultView';
|
||||
import { CatalogLayoutFrontpage4View } from './frontpage4/CatalogLayoutFrontpage4View';
|
||||
import { CatalogLayouGuildCustomFurniView } from './guild-custom-furni/CatalogLayoutGuildCustomFurniView';
|
||||
@ -58,8 +57,8 @@ export const GetCatalogLayout = (pageParser: CatalogPageMessageParser, roomPrevi
|
||||
return <CatalogLayoutInfoLoyaltyView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
|
||||
case 'badge_display':
|
||||
return <CatalogLayoutBadgeDisplayView roomPreviewer={roomPreviewer} pageParser={ pageParser } />;
|
||||
case 'default_3x3_color_grouping':
|
||||
return <CatalogLayoutColorGroupingView roomPreviewer={roomPreviewer} pageParser={ pageParser } />;
|
||||
//case 'default_3x3_color_grouping':
|
||||
//return <CatalogLayoutColorGroupingView roomPreviewer={roomPreviewer} pageParser={ pageParser } />;
|
||||
case 'bots':
|
||||
case 'default_3x3':
|
||||
default:
|
||||
|
@ -1,4 +1,9 @@
|
||||
import { FC } from 'react';
|
||||
import { CatalogPageMessageOfferData, IFurnitureData } from '@nitrots/nitro-renderer';
|
||||
import { FC, useMemo, useState } from 'react';
|
||||
import { GetSessionDataManager } from '../../../../../../api';
|
||||
import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout';
|
||||
import { ProductTypeEnum } from '../../../../common/ProductTypeEnum';
|
||||
import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView';
|
||||
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
||||
|
||||
export interface CatalogLayoutColorGroupViewProps extends CatalogLayoutProps
|
||||
@ -8,5 +13,79 @@ export interface CatalogLayoutColorGroupViewProps extends CatalogLayoutProps
|
||||
|
||||
export const CatalogLayoutColorGroupingView : FC<CatalogLayoutColorGroupViewProps> = props =>
|
||||
{
|
||||
return null;
|
||||
const { roomPreviewer = null, pageParser = null } = props;
|
||||
const [ colorableItems, setColorableItems ] = useState<Map<string, number[]>>(new Map<string, number[]>());
|
||||
|
||||
const offers = useMemo(() =>
|
||||
{
|
||||
const offers: CatalogPageMessageOfferData[] = [];
|
||||
const addedColorableItems = new Map<string, boolean>();
|
||||
|
||||
pageParser.offers.forEach(offer =>
|
||||
{
|
||||
const product = offer.products[0];
|
||||
if(!product) return;
|
||||
|
||||
let furniData: IFurnitureData = null;
|
||||
|
||||
if(product.productType === ProductTypeEnum.FLOOR)
|
||||
{
|
||||
furniData = GetSessionDataManager().getFloorItemData(product.furniClassId);
|
||||
}
|
||||
else if(product.productType === ProductTypeEnum.WALL)
|
||||
{
|
||||
furniData = GetSessionDataManager().getWallItemData(product.furniClassId);
|
||||
}
|
||||
|
||||
if(((!(furniData)) || ((furniData.fullName.indexOf('*') === -1))))
|
||||
{
|
||||
offers.push(offer);
|
||||
}
|
||||
else
|
||||
{
|
||||
const name = furniData.fullName.split('*')[0];
|
||||
const colorIndex = parseInt(furniData.fullName.split('*')[1]);
|
||||
|
||||
if(!colorableItems[name])
|
||||
{
|
||||
colorableItems[name] = [];
|
||||
}
|
||||
|
||||
let selectedColor = 0;
|
||||
if(furniData.colors)
|
||||
{
|
||||
for(let color of furniData.colors)
|
||||
{
|
||||
if(color !== 0xFFFFFF)
|
||||
{
|
||||
selectedColor = color;
|
||||
}
|
||||
}
|
||||
if(colorableItems[name].indexOf(selectedColor) === -1)
|
||||
{
|
||||
colorableItems[name][colorIndex] = selectedColor;
|
||||
}
|
||||
}
|
||||
|
||||
if(!addedColorableItems.has(name))
|
||||
{
|
||||
offers.push(offer);
|
||||
addedColorableItems.set(name, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(colorableItems);
|
||||
return offers;
|
||||
}, [colorableItems, pageParser.offers]);
|
||||
|
||||
return (
|
||||
<NitroLayoutGrid>
|
||||
<NitroLayoutGridColumn size={ 7 }>
|
||||
<CatalogPageOffersView offers={ offers } />
|
||||
</NitroLayoutGridColumn>
|
||||
<NitroLayoutGridColumn size={ 5 }>
|
||||
|
||||
</NitroLayoutGridColumn>
|
||||
</NitroLayoutGrid>
|
||||
);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ export const HelpMessageHandler: FC<{}> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
const message = LocalizeText('help.cfh.closed.' + GetCloseReasonKey(parser.closeReason))
|
||||
const message = parser.messageText.length === 0 ? LocalizeText('help.cfh.closed.' + GetCloseReasonKey(parser.closeReason)) : parser.messageText;
|
||||
|
||||
NotificationUtilities.simpleAlert(message, NotificationAlertType.MODERATION, null, null, LocalizeText('mod.alert.title'));
|
||||
}, []);
|
||||
|
@ -35,7 +35,7 @@ export const HelpIndexView: FC<{}> = props =>
|
||||
</div>
|
||||
|
||||
<div className="d-grid gap-2 col-8 mx-auto">
|
||||
<button className="btn btn-link" type="button" onClick={onRequestMySanctionStatusClick}>{LocalizeText('help.main.my.sanction.status')}</button>
|
||||
<button className="btn btn-link text-primary fw-bold" type="button" onClick={onRequestMySanctionStatusClick}>{LocalizeText('help.main.my.sanction.status')}</button>
|
||||
</div>
|
||||
|
||||
</>
|
||||
|
@ -88,7 +88,6 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
<div>
|
||||
<b>Owner in room:</b> { ownerInRoom ? 'Yes' : 'No' }
|
||||
</div>
|
||||
<button className="btn btn-sm btn-primary">Edit in HK</button>
|
||||
</div>
|
||||
<div className="bg-muted rounded py-1 px-2 mb-2">
|
||||
<div className="form-check">
|
||||
|
@ -49,8 +49,8 @@ export const IssueInfoView: FC<IssueInfoViewProps> = props =>
|
||||
<div><span className="fw-bold">Source: </span>{getSourceName(ticket.categoryId)}</div>
|
||||
<div><span className="fw-bold">Category: </span>{LocalizeText('help.cfh.topic.' + ticket.reportedCategoryId)}</div>
|
||||
<div><span className="fw-bold">Description: </span>{ticket.message}</div>
|
||||
<div><span className="fw-bold">Caller: </span><button className="btn btn-link fw-bold" onClick={() => openUserInfo(ticket.reporterUserId)}>{ticket.reporterUserName}</button></div>
|
||||
<div><span className="fw-bold">Reported User: </span><button className="btn btn-link fw-bold" onClick={() => openUserInfo(ticket.reportedUserId)}>{ticket.reportedUserName}</button></div>
|
||||
<div><span className="fw-bold">Caller: </span><button className="btn btn-link fw-bold text-primary" onClick={() => openUserInfo(ticket.reporterUserId)}>{ticket.reporterUserName}</button></div>
|
||||
<div><span className="fw-bold">Reported User: </span><button className="btn btn-link fw-bold text-danger" onClick={() => openUserInfo(ticket.reportedUserId)}>{ticket.reportedUserName}</button></div>
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<div className="d-grid gap-2 mb-4">
|
||||
|
@ -33,10 +33,10 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
|
||||
const item = roomVisitData.rooms[props.index];
|
||||
|
||||
return (
|
||||
<div style={props.style} key={props.key} className="row room-visit">
|
||||
<div style={props.style} key={props.key} className="row room-visit align-items-center">
|
||||
<div className="col-auto text-center">{item.enterHour.toString().padStart(2, '0')}:{item.enterMinute.toString().padStart(2, '0')}</div>
|
||||
<div className="col-7"><span className="fw-bold">Room: </span>{item.roomName}</div>
|
||||
<button className="btn btn-sm btn-link col-auto fw-bold" onClick={() => TryVisitRoom(item.roomId)}>Visit Room</button>
|
||||
<button className="btn btn-sm btn-link col-auto fw-bold text-primary" onClick={() => TryVisitRoom(item.roomId)}>Visit Room</button>
|
||||
</div>);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ export const NotificationCenterMessageHandler: FC<INotificationCenterMessageHand
|
||||
break;
|
||||
}
|
||||
|
||||
NotificationUtilities.showSingleBubble(LocalizeText('notifications.text.loyalty.received', [ 'amount' ], [ parser.amountChanged.toString() ]), NotificationBubbleType.INFO, imageUrl);
|
||||
NotificationUtilities.showSingleBubble(LocalizeText('notifications.text.loyalty.received', [ 'AMOUNT' ], [ parser.amountChanged.toString() ]), NotificationBubbleType.INFO, imageUrl);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(ActivityPointNotificationMessageEvent, onActivityPointNotificationMessageEvent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user