mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
Rename all close functions to onClose
This commit is contained in:
parent
a183c9c0ac
commit
ea185a441a
@ -22,7 +22,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
|
||||
setIsOpen(prevValue => !prevValue);
|
||||
}
|
||||
|
||||
const close = useCallback(() => setIsOpen(false), []);
|
||||
const onClose = useCallback(() => setIsOpen(false), []);
|
||||
|
||||
const getClassNames = useMemo(() =>
|
||||
{
|
||||
@ -42,7 +42,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
const closeFunction = close;
|
||||
const closeFunction = onClose;
|
||||
|
||||
setClosers(prevValue =>
|
||||
{
|
||||
@ -66,7 +66,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
|
||||
return newClosers;
|
||||
});
|
||||
}
|
||||
}, [ close, setClosers ]);
|
||||
}, [ onClose, setClosers ]);
|
||||
|
||||
return (
|
||||
<Column classNames={ getClassNames } gap={ gap } { ...rest }>
|
||||
|
@ -6,12 +6,12 @@ export interface LayoutNotificationAlertViewProps extends NitroCardViewProps
|
||||
{
|
||||
title?: string;
|
||||
type?: string;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const LayoutNotificationAlertView: FC<LayoutNotificationAlertViewProps> = props =>
|
||||
{
|
||||
const { title = '', close = null, classNames = [], children = null,type = NotificationAlertType.DEFAULT, ...rest } = props;
|
||||
const { title = '', onClose = null, classNames = [], children = null,type = NotificationAlertType.DEFAULT, ...rest } = props;
|
||||
|
||||
const getClassNames = useMemo(() =>
|
||||
{
|
||||
@ -26,7 +26,7 @@ export const LayoutNotificationAlertView: FC<LayoutNotificationAlertViewProps> =
|
||||
|
||||
return (
|
||||
<NitroCardView classNames={ getClassNames } theme="primary-slim" { ...rest }>
|
||||
<NitroCardHeaderView headerText={ title } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ title } onCloseClick={ onClose } />
|
||||
<NitroCardContentView grow justifyContent="between" overflow="hidden" className="text-black" gap={ 0 }>
|
||||
{ children }
|
||||
</NitroCardContentView>
|
||||
|
@ -6,12 +6,12 @@ export interface LayoutNotificationBubbleViewProps extends FlexProps
|
||||
{
|
||||
fadesOut?: boolean;
|
||||
timeoutMs?: number;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const LayoutNotificationBubbleView: FC<LayoutNotificationBubbleViewProps> = props =>
|
||||
{
|
||||
const { fadesOut = true, timeoutMs = 8000, close = null, overflow = 'hidden', classNames = [], ...rest } = props;
|
||||
const { fadesOut = true, timeoutMs = 8000, onClose = null, overflow = 'hidden', classNames = [], ...rest } = props;
|
||||
const [ isVisible, setIsVisible ] = useState(false);
|
||||
|
||||
const getClassNames = useMemo(() =>
|
||||
@ -38,15 +38,15 @@ export const LayoutNotificationBubbleView: FC<LayoutNotificationBubbleViewProps>
|
||||
{
|
||||
setIsVisible(false);
|
||||
|
||||
setTimeout(() => close(), 300);
|
||||
setTimeout(() => onClose(), 300);
|
||||
}, timeoutMs);
|
||||
|
||||
return () => clearTimeout(timeout);
|
||||
}, [ fadesOut, timeoutMs, close ]);
|
||||
}, [ fadesOut, timeoutMs, onClose ]);
|
||||
|
||||
return (
|
||||
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isVisible } timeout={ 300 }>
|
||||
<Flex overflow={ overflow } classNames={ getClassNames } onClick={ close } { ...rest } />
|
||||
<Flex overflow={ overflow } classNames={ getClassNames } onClick={ onClose } { ...rest } />
|
||||
</TransitionAnimation>
|
||||
);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { CalendarItemView } from './CalendarItemView';
|
||||
|
||||
interface CalendarViewProps
|
||||
{
|
||||
close(): void;
|
||||
onClose(): void;
|
||||
openPackage(id: number, asStaff: boolean): void;
|
||||
receivedProducts: Map<number, ICalendarItem>;
|
||||
campaignName: string;
|
||||
@ -19,7 +19,7 @@ const TOTAL_SHOWN_ITEMS = 5;
|
||||
|
||||
export const CalendarView: FC<CalendarViewProps> = props =>
|
||||
{
|
||||
const { close = null, campaignName = null, currentDay = null, numDays = null, missedDays = null, openedDays = null, openPackage = null, receivedProducts = null } = props;
|
||||
const { onClose = null, campaignName = null, currentDay = null, numDays = null, missedDays = null, openedDays = null, openPackage = null, receivedProducts = null } = props;
|
||||
const [ selectedDay, setSelectedDay ] = useState(currentDay);
|
||||
const [ index, setIndex ] = useState(Math.max(0, (selectedDay - 1)));
|
||||
|
||||
@ -97,7 +97,7 @@ export const CalendarView: FC<CalendarViewProps> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-campaign-calendar" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText(`campaign.calendar.${ campaignName }.title`) } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText(`campaign.calendar.${ campaignName }.title`) } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<Grid fullHeight={ false } justifyContent="between" alignItems="center">
|
||||
<Column size={ 1 } />
|
||||
|
@ -103,7 +103,7 @@ export const CampaignView: FC<{}> = props =>
|
||||
return (
|
||||
<>
|
||||
{ (calendarData && isCalendarOpen) &&
|
||||
<CalendarView close={ onCalendarClose } campaignName={ calendarData.campaignName } currentDay={ calendarData.currentDay } numDays={ calendarData.campaignDays } openedDays={ calendarData.openedDays } missedDays={ calendarData.missedDays } openPackage={ openPackage } receivedProducts={ receivedProducts } />
|
||||
<CalendarView onClose={ onCalendarClose } campaignName={ calendarData.campaignName } currentDay={ calendarData.currentDay } numDays={ calendarData.campaignDays } openedDays={ calendarData.openedDays } missedDays={ calendarData.missedDays } openPackage={ openPackage } receivedProducts={ receivedProducts } />
|
||||
}
|
||||
</>
|
||||
)
|
||||
|
@ -26,7 +26,7 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
const { catalogOptions = null } = useCatalog();
|
||||
const { giftConfiguration = null } = catalogOptions;
|
||||
|
||||
const close = useCallback(() =>
|
||||
const onClose = useCallback(() =>
|
||||
{
|
||||
setIsVisible(false);
|
||||
setPageId(0);
|
||||
@ -46,12 +46,12 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
switch(event.type)
|
||||
{
|
||||
case CatalogPurchasedEvent.PURCHASE_SUCCESS:
|
||||
close();
|
||||
onClose();
|
||||
return;
|
||||
case CatalogEvent.INIT_GIFT:
|
||||
const castedEvent = (event as CatalogInitGiftEvent);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
|
||||
setPageId(castedEvent.pageId);
|
||||
setOfferId(castedEvent.offerId);
|
||||
@ -59,7 +59,7 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
setIsVisible(true);
|
||||
return;
|
||||
}
|
||||
}, [ close ]);
|
||||
}, [ onClose ]);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
useUiEvent(CatalogEvent.INIT_GIFT, onCatalogEvent);
|
||||
@ -158,7 +158,7 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView uniqueKey="catalog-gift" className="nitro-catalog-gift" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('catalog.gift_wrapping.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('catalog.gift_wrapping.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView className="text-black">
|
||||
<FormGroup column>
|
||||
<Text>{ LocalizeText('catalog.gift_wrapping.receiver') }</Text>
|
||||
@ -216,7 +216,7 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
</ButtonGroup>
|
||||
</Column>
|
||||
<Flex justifyContent="between" alignItems="center">
|
||||
<Button variant="link" onClick={ close } className="text-black">
|
||||
<Button variant="link" onClick={ onClose } className="text-black">
|
||||
{ LocalizeText('cancel') }
|
||||
</Button>
|
||||
<Button variant="success" onClick={ () => handleAction('buy') }>
|
||||
|
@ -24,7 +24,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
const [ availableRooms, setAvailableRooms ] = useState<{ id: number, name: string }[]>(null);
|
||||
const [ purchaseCost, setPurchaseCost ] = useState<number>(0);
|
||||
|
||||
const close = () =>
|
||||
const onCloseClose = () =>
|
||||
{
|
||||
setCloseAction(null);
|
||||
setGroupData(null);
|
||||
@ -121,7 +121,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-group-creator" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('group.create.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('group.create.title') } onCloseClick={ onCloseClose } />
|
||||
<NitroCardContentView>
|
||||
<Flex center className="creator-tabs">
|
||||
{ TABS.map((tab, index) =>
|
||||
|
@ -86,7 +86,7 @@ export const GroupManagerView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-group-manager">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('group.window.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('group.window.title') } onCloseClick={ onClose } />
|
||||
<NitroCardTabsView>
|
||||
{ TABS.map(tab =>
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ export const HelpView: FC<{}> = props =>
|
||||
const [ isVisible, setIsVisible ] = useState(false);
|
||||
const { activeReport = null, setActiveReport = null, report = null } = useHelp();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setActiveReport(null);
|
||||
setIsVisible(false);
|
||||
@ -98,7 +98,7 @@ export const HelpView: FC<{}> = props =>
|
||||
return (
|
||||
<>
|
||||
<NitroCardView className="nitro-help" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('help.button.cfh') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('help.button.cfh') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView className="text-black">
|
||||
<Grid>
|
||||
<Column center size={ 5 } overflow="hidden">
|
||||
|
@ -25,7 +25,7 @@ export const InventoryView: FC<{}> = props =>
|
||||
const { isTrading = false, stopTrading = null } = useInventoryTrade();
|
||||
const { getCount = null, resetCategory = null } = useInventoryUnseenTracker();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
if(isTrading) stopTrading();
|
||||
|
||||
@ -123,7 +123,7 @@ export const InventoryView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView uniqueKey={ 'inventory' } className="nitro-inventory" theme={ isTrading ? 'primary-slim' : '' } >
|
||||
<NitroCardHeaderView headerText={ LocalizeText('inventory.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('inventory.title') } onCloseClick={ onClose } />
|
||||
{ !isTrading &&
|
||||
<>
|
||||
<NitroCardTabsView>
|
||||
@ -149,7 +149,7 @@ export const InventoryView: FC<{}> = props =>
|
||||
</> }
|
||||
{ isTrading &&
|
||||
<NitroCardContentView>
|
||||
<InventoryTradeView cancelTrade={ close } />
|
||||
<InventoryTradeView cancelTrade={ onClose } />
|
||||
</NitroCardContentView> }
|
||||
</NitroCardView>
|
||||
);
|
||||
|
@ -12,7 +12,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
|
||||
const [ password, setPassword ] = useState('');
|
||||
const { doorData = null, setDoorData = null } = useNavigatorContext();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
if(doorData && (doorData.state === DoorStateType.STATE_WAITING)) GoToDesktop();
|
||||
|
||||
@ -64,7 +64,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-navigator-doorbell" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText(isDoorbell ? 'navigator.doorbell.title' : 'navigator.password.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText(isDoorbell ? 'navigator.doorbell.title' : 'navigator.password.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<Column gap={ 1 }>
|
||||
<Text bold>{ doorData && doorData.roomInfo && doorData.roomInfo.roomName }</Text>
|
||||
@ -85,7 +85,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
|
||||
<Button variant="success" onClick={ ring }>
|
||||
{ LocalizeText('navigator.doorbell.button.ring') }
|
||||
</Button> }
|
||||
<Button variant="danger" onClick={ close }>
|
||||
<Button variant="danger" onClick={ onClose }>
|
||||
{ LocalizeText('generic.cancel') }
|
||||
</Button>
|
||||
</Column> }
|
||||
@ -99,7 +99,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
|
||||
<Button variant="success" onClick={ tryEntering }>
|
||||
{ LocalizeText('navigator.password.button.try') }
|
||||
</Button>
|
||||
<Button variant="danger" onClick={ close }>
|
||||
<Button variant="danger" onClick={ onClose }>
|
||||
{ LocalizeText('generic.cancel') }
|
||||
</Button>
|
||||
</Column>
|
||||
|
@ -14,13 +14,13 @@ interface NavigatorRoomSettingsTabViewProps
|
||||
{
|
||||
roomData: IRoomData;
|
||||
handleChange: (field: string, value: string | number | boolean) => void;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
|
||||
export const NavigatorRoomSettingsBasicTabView: FC<NavigatorRoomSettingsTabViewProps> = props =>
|
||||
{
|
||||
const { roomData = null, handleChange = null, close = null } = props;
|
||||
const { roomData = null, handleChange = null, onClose = null } = props;
|
||||
const [ roomName, setRoomName ] = useState<string>('');
|
||||
const [ roomDescription, setRoomDescription ] = useState<string>('');
|
||||
const { showConfirm = null } = useNotification();
|
||||
@ -32,7 +32,7 @@ export const NavigatorRoomSettingsBasicTabView: FC<NavigatorRoomSettingsTabViewP
|
||||
{
|
||||
SendMessageComposer(new RoomDeleteComposer(roomData.roomId));
|
||||
|
||||
if(close) close();
|
||||
if(onClose) onClose();
|
||||
|
||||
CreateLinkEvent('navigator/search/myworld_view');
|
||||
},
|
||||
|
@ -65,7 +65,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
|
||||
|
||||
useMessageEvent(RoomSettingsDataEvent, onRoomSettingsEvent);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setRoomData(null);
|
||||
setCurrentTab(TABS[0]);
|
||||
@ -181,7 +181,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView uniqueKey="nitro-room-settings" className="nitro-room-settings">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('navigator.roomsettings') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('navigator.roomsettings') } onCloseClick={ onClose } />
|
||||
<NitroCardTabsView>
|
||||
{ TABS.map(tab =>
|
||||
{
|
||||
@ -190,7 +190,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
|
||||
</NitroCardTabsView>
|
||||
<NitroCardContentView>
|
||||
{ (currentTab === TABS[0]) &&
|
||||
<NavigatorRoomSettingsBasicTabView roomData={ roomData } handleChange={ handleChange } close={ close } /> }
|
||||
<NavigatorRoomSettingsBasicTabView roomData={ roomData } handleChange={ handleChange } onClose={ onClose } /> }
|
||||
{ (currentTab === TABS[1]) &&
|
||||
<NavigatorRoomSettingsAccessTabView roomData={ roomData } handleChange={ handleChange } /> }
|
||||
{ (currentTab === TABS[2]) &&
|
||||
|
@ -3,11 +3,11 @@ import { NitroSystemAlertView } from './NitroSystemAlertView';
|
||||
import { NotificationDefaultAlertView } from './NotificationDefaultAlertView';
|
||||
import { NotificationSeachAlertView } from './NotificationSearchAlertView';
|
||||
|
||||
export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) =>
|
||||
export const GetAlertLayout = (item: NotificationAlertItem, onClose: () => void) =>
|
||||
{
|
||||
if(!item) return null;
|
||||
|
||||
const props = { key: item.id, item, close };
|
||||
const props = { key: item.id, item, onClose };
|
||||
|
||||
switch(item.alertType)
|
||||
{
|
||||
|
@ -9,10 +9,10 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
|
||||
|
||||
export const NitroSystemAlertView: FC<NotificationDefaultAlertViewProps> = props =>
|
||||
{
|
||||
const { title = 'Nitro', close = null, ...rest } = props;
|
||||
const { title = 'Nitro', onClose = null, ...rest } = props;
|
||||
|
||||
return (
|
||||
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }>
|
||||
<LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest }>
|
||||
<Grid>
|
||||
<Column center size={ 5 }>
|
||||
<object data="https://assets.nitrodev.co/logos/nitro-n-dark.svg" width="100" height="100"> </object>
|
||||
|
@ -9,7 +9,7 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
|
||||
|
||||
export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps> = props =>
|
||||
{
|
||||
const { item = null, title = ((props.item && props.item.title) || ''), close = null, ...rest } = props;
|
||||
const { item = null, title = ((props.item && props.item.title) || ''), onClose = null, ...rest } = props;
|
||||
|
||||
const [ imageFailed, setImageFailed ] = useState<boolean>(false)
|
||||
|
||||
@ -17,13 +17,13 @@ export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps>
|
||||
{
|
||||
OpenUrl(item.clickUrl);
|
||||
|
||||
close();
|
||||
}, [ item, close ]);
|
||||
onClose();
|
||||
}, [ item, onClose ]);
|
||||
|
||||
const hasFrank = item.alertType === NotificationAlertType.DEFAULT;
|
||||
|
||||
return (
|
||||
<LayoutNotificationAlertView title={ title } close={ close } { ...rest } type={ hasFrank ? NotificationAlertType.DEFAULT : item.alertType }>
|
||||
<LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest } type={ hasFrank ? NotificationAlertType.DEFAULT : item.alertType }>
|
||||
<Flex fullHeight overflow="auto" gap={ hasFrank || (item.imageUrl && !imageFailed) ? 2 : 0 }>
|
||||
{ hasFrank && !item.imageUrl && <Base className="notification-frank flex-shrink-0" /> }
|
||||
{ item.imageUrl && !imageFailed && <img src={ item.imageUrl } alt={ item.title } onError={ () =>
|
||||
@ -47,7 +47,7 @@ export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps>
|
||||
<Column alignItems="center" center gap={ 0 }>
|
||||
<hr className="my-2 w-100" />
|
||||
{ !item.clickUrl &&
|
||||
<Button onClick={ close }>{ LocalizeText('generic.close') }</Button> }
|
||||
<Button onClick={ onClose }>{ LocalizeText('generic.close') }</Button> }
|
||||
{ item.clickUrl && (item.clickUrl.length > 0) && <Button onClick={ visitUrl }>{ LocalizeText(item.clickUrlText) }</Button> }
|
||||
</Column>
|
||||
</> }
|
||||
|
@ -9,7 +9,7 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
|
||||
|
||||
export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> = props =>
|
||||
{
|
||||
const { item = null, title = ((props.item && props.item.title) || ''), close = null, ...rest } = props;
|
||||
const { item = null, title = ((props.item && props.item.title) || ''), onClose = null, ...rest } = props;
|
||||
|
||||
const [ searchValue, setSearchValue ] = useState('');
|
||||
const [ results, setResults ] = useState<string[]>([]);
|
||||
@ -18,8 +18,8 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
|
||||
{
|
||||
OpenUrl(item.clickUrl);
|
||||
|
||||
close();
|
||||
}, [ item, close ]);
|
||||
onClose();
|
||||
}, [ item, onClose ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -36,7 +36,7 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
|
||||
const isAction = (item.clickUrl && item.clickUrl.startsWith('event:'));
|
||||
|
||||
return (
|
||||
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }>
|
||||
<LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest }>
|
||||
<Flex fullWidth alignItems="center" position="relative">
|
||||
<input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={ searchValue } onChange={ event => updateSearchValue(event.target.value) } />
|
||||
</Flex>
|
||||
@ -51,7 +51,7 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
|
||||
<hr className="my-2"/>
|
||||
<Column alignItems="center" center gap={ 1 }>
|
||||
{ !isAction && !item.clickUrl &&
|
||||
<Button onClick={ close }>{ LocalizeText('generic.close') }</Button> }
|
||||
<Button onClick={ onClose }>{ LocalizeText('generic.close') }</Button> }
|
||||
{ item.clickUrl && (item.clickUrl.length > 0) &&
|
||||
<Button onClick={ visitUrl }>{ LocalizeText(item.clickUrlText) }</Button> }
|
||||
</Column>
|
||||
|
@ -2,11 +2,11 @@ import { NotificationBubbleItem, NotificationBubbleType } from '../../../../api'
|
||||
import { NotificationClubGiftBubbleView } from './NotificationClubGiftBubbleView';
|
||||
import { NotificationDefaultBubbleView } from './NotificationDefaultBubbleView';
|
||||
|
||||
export const GetBubbleLayout = (item: NotificationBubbleItem, close: () => void) =>
|
||||
export const GetBubbleLayout = (item: NotificationBubbleItem, onClose: () => void) =>
|
||||
{
|
||||
if(!item) return null;
|
||||
|
||||
const props = { key: item.id, item, close };
|
||||
const props = { key: item.id, item, onClose };
|
||||
|
||||
switch(item.notificationType)
|
||||
{
|
||||
|
@ -9,17 +9,17 @@ export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationB
|
||||
|
||||
export const NotificationClubGiftBubbleView: FC<NotificationClubGiftBubbleViewProps> = props =>
|
||||
{
|
||||
const { item = null, close = null, ...rest } = props;
|
||||
const { item = null, onClose = null, ...rest } = props;
|
||||
|
||||
return (
|
||||
<LayoutNotificationBubbleView fadesOut={ false } className="flex-column club-gift" close={ close } { ...rest }>
|
||||
<LayoutNotificationBubbleView fadesOut={ false } className="flex-column club-gift" onClose={ onClose } { ...rest }>
|
||||
<div className="d-flex align-items-center gap-2 mb-2">
|
||||
<LayoutCurrencyIcon type="hc" className="flex-shrink-0" />
|
||||
<span className="ms-1">{ LocalizeText('notifications.text.club_gift') }</span>
|
||||
</div>
|
||||
<div className="d-flex align-items-center justify-content-end gap-2">
|
||||
<button type="button" className="btn btn-success w-100 btn-sm" onClick={ () => OpenUrl(item.linkUrl) }>{ LocalizeText('notifications.button.show_gift_list') }</button>
|
||||
<span className="text-decoration-underline cursor-pointer text-nowrap" onClick={ close }>{ LocalizeText('notifications.button.later') }</span>
|
||||
<span className="text-decoration-underline cursor-pointer text-nowrap" onClick={ onClose }>{ LocalizeText('notifications.button.later') }</span>
|
||||
</div>
|
||||
</LayoutNotificationBubbleView>
|
||||
);
|
||||
|
@ -9,12 +9,12 @@ export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBu
|
||||
|
||||
export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = props =>
|
||||
{
|
||||
const { item = null, close = null, ...rest } = props;
|
||||
const { item = null, onClose = null, ...rest } = props;
|
||||
|
||||
const htmlText = item.message.replace(/\r\n|\r|\n/g, '<br />');
|
||||
|
||||
return (
|
||||
<LayoutNotificationBubbleView close={ close } gap={ 2 } alignItems="center" onClick={ event => (item.linkUrl && item.linkUrl.length && OpenUrl(item.linkUrl)) } { ...rest }>
|
||||
<LayoutNotificationBubbleView onClose={ onClose } gap={ 2 } alignItems="center" onClick={ event => (item.linkUrl && item.linkUrl.length && OpenUrl(item.linkUrl)) } { ...rest }>
|
||||
<Flex center className="bubble-image-container">
|
||||
{ (item.iconUrl && item.iconUrl.length) &&
|
||||
<img className="no-select" src={ item.iconUrl } alt="" /> }
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { NotificationConfirmItem } from '../../../../api';
|
||||
import { NotificationDefaultConfirmView } from './NotificationDefaultConfirmView';
|
||||
|
||||
export const GetConfirmLayout = (item: NotificationConfirmItem, close: () => void) =>
|
||||
export const GetConfirmLayout = (item: NotificationConfirmItem, onClose: () => void) =>
|
||||
{
|
||||
if(!item) return null;
|
||||
|
||||
const props = { key: item.id, item, close };
|
||||
const props = { key: item.id, item, onClose };
|
||||
|
||||
switch(item.confirmType)
|
||||
{
|
||||
|
@ -9,25 +9,25 @@ export interface NotificationDefaultConfirmViewProps extends LayoutNotificationA
|
||||
|
||||
export const NotificationDefaultConfirmView: FC<NotificationDefaultConfirmViewProps> = props =>
|
||||
{
|
||||
const { item = null, close = null, ...rest } = props;
|
||||
const { item = null, onClose = null, ...rest } = props;
|
||||
const { message = null, onConfirm = null, onCancel = null, confirmText = null, cancelText = null, title = null } = item;
|
||||
|
||||
const confirm = () =>
|
||||
{
|
||||
if(onConfirm) onConfirm();
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
const cancel = () =>
|
||||
{
|
||||
if(onCancel) onCancel();
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
return (
|
||||
<LayoutNotificationAlertView title={ title } close={ close } { ...rest } type={ NotificationAlertType.ALERT }>
|
||||
<LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest } type={ NotificationAlertType.ALERT }>
|
||||
<Flex grow center>
|
||||
<Text>{ message }</Text>
|
||||
</Flex>
|
||||
|
@ -7,12 +7,12 @@ import { ContextMenuHeaderView } from '../context-menu/ContextMenuHeaderView';
|
||||
interface AvatarInfoRentableBotChatViewProps
|
||||
{
|
||||
chatEvent: RoomWidgetUpdateRentableBotChatEvent;
|
||||
close(): void;
|
||||
onClose(): void;
|
||||
}
|
||||
|
||||
export const AvatarInfoRentableBotChatView: FC<AvatarInfoRentableBotChatViewProps> = props =>
|
||||
{
|
||||
const { chatEvent = null, close = null } = props;
|
||||
const { chatEvent = null, onClose = null } = props;
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
const [ newText, setNewText ] = useState<string>(chatEvent.chat === '${bot.skill.chatter.configuration.text.placeholder}' ? '' : chatEvent.chat);
|
||||
const [ automaticChat, setAutomaticChat ] = useState<boolean>(chatEvent.automaticChat);
|
||||
@ -29,7 +29,7 @@ export const AvatarInfoRentableBotChatView: FC<AvatarInfoRentableBotChatViewProp
|
||||
|
||||
SendMessageComposer(new BotSkillSaveComposer(chatEvent.botId, BotSkillsEnum.SETUP_CHAT, chatConfiguration));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
return (
|
||||
@ -58,7 +58,7 @@ export const AvatarInfoRentableBotChatView: FC<AvatarInfoRentableBotChatViewProp
|
||||
</Flex>
|
||||
</Column>
|
||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||
<Button fullWidth variant="primary" onClick={ close }>{ LocalizeText('cancel') }</Button>
|
||||
<Button fullWidth variant="primary" onClick={ onClose }>{ LocalizeText('cancel') }</Button>
|
||||
<Button fullWidth variant="success" onClick={ save }>{ LocalizeText('save') }</Button>
|
||||
</Flex>
|
||||
</Column>
|
||||
|
@ -7,7 +7,7 @@ import { useRoom } from '../../../../hooks';
|
||||
interface AvatarInfoUseProductConfirmViewProps
|
||||
{
|
||||
item: UseProductItem;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const _Str_5091: number = -1;
|
||||
@ -21,7 +21,7 @@ const _Str_9653: number = 6;
|
||||
|
||||
export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmViewProps> = props =>
|
||||
{
|
||||
const { item = null, close = null } = props;
|
||||
const { item = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(_Str_5091);
|
||||
const [ petData, setPetData ] = useState<RoomUserData>(null);
|
||||
const [ furniData, setFurniData ] = useState<IFurnitureData>(null);
|
||||
@ -38,8 +38,8 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
|
||||
{
|
||||
roomSession.usePetProduct(item.requestRoomObjectId, petData.webID);
|
||||
|
||||
close();
|
||||
}, [ roomSession, item, petData, close ]);
|
||||
onClose();
|
||||
}, [ roomSession, item, petData, onClose ]);
|
||||
|
||||
const getPetImage = useMemo(() =>
|
||||
{
|
||||
@ -223,7 +223,7 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-use-product-confirmation">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title', [ 'name' ], [ petData.name ]) } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title', [ 'name' ], [ petData.name ]) } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex gap={ 2 } overflow="hidden">
|
||||
<Column>
|
||||
@ -270,7 +270,7 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
|
||||
</> }
|
||||
</Column>
|
||||
<Flex alignItems="center" justifyContent="between">
|
||||
<Button variant="danger" onClick={ close }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="danger" onClick={ onClose }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="success" onClick={ useProduct }>{ LocalizeText('useproduct.widget.use') }</Button>
|
||||
</Flex>
|
||||
</Column>
|
||||
|
@ -10,7 +10,7 @@ interface AvatarInfoUseProductViewProps
|
||||
{
|
||||
item: UseProductItem;
|
||||
updateConfirmingProduct: (product: UseProductItem) => void;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const PRODUCT_PAGE_UKNOWN: number = 0;
|
||||
@ -24,7 +24,7 @@ const PRODUCT_PAGE_FERTILIZE: number = 7;
|
||||
|
||||
export const AvatarInfoUseProductView: FC<AvatarInfoUseProductViewProps> = props =>
|
||||
{
|
||||
const { item = null, updateConfirmingProduct = null, close = null } = props;
|
||||
const { item = null, updateConfirmingProduct = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(0);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
@ -87,7 +87,7 @@ export const AvatarInfoUseProductView: FC<AvatarInfoUseProductViewProps> = props
|
||||
}, [ item, updateConfirmingProduct ]);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ item.id } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ item.id } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView>
|
||||
{ item.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -51,7 +51,7 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
|
||||
{
|
||||
if(!roomSession || isGameMode) return null;
|
||||
|
||||
if(activeNameBubble) return <AvatarInfoWidgetNameView nameInfo={ activeNameBubble } close={ () => setActiveNameBubble(null) } />;
|
||||
if(activeNameBubble) return <AvatarInfoWidgetNameView nameInfo={ activeNameBubble } onClose={ () => setActiveNameBubble(null) } />;
|
||||
|
||||
if(avatarInfo)
|
||||
{
|
||||
@ -62,7 +62,7 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
|
||||
|
||||
if(!isDecorating) return null;
|
||||
|
||||
return <AvatarInfoWidgetFurniView avatarInfo={ info } close={ () => setAvatarInfo(null) } />;
|
||||
return <AvatarInfoWidgetFurniView avatarInfo={ info } onClose={ () => setAvatarInfo(null) } />;
|
||||
}
|
||||
case AvatarInfoUser.OWN_USER:
|
||||
case AvatarInfoUser.PEER: {
|
||||
@ -74,20 +74,20 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
|
||||
{
|
||||
if(RoomEnterEffect.isRunning()) return null;
|
||||
|
||||
return <AvatarInfoWidgetOwnAvatarView avatarInfo={ info } isDancing={ isDancing } setIsDecorating={ setIsDecorating } close={ () => setAvatarInfo(null) } />;
|
||||
return <AvatarInfoWidgetOwnAvatarView avatarInfo={ info } isDancing={ isDancing } setIsDecorating={ setIsDecorating } onClose={ () => setAvatarInfo(null) } />;
|
||||
}
|
||||
|
||||
return <AvatarInfoWidgetAvatarView avatarInfo={ info } close={ () => setAvatarInfo(null) } />;
|
||||
return <AvatarInfoWidgetAvatarView avatarInfo={ info } onClose={ () => setAvatarInfo(null) } />;
|
||||
}
|
||||
case AvatarInfoPet.PET_INFO: {
|
||||
const info = (avatarInfo as AvatarInfoPet);
|
||||
|
||||
if(info.isOwner) return <AvatarInfoWidgetOwnPetView avatarInfo={ info } close={ () => setAvatarInfo(null) } />;
|
||||
if(info.isOwner) return <AvatarInfoWidgetOwnPetView avatarInfo={ info } onClose={ () => setAvatarInfo(null) } />;
|
||||
|
||||
return <AvatarInfoWidgetPetView avatarInfo={ info } close={ () => setAvatarInfo(null) } />;
|
||||
return <AvatarInfoWidgetPetView avatarInfo={ info } onClose={ () => setAvatarInfo(null) } />;
|
||||
}
|
||||
case AvatarInfoRentableBot.RENTABLE_BOT: {
|
||||
return <AvatarInfoWidgetRentableBotView avatarInfo={ (avatarInfo as AvatarInfoRentableBot) } close={ () => setAvatarInfo(null) } />
|
||||
return <AvatarInfoWidgetRentableBotView avatarInfo={ (avatarInfo as AvatarInfoRentableBot) } onClose={ () => setAvatarInfo(null) } />
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -102,16 +102,16 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
|
||||
switch(avatarInfo.type)
|
||||
{
|
||||
case AvatarInfoFurni.FURNI:
|
||||
return <InfoStandWidgetFurniView avatarInfo={ (avatarInfo as AvatarInfoFurni) } close={ () => setAvatarInfo(null) } />;
|
||||
return <InfoStandWidgetFurniView avatarInfo={ (avatarInfo as AvatarInfoFurni) } onClose={ () => setAvatarInfo(null) } />;
|
||||
case AvatarInfoUser.OWN_USER:
|
||||
case AvatarInfoUser.PEER:
|
||||
return <InfoStandWidgetUserView avatarInfo={ (avatarInfo as AvatarInfoUser) } setAvatarInfo={ setAvatarInfo } close={ () => setAvatarInfo(null) } />;
|
||||
return <InfoStandWidgetUserView avatarInfo={ (avatarInfo as AvatarInfoUser) } setAvatarInfo={ setAvatarInfo } onClose={ () => setAvatarInfo(null) } />;
|
||||
case AvatarInfoUser.BOT:
|
||||
return <InfoStandWidgetBotView avatarInfo={ (avatarInfo as AvatarInfoUser) } close={ () => setAvatarInfo(null) } />;
|
||||
return <InfoStandWidgetBotView avatarInfo={ (avatarInfo as AvatarInfoUser) } onClose={ () => setAvatarInfo(null) } />;
|
||||
case AvatarInfoRentableBot.RENTABLE_BOT:
|
||||
return <InfoStandWidgetRentableBotView avatarInfo={ (avatarInfo as AvatarInfoRentableBot) } close={ () => setAvatarInfo(null) } />;
|
||||
return <InfoStandWidgetRentableBotView avatarInfo={ (avatarInfo as AvatarInfoRentableBot) } onClose={ () => setAvatarInfo(null) } />;
|
||||
case AvatarInfoPet.PET_INFO:
|
||||
return <InfoStandWidgetPetView avatarInfo={ (avatarInfo as AvatarInfoPet) } close={ () => setAvatarInfo(null) } />
|
||||
return <InfoStandWidgetPetView avatarInfo={ (avatarInfo as AvatarInfoPet) } onClose={ () => setAvatarInfo(null) } />
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,13 +124,13 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
|
||||
<Column alignItems="end" className="nitro-infostand-container">
|
||||
{ getInfostandView() }
|
||||
</Column> }
|
||||
{ (nameBubbles.length > 0) && nameBubbles.map((name, index) => <AvatarInfoWidgetNameView key={ index } nameInfo={ name } close={ () => removeNameBubble(index) } />) }
|
||||
{ (nameBubbles.length > 0) && nameBubbles.map((name, index) => <AvatarInfoWidgetNameView key={ index } nameInfo={ name } onClose={ () => removeNameBubble(index) } />) }
|
||||
{ (productBubbles.length > 0) && productBubbles.map((item, index) =>
|
||||
{
|
||||
return <AvatarInfoUseProductView key={ item.id } item={ item } updateConfirmingProduct={ updateConfirmingProduct } close={ () => removeProductBubble(index) } />;
|
||||
return <AvatarInfoUseProductView key={ item.id } item={ item } updateConfirmingProduct={ updateConfirmingProduct } onClose={ () => removeProductBubble(index) } />;
|
||||
}) }
|
||||
{ rentableBotChatEvent && <AvatarInfoRentableBotChatView chatEvent={ rentableBotChatEvent } close={ () => setRentableBotChatEvent(null) }/> }
|
||||
{ confirmingProduct && <AvatarInfoUseProductConfirmView item={ confirmingProduct } close={ () => updateConfirmingProduct(null) } /> }
|
||||
{ rentableBotChatEvent && <AvatarInfoRentableBotChatView chatEvent={ rentableBotChatEvent } onClose={ () => setRentableBotChatEvent(null) }/> }
|
||||
{ confirmingProduct && <AvatarInfoUseProductConfirmView item={ confirmingProduct } onClose={ () => updateConfirmingProduct(null) } /> }
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ import { Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text } from
|
||||
interface InfoStandWidgetBotViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoUser;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const InfoStandWidgetBotView: FC<InfoStandWidgetBotViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
|
||||
if(!avatarInfo) return null;
|
||||
|
||||
@ -21,7 +21,7 @@ export const InfoStandWidgetBotView: FC<InfoStandWidgetBotViewProps> = props =>
|
||||
<Column gap={ 1 }>
|
||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||
<Text variant="white" small wrap>{ avatarInfo.name }</Text>
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } />
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
|
||||
</Flex>
|
||||
<hr className="m-0" />
|
||||
</Column>
|
||||
|
@ -8,7 +8,7 @@ import { useMessageEvent, useRoom } from '../../../../../hooks';
|
||||
interface InfoStandWidgetFurniViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoFurni;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const PICKUP_MODE_NONE: number = 0;
|
||||
@ -17,7 +17,7 @@ const PICKUP_MODE_FULL: number = 2;
|
||||
|
||||
export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const [ pickupMode, setPickupMode ] = useState(0);
|
||||
@ -278,7 +278,7 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
||||
<Column gap={ 1 }>
|
||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||
<Text variant="white" small wrap>{ avatarInfo.name }</Text>
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } />
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
|
||||
</Flex>
|
||||
<hr className="m-0" />
|
||||
</Column>
|
||||
|
@ -6,12 +6,12 @@ import { Base, Column, Flex, LayoutPetImageView, Text, UserProfileIconView } fro
|
||||
interface InfoStandWidgetPetViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoPet;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const InfoStandWidgetPetView: FC<InfoStandWidgetPetViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
|
||||
if(!avatarInfo) return null;
|
||||
|
||||
@ -21,7 +21,7 @@ export const InfoStandWidgetPetView: FC<InfoStandWidgetPetViewProps> = props =>
|
||||
<Column gap={ 1 }>
|
||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||
<Text variant="white" small wrap>{ avatarInfo.name }</Text>
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } />
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
|
||||
</Flex>
|
||||
<Text variant="white" small wrap>{ LocalizeText(`pet.breed.${ avatarInfo.petType }.${ avatarInfo.petBreed }`) }</Text>
|
||||
<hr className="m-0" />
|
||||
|
@ -7,12 +7,12 @@ import { Button, Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text
|
||||
interface InfoStandWidgetRentableBotViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoRentableBot;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const InfoStandWidgetRentableBotView: FC<InfoStandWidgetRentableBotViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
|
||||
const canPickup = useMemo(() =>
|
||||
{
|
||||
@ -34,7 +34,7 @@ export const InfoStandWidgetRentableBotView: FC<InfoStandWidgetRentableBotViewPr
|
||||
<Column gap={ 1 }>
|
||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||
<Text variant="white" small wrap>{ avatarInfo.name }</Text>
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } />
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
|
||||
</Flex>
|
||||
<hr className="m-0" />
|
||||
</Column>
|
||||
|
@ -10,12 +10,12 @@ interface InfoStandWidgetUserViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoUser;
|
||||
setAvatarInfo: Dispatch<SetStateAction<AvatarInfoUser>>;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, setAvatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, setAvatarInfo = null, onClose = null } = props;
|
||||
const [ motto, setMotto ] = useState<string>(null);
|
||||
const [ isEditingMotto, setIsEditingMotto ] = useState(false);
|
||||
const [ relationships, setRelationships ] = useState<RelationshipStatusInfoMessageParser>(null);
|
||||
@ -128,7 +128,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
|
||||
<UserProfileIconView userId={ avatarInfo.webID } />
|
||||
<Text variant="white" small wrap>{ avatarInfo.name }</Text>
|
||||
</Flex>
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } />
|
||||
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
|
||||
</Flex>
|
||||
<hr className="m-0" />
|
||||
</Column>
|
||||
|
@ -11,7 +11,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetAvatarViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoUser;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_NORMAL = 0;
|
||||
@ -24,7 +24,7 @@ const MODE_RELATIONSHIP = 6;
|
||||
|
||||
export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(MODE_NORMAL);
|
||||
const [ respectsLeft, setRespectsLeft ] = useState(0);
|
||||
const { canRequestFriend = null } = useFriends();
|
||||
@ -197,7 +197,7 @@ export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = p
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMenu) close();
|
||||
if(hideMenu) onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -207,7 +207,7 @@ export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = p
|
||||
}, [ avatarInfo ]);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ avatarInfo.userType } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ avatarInfo.userType } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView className="cursor-pointer" onClick={ event => GetUserProfile(avatarInfo.webID) }>
|
||||
{ avatarInfo.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -18,7 +18,7 @@ export const AvatarInfoWidgetDecorateView: FC<AvatarInfoWidgetDecorateViewProps>
|
||||
const { userId = -1, userName = '', roomIndex = -1, setIsDecorating = null } = props;
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ roomIndex } category={ RoomObjectCategory.UNIT } close={ null }>
|
||||
<ContextMenuView objectId={ roomIndex } category={ RoomObjectCategory.UNIT } onClose={ null }>
|
||||
<ContextMenuListView>
|
||||
<ContextMenuListItemView onClick={ event => setIsDecorating(false) }>
|
||||
{ LocalizeText('widget.avatar.stop_decorating') }
|
||||
|
@ -10,12 +10,12 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetFurniViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoFurni;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const AvatarInfoWidgetFurniView: FC<AvatarInfoWidgetFurniViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
|
||||
const processAction = (name: string) =>
|
||||
{
|
||||
@ -42,7 +42,7 @@ export const AvatarInfoWidgetFurniView: FC<AvatarInfoWidgetFurniViewProps> = pro
|
||||
}
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.id } category={ avatarInfo.category } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.id } category={ avatarInfo.category } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView>
|
||||
{ avatarInfo.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -5,12 +5,12 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetNameViewProps
|
||||
{
|
||||
nameInfo: AvatarInfoName;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const AvatarInfoWidgetNameView: FC<AvatarInfoWidgetNameViewProps> = props =>
|
||||
{
|
||||
const { nameInfo = null, close = null } = props;
|
||||
const { nameInfo = null, onClose = null } = props;
|
||||
|
||||
const getClassNames = useMemo(() =>
|
||||
{
|
||||
@ -22,7 +22,7 @@ export const AvatarInfoWidgetNameView: FC<AvatarInfoWidgetNameViewProps> = props
|
||||
}, [ nameInfo ]);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ nameInfo.roomIndex } category={ nameInfo.category } userType={ nameInfo.userType } fades={ (nameInfo.id !== GetSessionDataManager().userId) } classNames={ getClassNames } close={ close }>
|
||||
<ContextMenuView objectId={ nameInfo.roomIndex } category={ nameInfo.category } userType={ nameInfo.userType } fades={ (nameInfo.id !== GetSessionDataManager().userId) } classNames={ getClassNames } onClose={ onClose }>
|
||||
<div className="text-shadow">
|
||||
{ nameInfo.name }
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@ interface AvatarInfoWidgetOwnAvatarViewProps
|
||||
avatarInfo: AvatarInfoUser;
|
||||
isDancing: boolean;
|
||||
setIsDecorating: Dispatch<SetStateAction<boolean>>;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_NORMAL = 0;
|
||||
@ -25,7 +25,7 @@ const MODE_SIGNS = 4;
|
||||
|
||||
export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, isDancing = false, setIsDecorating = null, close = null } = props;
|
||||
const { avatarInfo = null, isDancing = false, setIsDecorating = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState((isDancing && HasHabboClub()) ? MODE_CLUB_DANCES : MODE_NORMAL);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
@ -107,7 +107,7 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMenu) close();
|
||||
if(hideMenu) onClose();
|
||||
}
|
||||
|
||||
const isShowDecorate = () => (avatarInfo.amIOwner || avatarInfo.amIAnyRoomController || (avatarInfo.roomControllerLevel > RoomControllerLevel.GUEST));
|
||||
@ -115,7 +115,7 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
|
||||
const isRidingHorse = IsRidingHorse();
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ avatarInfo.userType } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ avatarInfo.userType } onClose={ onClose } collapsable={ true }>
|
||||
|
||||
<ContextMenuHeaderView className="cursor-pointer" onClick={ event => GetUserProfile(avatarInfo.webID) }>
|
||||
{ avatarInfo.name }
|
||||
|
@ -9,7 +9,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetOwnPetViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoPet;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_NORMAL: number = 0;
|
||||
@ -19,7 +19,7 @@ const MODE_MONSTER_PLANT: number = 3;
|
||||
|
||||
export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(MODE_NORMAL);
|
||||
const [ respectsLeft, setRespectsLeft ] = useState(0);
|
||||
const { roomSession = null } = useRoom();
|
||||
@ -118,7 +118,7 @@ export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = p
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMenu) close();
|
||||
if(hideMenu) onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -136,7 +136,7 @@ export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = p
|
||||
}, [ avatarInfo ]);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView>
|
||||
{ avatarInfo.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -9,7 +9,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetPetViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoPet;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_NORMAL: number = 0;
|
||||
@ -19,7 +19,7 @@ const MODE_MONSTER_PLANT: number = 3;
|
||||
|
||||
export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(MODE_NORMAL);
|
||||
const [ respectsLeft, setRespectsLeft ] = useState(0);
|
||||
const { roomSession = null } = useRoom();
|
||||
@ -85,7 +85,7 @@ export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props =
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMenu) close();
|
||||
if(hideMenu) onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -103,7 +103,7 @@ export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props =
|
||||
}, [ avatarInfo ]);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.PET } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView>
|
||||
{ avatarInfo.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -10,7 +10,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
|
||||
interface AvatarInfoWidgetRentableBotViewProps
|
||||
{
|
||||
avatarInfo: AvatarInfoRentableBot;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_NORMAL = 0;
|
||||
@ -19,7 +19,7 @@ const MODE_CHANGE_MOTTO = 2;
|
||||
|
||||
export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotViewProps> = props =>
|
||||
{
|
||||
const { avatarInfo = null, close = null } = props;
|
||||
const { avatarInfo = null, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(MODE_NORMAL);
|
||||
const [ newName, setNewName ] = useState('');
|
||||
const [ newMotto, setNewMotto ] = useState('');
|
||||
@ -55,7 +55,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
|
||||
parseInt(pieces[2]),
|
||||
((pieces[3]) ? ((pieces[3].toLowerCase() === 'true') || (pieces[3] === '1')) : false)));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
return;
|
||||
@ -120,7 +120,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMenu) close();
|
||||
if(hideMenu) onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -131,7 +131,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
|
||||
const canControl = (avatarInfo.amIOwner || avatarInfo.amIAnyRoomController);
|
||||
|
||||
return (
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.RENTABLE_BOT } close={ close } collapsable={ true }>
|
||||
<ContextMenuView objectId={ avatarInfo.roomIndex } category={ RoomObjectCategory.UNIT } userType={ RoomObjectType.RENTABLE_BOT } onClose={ onClose } collapsable={ true }>
|
||||
<ContextMenuHeaderView>
|
||||
{ avatarInfo.name }
|
||||
</ContextMenuHeaderView>
|
||||
|
@ -8,12 +8,12 @@ interface ChooserWidgetViewProps
|
||||
title: string;
|
||||
items: RoomObjectItem[];
|
||||
selectItem: (item: RoomObjectItem) => void;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props =>
|
||||
{
|
||||
const { title = null, items = [], selectItem = null, close = null } = props;
|
||||
const { title = null, items = [], selectItem = null, onClose = null } = props;
|
||||
const [ selectedItem, setSelectedItem ] = useState<RoomObjectItem>(null);
|
||||
const [ searchValue, setSearchValue ] = useState('');
|
||||
const canSeeId = GetSessionDataManager().isModerator;
|
||||
@ -45,7 +45,7 @@ export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-chooser-widget" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ title } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ title } onCloseClick={ onClose } />
|
||||
<NitroCardContentView overflow="hidden">
|
||||
<input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={ searchValue } onChange={ event => setSearchValue(event.target.value) } />
|
||||
<Column fullHeight overflow="auto">
|
||||
|
@ -6,7 +6,7 @@ import { ChooserWidgetView } from './ChooserWidgetView';
|
||||
|
||||
export const FurniChooserWidgetView: FC<{}> = props =>
|
||||
{
|
||||
const { items = null, close = null, selectItem = null, populateChooser = null } = useFurniChooserWidget();
|
||||
const { items = null, onClose = null, selectItem = null, populateChooser = null } = useFurniChooserWidget();
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -27,5 +27,5 @@ export const FurniChooserWidgetView: FC<{}> = props =>
|
||||
|
||||
if(!items) return null;
|
||||
|
||||
return <ChooserWidgetView title={ LocalizeText('widget.chooser.furni.title') } items={ items } selectItem={ selectItem } close={ close } />;
|
||||
return <ChooserWidgetView title={ LocalizeText('widget.chooser.furni.title') } items={ items } selectItem={ selectItem } onClose={ onClose } />;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import { ChooserWidgetView } from './ChooserWidgetView';
|
||||
|
||||
export const UserChooserWidgetView: FC<{}> = props =>
|
||||
{
|
||||
const { items = null, close = null, selectItem = null, populateChooser = null } = useUserChooserWidget();
|
||||
const { items = null, onClose = null, selectItem = null, populateChooser = null } = useUserChooserWidget();
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -27,5 +27,5 @@ export const UserChooserWidgetView: FC<{}> = props =>
|
||||
|
||||
if(!items) return null;
|
||||
|
||||
return <ChooserWidgetView title={ LocalizeText('widget.chooser.user.title') } items={ items } selectItem={ selectItem } close={ close } />;
|
||||
return <ChooserWidgetView title={ LocalizeText('widget.chooser.user.title') } items={ items } selectItem={ selectItem } onClose={ onClose } />;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ interface ContextMenuViewProps extends BaseProps<HTMLDivElement>
|
||||
category: number;
|
||||
userType?: number;
|
||||
fades?: boolean;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
collapsable?: boolean;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ let FADE_TIME = 1;
|
||||
|
||||
export const ContextMenuView: FC<ContextMenuViewProps> = props =>
|
||||
{
|
||||
const { objectId = -1, category = -1, userType = -1, fades = false, close = null, position = 'absolute', classNames = [], style = {}, children = null, collapsable = false, ...rest } = props;
|
||||
const { objectId = -1, category = -1, userType = -1, fades = false, onClose = null, position = 'absolute', classNames = [], style = {}, children = null, collapsable = false, ...rest } = props;
|
||||
const [ pos, setPos ] = useState<{ x: number, y: number }>({ x: null, y: null });
|
||||
const [ opacity, setOpacity ] = useState(1);
|
||||
const [ isFading, setIsFading ] = useState(false);
|
||||
@ -44,13 +44,13 @@ export const ContextMenuView: FC<ContextMenuViewProps> = props =>
|
||||
|
||||
if(newOpacity <= 0)
|
||||
{
|
||||
close();
|
||||
onClose();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
setOpacity(newOpacity);
|
||||
}, [ isFading, close ]);
|
||||
}, [ isFading, onClose ]);
|
||||
|
||||
const updatePosition = useCallback((bounds: NitroRectangle, location: NitroPoint) =>
|
||||
{
|
||||
|
@ -6,13 +6,13 @@ import { useFurnitureBackgroundColorWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureBackgroundColorView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, hue = 0, setHue = null, saturation = 0, setSaturation = null, lightness = 0, setLightness = null, applyToner = null, toggleToner = null, close = null } = useFurnitureBackgroundColorWidget();
|
||||
const { objectId = -1, hue = 0, setHue = null, saturation = 0, setSaturation = null, lightness = 0, setLightness = null, applyToner = null, toggleToner = null, onClose = null } = useFurnitureBackgroundColorWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView theme="primary-slim" className="nitro-room-widget-toner">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.backgroundcolor.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.backgroundcolor.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView overflow="hidden" justifyContent="between">
|
||||
<Column overflow="auto" gap={ 1 }>
|
||||
<Column>
|
||||
|
@ -4,9 +4,9 @@ import { useFurnitureBadgeDisplayWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureBadgeDisplayView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, color = '1', badgeName = '', badgeDesc = '', date = '', senderName = '', close = null } = useFurnitureBadgeDisplayWidget();
|
||||
const { objectId = -1, color = '1', badgeName = '', badgeDesc = '', date = '', senderName = '', onClose = null } = useFurnitureBadgeDisplayWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return <LayoutTrophyView color={ color } message={ badgeDesc } date={ date } senderName={ senderName } customTitle={ badgeName } onCloseClick={ close } />;
|
||||
return <LayoutTrophyView color={ color } message={ badgeDesc } date={ date } senderName={ senderName } customTitle={ badgeName } onCloseClick={ onClose } />;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export const FurnitureDimmerView: FC<{}> = props =>
|
||||
const [ isVisible, setIsVisible ] = useState(false);
|
||||
const { presets = [], dimmerState = 0, selectedPresetId = 0, color = 0xFFFFFF, brightness = 0xFF, effectId = 0, selectedColor = 0, setSelectedColor = null, selectedBrightness = 0, setSelectedBrightness = null, selectedEffectId = 0, setSelectedEffectId = null, selectPresetId = null, applyChanges } = useFurnitureDimmerWidget();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
FurnitureDimmerUtilities.previewDimmer(color, brightness, (effectId === 2));
|
||||
|
||||
@ -33,7 +33,7 @@ export const FurnitureDimmerView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-room-widget-dimmer">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.dimmer.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.dimmer.title') } onCloseClick={ onClose } />
|
||||
{ (dimmerState === 1) &&
|
||||
<NitroCardTabsView>
|
||||
{ presets.map(preset => <NitroCardTabsItemView key={ preset.id } isActive={ (selectedPresetId === preset.id) } onClick={ event => selectPresetId(preset.id) }>{ LocalizeText(`widget.dimmer.tab.${ preset.id }`) }</NitroCardTabsItemView>) }
|
||||
|
@ -5,13 +5,13 @@ import { useFurnitureExchangeWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureExchangeCreditView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, value = 0, close = null, redeem = null } = useFurnitureExchangeWidget();
|
||||
const { objectId = -1, value = 0, onClose = null, redeem = null } = useFurnitureExchangeWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-widget-exchange-credit" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('catalog.redeem.dialog.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('catalog.redeem.dialog.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex overflow="hidden" gap={ 2 }>
|
||||
<Column center>
|
||||
|
@ -5,13 +5,13 @@ import { useFurnitureExternalImageWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureExternalImageView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, photoData = null, close = null } = useFurnitureExternalImageWidget();
|
||||
const { objectId = -1, photoData = null, onClose = null } = useFurnitureExternalImageWidget();
|
||||
|
||||
if((objectId === -1) || !photoData) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-external-image-widget" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText="" onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText="" onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<Flex center className="picture-preview border border-black" style={ photoData.w ? { backgroundImage: 'url(' + photoData.w + ')' } : {} }>
|
||||
{ !photoData.w &&
|
||||
|
@ -5,7 +5,7 @@ import { useFurnitureFriendFurniWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureFriendFurniView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, type = 0, stage = 0, usernames = [], figures = [], date = null, close = null, respond = null } = useFurnitureFriendFurniWidget();
|
||||
const { objectId = -1, type = 0, stage = 0, usernames = [], figures = [], date = null, onClose = null, respond = null } = useFurnitureFriendFurniWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
@ -13,7 +13,7 @@ export const FurnitureFriendFurniView: FC<{}> = props =>
|
||||
{
|
||||
return (
|
||||
<NitroCardView className="nitro-engraving-lock" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('friend.furniture.confirm.lock.caption') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('friend.furniture.confirm.lock.caption') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<h5 className="text-black text-center fw-bold mt-2 mb-2">
|
||||
{ LocalizeText('friend.furniture.confirm.lock.subtitle') }
|
||||
@ -37,7 +37,7 @@ export const FurnitureFriendFurniView: FC<{}> = props =>
|
||||
return (
|
||||
<DraggableWindow handleSelector=".nitro-engraving-lock-view">
|
||||
<div className={ `nitro-engraving-lock-view engraving-lock-${ type }` }>
|
||||
<div className="engraving-lock-close" onClick={ close } />
|
||||
<div className="engraving-lock-close" onClick={ onClose } />
|
||||
<Flex justifyContent="center">
|
||||
<div className="engraving-lock-avatar">
|
||||
<LayoutAvatarImageView figure={ figures[0] } direction={ 2 } />
|
||||
|
@ -5,13 +5,13 @@ import { useFurniturePresentWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureGiftOpeningView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, classId = -1, itemType = null, text = null, isOwnerOfFurniture = false, senderName = null, senderFigure = null, placedItemId = -1, placedItemType = null, placedInRoom = false, imageUrl = null, openPresent = null, close = null } = useFurniturePresentWidget();
|
||||
const { objectId = -1, classId = -1, itemType = null, text = null, isOwnerOfFurniture = false, senderName = null, senderFigure = null, placedItemId = -1, placedItemType = null, placedInRoom = false, imageUrl = null, openPresent = null, onClose = null } = useFurniturePresentWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-gift-opening" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText(senderName ? 'widget.furni.present.window.title_from' : 'widget.furni.present.window.title', [ 'name' ], [ senderName ]) } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText(senderName ? 'widget.furni.present.window.title_from' : 'widget.furni.present.window.title', [ 'name' ], [ senderName ]) } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
{ (placedItemId === -1) &&
|
||||
<Column overflow="hidden">
|
||||
|
@ -15,7 +15,7 @@ export const FurnitureMannequinView: FC<{}> = props =>
|
||||
{
|
||||
const [ renderedFigure, setRenderedFigure ] = useState<string>(null);
|
||||
const [ mode, setMode ] = useState(MODE_NONE);
|
||||
const { objectId = -1, figure = null, gender = null, clubLevel = HabboClubLevelEnum.NO_CLUB, name = null, setName = null, saveFigure = null, wearFigure = null, saveName = null, close = null } = useFurnitureMannequinWidget();
|
||||
const { objectId = -1, figure = null, gender = null, clubLevel = HabboClubLevelEnum.NO_CLUB, name = null, setName = null, saveFigure = null, wearFigure = null, saveName = null, onClose = null } = useFurnitureMannequinWidget();
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -82,7 +82,7 @@ export const FurnitureMannequinView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-mannequin no-resize" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('mannequin.widget.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('mannequin.widget.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex fullWidth gap={ 2 } overflow="hidden">
|
||||
<Column>
|
||||
|
@ -7,13 +7,13 @@ import { useFurnitureStackHeightWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureStackHeightView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, height = 0, maxHeight = 40, close = null, updateHeight = null } = useFurnitureStackHeightWidget();
|
||||
const { objectId = -1, height = 0, maxHeight = 40, onClose = null, updateHeight = null } = useFurnitureStackHeightWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-widget-custom-stack-height" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.custom.stack.height.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('widget.custom.stack.height.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView justifyContent="between">
|
||||
<Text>{ LocalizeText('widget.custom.stack.height.text') }</Text>
|
||||
<Flex gap={ 2 }>
|
||||
|
@ -17,7 +17,7 @@ const getStickieColorName = (color: string) =>
|
||||
|
||||
export const FurnitureStickieView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, color = '0', text = '', canModify = false, updateColor = null, updateText = null, trash = null, close = null } = useFurnitureStickieWidget();
|
||||
const { objectId = -1, color = '0', text = '', canModify = false, updateColor = null, updateText = null, trash = null, onClose = null } = useFurnitureStickieWidget();
|
||||
const [ isEditing, setIsEditing ] = useState(false);
|
||||
|
||||
useEffect(() =>
|
||||
@ -41,7 +41,7 @@ export const FurnitureStickieView: FC<{}> = props =>
|
||||
}) }
|
||||
</> }
|
||||
</div>
|
||||
<div className="d-flex align-items-center nitro-stickie-image stickie-close header-close" onClick={ close }></div>
|
||||
<div className="d-flex align-items-center nitro-stickie-image stickie-close header-close" onClick={ onClose }></div>
|
||||
</div>
|
||||
<div className="stickie-context">
|
||||
{ !isEditing ? <div className="context-text" onClick={ event => setIsEditing(true) }>{ text }</div> : <textarea className="context-text" defaultValue={ text } tabIndex={ 0 } onBlur={ event => updateText(event.target.value) } autoFocus></textarea> }
|
||||
|
@ -4,9 +4,9 @@ import { useFurnitureTrophyWidget } from '../../../../hooks';
|
||||
|
||||
export const FurnitureTrophyView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, color = '1', senderName = '', date = '', message = '', close = null } = useFurnitureTrophyWidget();
|
||||
const { objectId = -1, color = '1', senderName = '', date = '', message = '', onClose = null } = useFurnitureTrophyWidget();
|
||||
|
||||
if(objectId === -1) return null;
|
||||
|
||||
return <LayoutTrophyView color={ color } message={ message } date={ date } senderName={ senderName } onCloseClick={ close } />;
|
||||
return <LayoutTrophyView color={ color } message={ message } date={ date } senderName={ senderName } onCloseClick={ onClose } />;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { useFurnitureYoutubeWidget } from '../../../../hooks';
|
||||
export const FurnitureYoutubeDisplayView: FC<{}> = props =>
|
||||
{
|
||||
const [ player, setPlayer ] = useState<any>(null);
|
||||
const { objectId = -1, videoId = null, videoStart = 0, videoEnd = 0, currentVideoState = null, selectedVideo = null, playlists = [], close = null, previous = null, next = null, pause = null, play = null, selectVideo = null } = useFurnitureYoutubeWidget();
|
||||
const { objectId = -1, videoId = null, videoStart = 0, videoEnd = 0, currentVideoState = null, selectedVideo = null, playlists = [], onClose = null, previous = null, next = null, pause = null, play = null, selectVideo = null } = useFurnitureYoutubeWidget();
|
||||
|
||||
const onStateChange = useCallback((event: { target: YouTubePlayer; data: number }) =>
|
||||
{
|
||||
@ -69,7 +69,7 @@ export const FurnitureYoutubeDisplayView: FC<{}> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView className="youtube-tv-widget">
|
||||
<NitroCardHeaderView headerText={ '' } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ '' } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<div className="row w-100 h-100">
|
||||
<div className="youtube-video-container col-9">
|
||||
|
@ -6,30 +6,30 @@ import { useRoom } from '../../../../../hooks';
|
||||
interface EffectBoxConfirmViewProps
|
||||
{
|
||||
objectId: number;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const EffectBoxConfirmView: FC<EffectBoxConfirmViewProps> = props =>
|
||||
{
|
||||
const { objectId = -1, close = null } = props;
|
||||
const { objectId = -1, onClose = null } = props;
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const useProduct = () =>
|
||||
{
|
||||
roomSession.useMultistateItem(objectId);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-use-product-confirmation">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('effectbox.header.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('effectbox.header.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex gap={ 2 }>
|
||||
<Column justifyContent="between">
|
||||
<Text>{ LocalizeText('effectbox.header.description') }</Text>
|
||||
<Flex alignItems="center" justifyContent="between">
|
||||
<Button variant="danger" onClick={ close }>{ LocalizeText('generic.cancel') }</Button>
|
||||
<Button variant="danger" onClick={ onClose }>{ LocalizeText('generic.cancel') }</Button>
|
||||
<Button variant="success" onClick={ useProduct }>{ LocalizeText('generic.ok') }</Button>
|
||||
</Flex>
|
||||
</Column>
|
||||
|
@ -16,18 +16,18 @@ const EFFECTBOX_OPEN: string = 'EFFECTBOX_OPEN';
|
||||
|
||||
export const FurnitureContextMenuView: FC<{}> = props =>
|
||||
{
|
||||
const { closeConfirm = null, processAction = null, objectId = -1, mode = null, confirmMode = null, confirmingObjectId = -1, groupData = null, isGroupMember = false } = useFurnitureContextMenuWidget();
|
||||
const { closeConfirm = null, processAction = null, onClose = null, objectId = -1, mode = null, confirmMode = null, confirmingObjectId = -1, groupData = null, isGroupMember = false } = useFurnitureContextMenuWidget();
|
||||
|
||||
return (
|
||||
<>
|
||||
{ (confirmMode === MONSTERPLANT_SEED_CONFIRMATION) &&
|
||||
<MonsterPlantSeedConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> }
|
||||
<MonsterPlantSeedConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
|
||||
{ (confirmMode === PURCHASABLE_CLOTHING_CONFIRMATION) &&
|
||||
<PurchasableClothingConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> }
|
||||
<PurchasableClothingConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
|
||||
{ (confirmMode === EFFECTBOX_OPEN) &&
|
||||
<EffectBoxConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> }
|
||||
<EffectBoxConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
|
||||
{ (objectId >= 0) && mode &&
|
||||
<ContextMenuView objectId={ objectId } category={ RoomObjectCategory.FLOOR } close={ close } fades={ true }>
|
||||
<ContextMenuView objectId={ objectId } category={ RoomObjectCategory.FLOOR } onClose={ onClose } fades={ true }>
|
||||
{ (mode === ContextMenuEnum.FRIEND_FURNITURE) &&
|
||||
<>
|
||||
<ContextMenuHeaderView>
|
||||
|
@ -7,7 +7,7 @@ import { useRoom } from '../../../../../hooks';
|
||||
interface MonsterPlantSeedConfirmViewProps
|
||||
{
|
||||
objectId: number;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_DEFAULT: number = -1;
|
||||
@ -15,7 +15,7 @@ const MODE_MONSTERPLANT_SEED: number = 0;
|
||||
|
||||
export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> = props =>
|
||||
{
|
||||
const { objectId = -1, close = null } = props;
|
||||
const { objectId = -1, onClose = null } = props;
|
||||
const [ furniData, setFurniData ] = useState<IFurnitureData>(null);
|
||||
const [ mode, setMode ] = useState(MODE_DEFAULT);
|
||||
const { roomSession = null } = useRoom();
|
||||
@ -24,7 +24,7 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
|
||||
{
|
||||
roomSession.useMultistateItem(objectId);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -48,19 +48,19 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
|
||||
|
||||
if(mode === MODE_DEFAULT)
|
||||
{
|
||||
close();
|
||||
onClose();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setMode(mode);
|
||||
}, [ roomSession, objectId, close ]);
|
||||
}, [ roomSession, objectId, onClose ]);
|
||||
|
||||
if(mode === MODE_DEFAULT) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-use-product-confirmation">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title.plant_seed', [ 'name' ], [ furniData.name ]) } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title.plant_seed', [ 'name' ], [ furniData.name ]) } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex gap={ 2 } overflow="hidden">
|
||||
<Column>
|
||||
@ -74,7 +74,7 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
|
||||
<Text>{ LocalizeText('useproduct.widget.info.plant_seed') }</Text>
|
||||
</Column>
|
||||
<Flex alignItems="center" justifyContent="between">
|
||||
<Button variant="danger" onClick={ close }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="danger" onClick={ onClose }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="success" onClick={ useProduct }>{ LocalizeText('widget.monsterplant_seed.button.use') }</Button>
|
||||
</Flex>
|
||||
</Column>
|
||||
|
@ -7,7 +7,7 @@ import { useRoom } from '../../../../../hooks';
|
||||
interface PurchasableClothingConfirmViewProps
|
||||
{
|
||||
objectId: number;
|
||||
close: () => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const MODE_DEFAULT: number = -1;
|
||||
@ -15,7 +15,7 @@ const MODE_PURCHASABLE_CLOTHING: number = 0;
|
||||
|
||||
export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewProps> = props =>
|
||||
{
|
||||
const { objectId = -1, close = null } = props;
|
||||
const { objectId = -1, onClose = null } = props;
|
||||
const [ mode, setMode ] = useState(MODE_DEFAULT);
|
||||
const [ gender, setGender ] = useState<string>(FigureData.MALE);
|
||||
const [ newFigure, setNewFigure ] = useState<string>(null);
|
||||
@ -26,7 +26,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
|
||||
GetConnection().send(new RedeemItemClothingComposer(objectId));
|
||||
GetConnection().send(new UserFigureComposer(gender, newFigure));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
useEffect(() =>
|
||||
@ -62,7 +62,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
|
||||
|
||||
if(mode === MODE_DEFAULT)
|
||||
{
|
||||
close();
|
||||
onClose();
|
||||
|
||||
return;
|
||||
}
|
||||
@ -73,13 +73,13 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
|
||||
// if owns clothing, change to it
|
||||
|
||||
setMode(mode);
|
||||
}, [ roomSession, objectId, close ]);
|
||||
}, [ roomSession, objectId, onClose ]);
|
||||
|
||||
if(mode === MODE_DEFAULT) return null;
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-use-product-confirmation">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title.bind_clothing') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('useproduct.widget.title.bind_clothing') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView center>
|
||||
<Flex gap={ 2 } overflow="hidden">
|
||||
<Column>
|
||||
@ -93,7 +93,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
|
||||
<Text>{ LocalizeText('useproduct.widget.info.bind_clothing') }</Text>
|
||||
</Column>
|
||||
<Flex alignItems="center" justifyContent="between">
|
||||
<Button variant="danger" onClick={ close }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="danger" onClick={ onClose }>{ LocalizeText('useproduct.widget.cancel') }</Button>
|
||||
<Button variant="success" onClick={ useProduct }>{ LocalizeText('useproduct.widget.bind_clothing') }</Button>
|
||||
</Flex>
|
||||
</Column>
|
||||
|
@ -21,7 +21,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
|
||||
const [ needsSave, setNeedsSave ] = useState<boolean>(false);
|
||||
const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null, saveWired = null } = useWired();
|
||||
|
||||
const close = () => setTrigger(null);
|
||||
const onClose = () => setTrigger(null);
|
||||
|
||||
const onSave = () =>
|
||||
{
|
||||
@ -85,7 +85,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
|
||||
|
||||
return (
|
||||
<NitroCardView uniqueKey="nitro-wired" className="nitro-wired" theme="primary-slim">
|
||||
<NitroCardHeaderView headerText={ LocalizeText('wiredfurni.title') } onCloseClick={ close } />
|
||||
<NitroCardHeaderView headerText={ LocalizeText('wiredfurni.title') } onCloseClick={ onClose } />
|
||||
<NitroCardContentView>
|
||||
<Column gap={ 1 }>
|
||||
<Flex alignItems="center" gap={ 1 }>
|
||||
@ -103,7 +103,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
|
||||
</> }
|
||||
<Flex alignItems="center" gap={ 1 }>
|
||||
<Button fullWidth variant="success" onClick={ onSave }>{ LocalizeText('wiredfurni.ready') }</Button>
|
||||
<Button fullWidth variant="secondary" onClick={ close }>{ LocalizeText('cancel') }</Button>
|
||||
<Button fullWidth variant="secondary" onClick={ onClose }>{ LocalizeText('cancel') }</Button>
|
||||
</Flex>
|
||||
</NitroCardContentView>
|
||||
</NitroCardView>
|
||||
|
@ -17,7 +17,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
|
||||
const applyToner = () => SendMessageComposer(new ApplyTonerComposer(objectId, hue, saturation, lightness));
|
||||
const toggleToner = () => roomSession.useMultistateItem(objectId);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.CLEAR_PREVIEW));
|
||||
|
||||
@ -46,7 +46,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
useEffect(() =>
|
||||
@ -56,7 +56,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
|
||||
DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.PREVIEW, hue, saturation, lightness));
|
||||
}, [ objectId, category, hue, saturation, lightness ]);
|
||||
|
||||
return { objectId, hue, setHue, saturation, setSaturation, lightness, setLightness, applyToner, toggleToner, close };
|
||||
return { objectId, hue, setHue, saturation, setSaturation, lightness, setLightness, applyToner, toggleToner, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureBackgroundColorWidget = useFurnitureBackgroundColorWidgetState;
|
||||
|
@ -16,7 +16,7 @@ const useFurnitureBadgeDisplayWidgetState = () =>
|
||||
const [ senderName, setSenderName ] = useState('');
|
||||
const { simpleAlert = null } = useNotification();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -66,10 +66,10 @@ const useFurnitureBadgeDisplayWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, category, color, badgeName, badgeDesc, date, senderName, close };
|
||||
return { objectId, category, color, badgeName, badgeDesc, date, senderName, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureBadgeDisplayWidget = useFurnitureBadgeDisplayWidgetState;
|
||||
|
@ -19,7 +19,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
const [ isGroupMember, setIsGroupMember ] = useState(false);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const close = useCallback(() =>
|
||||
const onClose = useCallback(() =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setGroupData(null);
|
||||
@ -63,7 +63,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
}
|
||||
}
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>([
|
||||
@ -86,7 +86,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
setConfirmingObjectId(object.id);
|
||||
setConfirmMode(MONSTERPLANT_SEED_CONFIRMATION);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
return;
|
||||
case RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG:
|
||||
if(!IsOwnerOfFurniture(object)) return;
|
||||
@ -94,7 +94,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
setConfirmingObjectId(object.id);
|
||||
setConfirmMode(EFFECTBOX_OPEN);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
return;
|
||||
case RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:
|
||||
if(!IsOwnerOfFurniture(object)) return;
|
||||
@ -102,7 +102,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
setConfirmingObjectId(object.id);
|
||||
setConfirmMode(PURCHASABLE_CLOTHING_CONFIRMATION);
|
||||
|
||||
close();
|
||||
onClose();
|
||||
return;
|
||||
case RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU:
|
||||
|
||||
@ -128,7 +128,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
|
||||
return;
|
||||
case RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU:
|
||||
if(object.id === objectId) close();
|
||||
if(object.id === objectId) onClose();
|
||||
return;
|
||||
}
|
||||
});
|
||||
@ -143,7 +143,7 @@ const useFurnitureContextMenuWidgetState = () =>
|
||||
setMode(GROUP_FURNITURE);
|
||||
});
|
||||
|
||||
return { objectId, mode, confirmMode, confirmingObjectId, groupData, isGroupMember, closeConfirm, processAction };
|
||||
return { objectId, mode, confirmMode, confirmingObjectId, groupData, isGroupMember, closeConfirm, processAction, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureContextMenuWidget = useFurnitureContextMenuWidgetState;
|
||||
|
@ -10,7 +10,7 @@ const useFurnitureExchangeWidgetState = () =>
|
||||
const [ category, setCategory ] = useState(-1);
|
||||
const [ value, setValue ] = useState(0);
|
||||
|
||||
const close = useCallback(() =>
|
||||
const onClose = useCallback(() =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -21,7 +21,7 @@ const useFurnitureExchangeWidgetState = () =>
|
||||
{
|
||||
GetRoomSession().connection.send(new FurnitureExchangeComposer(objectId));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, event =>
|
||||
@ -39,10 +39,10 @@ const useFurnitureExchangeWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, value, redeem, close };
|
||||
return { objectId, value, redeem, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureExchangeWidget = useFurnitureExchangeWidgetState;
|
||||
|
@ -10,7 +10,7 @@ const useFurnitureExternalImageWidgetState = () =>
|
||||
const [ category, setCategory ] = useState(-1);
|
||||
const [ photoData, setPhotoData ] = useState<IPhotoData>(null);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -35,10 +35,10 @@ const useFurnitureExternalImageWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, photoData, close };
|
||||
return { objectId, photoData, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureExternalImageWidget = useFurnitureExternalImageWidgetState;
|
||||
|
@ -14,7 +14,7 @@ const useFurnitureFriendFurniWidgetState = () =>
|
||||
const [ date, setDate ] = useState<string>(null);
|
||||
const [ stage, setStage ] = useState(0);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -28,7 +28,7 @@ const useFurnitureFriendFurniWidgetState = () =>
|
||||
{
|
||||
GetRoomSession().connection.send(new FriendFurniConfirmLockMessageComposer(objectId, flag));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
useMessageEvent<LoveLockFurniStartEvent>(LoveLockFurniStartEvent, event =>
|
||||
@ -39,8 +39,8 @@ const useFurnitureFriendFurniWidgetState = () =>
|
||||
setStage(parser.start ? 1 : 2);
|
||||
});
|
||||
|
||||
useMessageEvent<LoveLockFurniFinishedEvent>(LoveLockFurniFinishedEvent, event => close());
|
||||
useMessageEvent<LoveLockFurniFriendConfirmedEvent>(LoveLockFurniFriendConfirmedEvent, event => close());
|
||||
useMessageEvent<LoveLockFurniFinishedEvent>(LoveLockFurniFinishedEvent, event => onClose());
|
||||
useMessageEvent<LoveLockFurniFriendConfirmedEvent>(LoveLockFurniFriendConfirmedEvent, event => onClose());
|
||||
|
||||
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, event =>
|
||||
{
|
||||
@ -66,10 +66,10 @@ const useFurnitureFriendFurniWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, type, usernames, figures, date, stage, close, respond };
|
||||
return { objectId, type, usernames, figures, date, stage, onClose, respond };
|
||||
}
|
||||
|
||||
export const useFurnitureFriendFurniWidget = useFurnitureFriendFurniWidgetState;
|
||||
|
@ -13,7 +13,7 @@ const useFurnitureMannequinWidgetState = () =>
|
||||
const [ clubLevel, setClubLevel ] = useState(HabboClubLevelEnum.NO_CLUB);
|
||||
const [ name, setName ] = useState(null);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -28,7 +28,7 @@ const useFurnitureMannequinWidgetState = () =>
|
||||
|
||||
SendMessageComposer(new FurnitureMannequinSaveLookComposer(objectId));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
const wearFigure = () =>
|
||||
@ -37,7 +37,7 @@ const useFurnitureMannequinWidgetState = () =>
|
||||
|
||||
SendMessageComposer(new FurnitureMultiStateComposer(objectId));
|
||||
|
||||
close();
|
||||
onClose();
|
||||
}
|
||||
|
||||
const saveName = () =>
|
||||
@ -71,10 +71,10 @@ const useFurnitureMannequinWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, figure, gender, clubLevel, name, setName, saveFigure, wearFigure, saveName, close };
|
||||
return { objectId, figure, gender, clubLevel, name, setName, saveFigure, wearFigure, saveName, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureMannequinWidget = useFurnitureMannequinWidgetState;
|
||||
|
@ -25,7 +25,7 @@ const useFurniturePresentWidgetState = () =>
|
||||
const [ imageUrl, setImageUrl ] = useState<string>(null);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setClassId(-1);
|
||||
@ -199,7 +199,7 @@ const useFurniturePresentWidgetState = () =>
|
||||
|
||||
if(!roomObject) return null;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
|
||||
setObjectId(event.objectId);
|
||||
setClassId(-1);
|
||||
@ -211,7 +211,7 @@ const useFurniturePresentWidgetState = () =>
|
||||
|
||||
useFurniRemovedEvent((objectId !== -1), event =>
|
||||
{
|
||||
if(event.id === objectId) close();
|
||||
if(event.id === objectId) onClose();
|
||||
|
||||
if(event.id === placedItemId)
|
||||
{
|
||||
@ -219,7 +219,7 @@ const useFurniturePresentWidgetState = () =>
|
||||
}
|
||||
});
|
||||
|
||||
return { objectId, classId, itemType, text, isOwnerOfFurniture, senderName, senderFigure, placedItemId, placedItemType, placedInRoom, imageUrl, openPresent, close };
|
||||
return { objectId, classId, itemType, text, isOwnerOfFurniture, senderName, senderFigure, placedItemId, placedItemType, placedInRoom, imageUrl, openPresent, onClose };
|
||||
}
|
||||
|
||||
export const useFurniturePresentWidget = useFurniturePresentWidgetState;
|
||||
|
@ -13,7 +13,7 @@ const useFurnitureStackHeightWidgetState = () =>
|
||||
const [ height, setHeight ] = useState(0);
|
||||
const [ pendingHeight, setPendingHeight ] = useState(-1);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -61,7 +61,7 @@ const useFurnitureStackHeightWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
useEffect(() =>
|
||||
@ -73,7 +73,7 @@ const useFurnitureStackHeightWidgetState = () =>
|
||||
return () => clearTimeout(timeout);
|
||||
}, [ objectId, pendingHeight ]);
|
||||
|
||||
return { objectId, height, maxHeight: MAX_HEIGHT, close, updateHeight };
|
||||
return { objectId, height, maxHeight: MAX_HEIGHT, onClose, updateHeight };
|
||||
}
|
||||
|
||||
export const useFurnitureStackHeightWidget = useFurnitureStackHeightWidgetState;
|
||||
|
@ -12,7 +12,7 @@ const useFurnitureStickieWidgetState = () =>
|
||||
const [ text, setText ] = useState('');
|
||||
const [ canModify, setCanModify ] = useState(false);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -73,10 +73,10 @@ const useFurnitureStickieWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, color, text, canModify, updateColor, updateText, trash, close };
|
||||
return { objectId, color, text, canModify, updateColor, updateText, trash, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureStickieWidget = useFurnitureStickieWidgetState;
|
||||
|
@ -13,7 +13,7 @@ const useFurnitureTrophyWidgetState = () =>
|
||||
const [ date, setDate ] = useState('');
|
||||
const [ message, setMessage ] = useState('');
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -54,10 +54,10 @@ const useFurnitureTrophyWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, color, senderName, date, message, close };
|
||||
return { objectId, color, senderName, date, message, onClose };
|
||||
}
|
||||
|
||||
export const useFurnitureTrophyWidget = useFurnitureTrophyWidgetState;
|
||||
|
@ -21,7 +21,7 @@ const useFurnitureYoutubeWidgetState = () =>
|
||||
const [ playlists, setPlaylists ] = useState<YoutubeDisplayPlaylist[]>(null);
|
||||
const [ hasControl, setHasControl ] = useState(false);
|
||||
|
||||
const close = () =>
|
||||
const onClose = () =>
|
||||
{
|
||||
setObjectId(-1);
|
||||
setCategory(-1);
|
||||
@ -118,10 +118,10 @@ const useFurnitureYoutubeWidgetState = () =>
|
||||
{
|
||||
if((event.id !== objectId) || (event.category !== category)) return;
|
||||
|
||||
close();
|
||||
onClose();
|
||||
});
|
||||
|
||||
return { objectId, videoId, videoStart, videoEnd, currentVideoState, selectedVideo, playlists, close, previous, next, pause, play, selectVideo };
|
||||
return { objectId, videoId, videoStart, videoEnd, currentVideoState, selectedVideo, playlists, onClose, previous, next, pause, play, selectVideo };
|
||||
}
|
||||
|
||||
export const useFurnitureYoutubeWidget = useFurnitureYoutubeWidgetState;
|
||||
|
@ -9,7 +9,7 @@ const useFurniChooserWidgetState = () =>
|
||||
const [ items, setItems ] = useState<RoomObjectItem[]>(null);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const close = () => setItems(null);
|
||||
const onClose = () => setItems(null);
|
||||
|
||||
const selectItem = (item: RoomObjectItem) => item && GetRoomEngine().selectRoomObject(GetRoomSession().roomId, item.id, item.category);
|
||||
|
||||
@ -126,7 +126,7 @@ const useFurniChooserWidgetState = () =>
|
||||
});
|
||||
});
|
||||
|
||||
return { items, close, selectItem, populateChooser };
|
||||
return { items, onClose, selectItem, populateChooser };
|
||||
}
|
||||
|
||||
export const useFurniChooserWidget = useFurniChooserWidgetState;
|
||||
|
@ -9,7 +9,7 @@ const useUserChooserWidgetState = () =>
|
||||
const [ items, setItems ] = useState<RoomObjectItem[]>(null);
|
||||
const { roomSession = null } = useRoom();
|
||||
|
||||
const close = () => setItems(null);
|
||||
const onClose = () => setItems(null);
|
||||
|
||||
const selectItem = (item: RoomObjectItem) => item && GetRoomEngine().selectRoomObject(GetRoomSession().roomId, item.id, item.category);
|
||||
|
||||
@ -74,7 +74,7 @@ const useUserChooserWidgetState = () =>
|
||||
});
|
||||
});
|
||||
|
||||
return { items, close, selectItem, populateChooser };
|
||||
return { items, onClose, selectItem, populateChooser };
|
||||
}
|
||||
|
||||
export const useUserChooserWidget = useUserChooserWidgetState;
|
||||
|
Loading…
Reference in New Issue
Block a user