Rename all close functions to onClose

This commit is contained in:
Bill 2022-07-27 19:08:53 -04:00
parent a183c9c0ac
commit ea185a441a
74 changed files with 252 additions and 252 deletions

View File

@ -22,7 +22,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
setIsOpen(prevValue => !prevValue); setIsOpen(prevValue => !prevValue);
} }
const close = useCallback(() => setIsOpen(false), []); const onClose = useCallback(() => setIsOpen(false), []);
const getClassNames = useMemo(() => const getClassNames = useMemo(() =>
{ {
@ -42,7 +42,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
useEffect(() => useEffect(() =>
{ {
const closeFunction = close; const closeFunction = onClose;
setClosers(prevValue => setClosers(prevValue =>
{ {
@ -66,7 +66,7 @@ export const NitroCardAccordionSetView: FC<NitroCardAccordionSetViewProps> = pro
return newClosers; return newClosers;
}); });
} }
}, [ close, setClosers ]); }, [ onClose, setClosers ]);
return ( return (
<Column classNames={ getClassNames } gap={ gap } { ...rest }> <Column classNames={ getClassNames } gap={ gap } { ...rest }>

View File

@ -6,12 +6,12 @@ export interface LayoutNotificationAlertViewProps extends NitroCardViewProps
{ {
title?: string; title?: string;
type?: string; type?: string;
close: () => void; onClose: () => void;
} }
export const LayoutNotificationAlertView: FC<LayoutNotificationAlertViewProps> = props => 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(() => const getClassNames = useMemo(() =>
{ {
@ -26,7 +26,7 @@ export const LayoutNotificationAlertView: FC<LayoutNotificationAlertViewProps> =
return ( return (
<NitroCardView classNames={ getClassNames } theme="primary-slim" { ...rest }> <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 }> <NitroCardContentView grow justifyContent="between" overflow="hidden" className="text-black" gap={ 0 }>
{ children } { children }
</NitroCardContentView> </NitroCardContentView>

View File

@ -6,12 +6,12 @@ export interface LayoutNotificationBubbleViewProps extends FlexProps
{ {
fadesOut?: boolean; fadesOut?: boolean;
timeoutMs?: number; timeoutMs?: number;
close: () => void; onClose: () => void;
} }
export const LayoutNotificationBubbleView: FC<LayoutNotificationBubbleViewProps> = props => 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 [ isVisible, setIsVisible ] = useState(false);
const getClassNames = useMemo(() => const getClassNames = useMemo(() =>
@ -38,15 +38,15 @@ export const LayoutNotificationBubbleView: FC<LayoutNotificationBubbleViewProps>
{ {
setIsVisible(false); setIsVisible(false);
setTimeout(() => close(), 300); setTimeout(() => onClose(), 300);
}, timeoutMs); }, timeoutMs);
return () => clearTimeout(timeout); return () => clearTimeout(timeout);
}, [ fadesOut, timeoutMs, close ]); }, [ fadesOut, timeoutMs, onClose ]);
return ( return (
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isVisible } timeout={ 300 }> <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> </TransitionAnimation>
); );
} }

View File

@ -5,7 +5,7 @@ import { CalendarItemView } from './CalendarItemView';
interface CalendarViewProps interface CalendarViewProps
{ {
close(): void; onClose(): void;
openPackage(id: number, asStaff: boolean): void; openPackage(id: number, asStaff: boolean): void;
receivedProducts: Map<number, ICalendarItem>; receivedProducts: Map<number, ICalendarItem>;
campaignName: string; campaignName: string;
@ -19,7 +19,7 @@ const TOTAL_SHOWN_ITEMS = 5;
export const CalendarView: FC<CalendarViewProps> = props => 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 [ selectedDay, setSelectedDay ] = useState(currentDay);
const [ index, setIndex ] = useState(Math.max(0, (selectedDay - 1))); const [ index, setIndex ] = useState(Math.max(0, (selectedDay - 1)));
@ -97,7 +97,7 @@ export const CalendarView: FC<CalendarViewProps> = props =>
return ( return (
<NitroCardView className="nitro-campaign-calendar" theme="primary-slim"> <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> <NitroCardContentView>
<Grid fullHeight={ false } justifyContent="between" alignItems="center"> <Grid fullHeight={ false } justifyContent="between" alignItems="center">
<Column size={ 1 } /> <Column size={ 1 } />

View File

@ -103,7 +103,7 @@ export const CampaignView: FC<{}> = props =>
return ( return (
<> <>
{ (calendarData && isCalendarOpen) && { (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 } />
} }
</> </>
) )

View File

@ -26,7 +26,7 @@ export const CatalogGiftView: FC<{}> = props =>
const { catalogOptions = null } = useCatalog(); const { catalogOptions = null } = useCatalog();
const { giftConfiguration = null } = catalogOptions; const { giftConfiguration = null } = catalogOptions;
const close = useCallback(() => const onClose = useCallback(() =>
{ {
setIsVisible(false); setIsVisible(false);
setPageId(0); setPageId(0);
@ -46,12 +46,12 @@ export const CatalogGiftView: FC<{}> = props =>
switch(event.type) switch(event.type)
{ {
case CatalogPurchasedEvent.PURCHASE_SUCCESS: case CatalogPurchasedEvent.PURCHASE_SUCCESS:
close(); onClose();
return; return;
case CatalogEvent.INIT_GIFT: case CatalogEvent.INIT_GIFT:
const castedEvent = (event as CatalogInitGiftEvent); const castedEvent = (event as CatalogInitGiftEvent);
close(); onClose();
setPageId(castedEvent.pageId); setPageId(castedEvent.pageId);
setOfferId(castedEvent.offerId); setOfferId(castedEvent.offerId);
@ -59,7 +59,7 @@ export const CatalogGiftView: FC<{}> = props =>
setIsVisible(true); setIsVisible(true);
return; return;
} }
}, [ close ]); }, [ onClose ]);
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent); useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
useUiEvent(CatalogEvent.INIT_GIFT, onCatalogEvent); useUiEvent(CatalogEvent.INIT_GIFT, onCatalogEvent);
@ -158,7 +158,7 @@ export const CatalogGiftView: FC<{}> = props =>
return ( return (
<NitroCardView uniqueKey="catalog-gift" className="nitro-catalog-gift" theme="primary-slim"> <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"> <NitroCardContentView className="text-black">
<FormGroup column> <FormGroup column>
<Text>{ LocalizeText('catalog.gift_wrapping.receiver') }</Text> <Text>{ LocalizeText('catalog.gift_wrapping.receiver') }</Text>
@ -216,7 +216,7 @@ export const CatalogGiftView: FC<{}> = props =>
</ButtonGroup> </ButtonGroup>
</Column> </Column>
<Flex justifyContent="between" alignItems="center"> <Flex justifyContent="between" alignItems="center">
<Button variant="link" onClick={ close } className="text-black"> <Button variant="link" onClick={ onClose } className="text-black">
{ LocalizeText('cancel') } { LocalizeText('cancel') }
</Button> </Button>
<Button variant="success" onClick={ () => handleAction('buy') }> <Button variant="success" onClick={ () => handleAction('buy') }>

View File

@ -24,7 +24,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
const [ availableRooms, setAvailableRooms ] = useState<{ id: number, name: string }[]>(null); const [ availableRooms, setAvailableRooms ] = useState<{ id: number, name: string }[]>(null);
const [ purchaseCost, setPurchaseCost ] = useState<number>(0); const [ purchaseCost, setPurchaseCost ] = useState<number>(0);
const close = () => const onCloseClose = () =>
{ {
setCloseAction(null); setCloseAction(null);
setGroupData(null); setGroupData(null);
@ -121,7 +121,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
return ( return (
<NitroCardView className="nitro-group-creator" theme="primary-slim"> <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> <NitroCardContentView>
<Flex center className="creator-tabs"> <Flex center className="creator-tabs">
{ TABS.map((tab, index) => { TABS.map((tab, index) =>

View File

@ -86,7 +86,7 @@ export const GroupManagerView: FC<{}> = props =>
return ( return (
<NitroCardView className="nitro-group-manager"> <NitroCardView className="nitro-group-manager">
<NitroCardHeaderView headerText={ LocalizeText('group.window.title') } onCloseClick={ close } /> <NitroCardHeaderView headerText={ LocalizeText('group.window.title') } onCloseClick={ onClose } />
<NitroCardTabsView> <NitroCardTabsView>
{ TABS.map(tab => { TABS.map(tab =>
{ {

View File

@ -17,7 +17,7 @@ export const HelpView: FC<{}> = props =>
const [ isVisible, setIsVisible ] = useState(false); const [ isVisible, setIsVisible ] = useState(false);
const { activeReport = null, setActiveReport = null, report = null } = useHelp(); const { activeReport = null, setActiveReport = null, report = null } = useHelp();
const close = () => const onClose = () =>
{ {
setActiveReport(null); setActiveReport(null);
setIsVisible(false); setIsVisible(false);
@ -98,7 +98,7 @@ export const HelpView: FC<{}> = props =>
return ( return (
<> <>
<NitroCardView className="nitro-help" theme="primary-slim"> <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"> <NitroCardContentView className="text-black">
<Grid> <Grid>
<Column center size={ 5 } overflow="hidden"> <Column center size={ 5 } overflow="hidden">

View File

@ -25,7 +25,7 @@ export const InventoryView: FC<{}> = props =>
const { isTrading = false, stopTrading = null } = useInventoryTrade(); const { isTrading = false, stopTrading = null } = useInventoryTrade();
const { getCount = null, resetCategory = null } = useInventoryUnseenTracker(); const { getCount = null, resetCategory = null } = useInventoryUnseenTracker();
const close = () => const onClose = () =>
{ {
if(isTrading) stopTrading(); if(isTrading) stopTrading();
@ -123,7 +123,7 @@ export const InventoryView: FC<{}> = props =>
return ( return (
<NitroCardView uniqueKey={ 'inventory' } className="nitro-inventory" theme={ isTrading ? 'primary-slim' : '' } > <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 && { !isTrading &&
<> <>
<NitroCardTabsView> <NitroCardTabsView>
@ -149,7 +149,7 @@ export const InventoryView: FC<{}> = props =>
</> } </> }
{ isTrading && { isTrading &&
<NitroCardContentView> <NitroCardContentView>
<InventoryTradeView cancelTrade={ close } /> <InventoryTradeView cancelTrade={ onClose } />
</NitroCardContentView> } </NitroCardContentView> }
</NitroCardView> </NitroCardView>
); );

View File

@ -12,7 +12,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
const [ password, setPassword ] = useState(''); const [ password, setPassword ] = useState('');
const { doorData = null, setDoorData = null } = useNavigatorContext(); const { doorData = null, setDoorData = null } = useNavigatorContext();
const close = () => const onClose = () =>
{ {
if(doorData && (doorData.state === DoorStateType.STATE_WAITING)) GoToDesktop(); if(doorData && (doorData.state === DoorStateType.STATE_WAITING)) GoToDesktop();
@ -64,7 +64,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
return ( return (
<NitroCardView className="nitro-navigator-doorbell" theme="primary-slim"> <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> <NitroCardContentView>
<Column gap={ 1 }> <Column gap={ 1 }>
<Text bold>{ doorData && doorData.roomInfo && doorData.roomInfo.roomName }</Text> <Text bold>{ doorData && doorData.roomInfo && doorData.roomInfo.roomName }</Text>
@ -85,7 +85,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
<Button variant="success" onClick={ ring }> <Button variant="success" onClick={ ring }>
{ LocalizeText('navigator.doorbell.button.ring') } { LocalizeText('navigator.doorbell.button.ring') }
</Button> } </Button> }
<Button variant="danger" onClick={ close }> <Button variant="danger" onClick={ onClose }>
{ LocalizeText('generic.cancel') } { LocalizeText('generic.cancel') }
</Button> </Button>
</Column> } </Column> }
@ -99,7 +99,7 @@ export const NavigatorDoorStateView: FC<{}> = props =>
<Button variant="success" onClick={ tryEntering }> <Button variant="success" onClick={ tryEntering }>
{ LocalizeText('navigator.password.button.try') } { LocalizeText('navigator.password.button.try') }
</Button> </Button>
<Button variant="danger" onClick={ close }> <Button variant="danger" onClick={ onClose }>
{ LocalizeText('generic.cancel') } { LocalizeText('generic.cancel') }
</Button> </Button>
</Column> </Column>

View File

@ -14,13 +14,13 @@ interface NavigatorRoomSettingsTabViewProps
{ {
roomData: IRoomData; roomData: IRoomData;
handleChange: (field: string, value: string | number | boolean) => void; handleChange: (field: string, value: string | number | boolean) => void;
close: () => void; onClose: () => void;
} }
export const NavigatorRoomSettingsBasicTabView: FC<NavigatorRoomSettingsTabViewProps> = props => 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 [ roomName, setRoomName ] = useState<string>('');
const [ roomDescription, setRoomDescription ] = useState<string>(''); const [ roomDescription, setRoomDescription ] = useState<string>('');
const { showConfirm = null } = useNotification(); const { showConfirm = null } = useNotification();
@ -32,7 +32,7 @@ export const NavigatorRoomSettingsBasicTabView: FC<NavigatorRoomSettingsTabViewP
{ {
SendMessageComposer(new RoomDeleteComposer(roomData.roomId)); SendMessageComposer(new RoomDeleteComposer(roomData.roomId));
if(close) close(); if(onClose) onClose();
CreateLinkEvent('navigator/search/myworld_view'); CreateLinkEvent('navigator/search/myworld_view');
}, },

View File

@ -65,7 +65,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
useMessageEvent(RoomSettingsDataEvent, onRoomSettingsEvent); useMessageEvent(RoomSettingsDataEvent, onRoomSettingsEvent);
const close = () => const onClose = () =>
{ {
setRoomData(null); setRoomData(null);
setCurrentTab(TABS[0]); setCurrentTab(TABS[0]);
@ -181,7 +181,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
return ( return (
<NitroCardView uniqueKey="nitro-room-settings" className="nitro-room-settings"> <NitroCardView uniqueKey="nitro-room-settings" className="nitro-room-settings">
<NitroCardHeaderView headerText={ LocalizeText('navigator.roomsettings') } onCloseClick={ close } /> <NitroCardHeaderView headerText={ LocalizeText('navigator.roomsettings') } onCloseClick={ onClose } />
<NitroCardTabsView> <NitroCardTabsView>
{ TABS.map(tab => { TABS.map(tab =>
{ {
@ -190,7 +190,7 @@ export const NavigatorRoomSettingsView: FC<{}> = props =>
</NitroCardTabsView> </NitroCardTabsView>
<NitroCardContentView> <NitroCardContentView>
{ (currentTab === TABS[0]) && { (currentTab === TABS[0]) &&
<NavigatorRoomSettingsBasicTabView roomData={ roomData } handleChange={ handleChange } close={ close } /> } <NavigatorRoomSettingsBasicTabView roomData={ roomData } handleChange={ handleChange } onClose={ onClose } /> }
{ (currentTab === TABS[1]) && { (currentTab === TABS[1]) &&
<NavigatorRoomSettingsAccessTabView roomData={ roomData } handleChange={ handleChange } /> } <NavigatorRoomSettingsAccessTabView roomData={ roomData } handleChange={ handleChange } /> }
{ (currentTab === TABS[2]) && { (currentTab === TABS[2]) &&

View File

@ -3,11 +3,11 @@ import { NitroSystemAlertView } from './NitroSystemAlertView';
import { NotificationDefaultAlertView } from './NotificationDefaultAlertView'; import { NotificationDefaultAlertView } from './NotificationDefaultAlertView';
import { NotificationSeachAlertView } from './NotificationSearchAlertView'; import { NotificationSeachAlertView } from './NotificationSearchAlertView';
export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) => export const GetAlertLayout = (item: NotificationAlertItem, onClose: () => void) =>
{ {
if(!item) return null; if(!item) return null;
const props = { key: item.id, item, close }; const props = { key: item.id, item, onClose };
switch(item.alertType) switch(item.alertType)
{ {

View File

@ -9,10 +9,10 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
export const NitroSystemAlertView: FC<NotificationDefaultAlertViewProps> = props => export const NitroSystemAlertView: FC<NotificationDefaultAlertViewProps> = props =>
{ {
const { title = 'Nitro', close = null, ...rest } = props; const { title = 'Nitro', onClose = null, ...rest } = props;
return ( return (
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }> <LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest }>
<Grid> <Grid>
<Column center size={ 5 }> <Column center size={ 5 }>
<object data="https://assets.nitrodev.co/logos/nitro-n-dark.svg" width="100" height="100">&nbsp;</object> <object data="https://assets.nitrodev.co/logos/nitro-n-dark.svg" width="100" height="100">&nbsp;</object>

View File

@ -9,7 +9,7 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps> = props => 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) const [ imageFailed, setImageFailed ] = useState<boolean>(false)
@ -17,13 +17,13 @@ export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps>
{ {
OpenUrl(item.clickUrl); OpenUrl(item.clickUrl);
close(); onClose();
}, [ item, close ]); }, [ item, onClose ]);
const hasFrank = item.alertType === NotificationAlertType.DEFAULT; const hasFrank = item.alertType === NotificationAlertType.DEFAULT;
return ( 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 }> <Flex fullHeight overflow="auto" gap={ hasFrank || (item.imageUrl && !imageFailed) ? 2 : 0 }>
{ hasFrank && !item.imageUrl && <Base className="notification-frank flex-shrink-0" /> } { hasFrank && !item.imageUrl && <Base className="notification-frank flex-shrink-0" /> }
{ item.imageUrl && !imageFailed && <img src={ item.imageUrl } alt={ item.title } onError={ () => { 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 }> <Column alignItems="center" center gap={ 0 }>
<hr className="my-2 w-100" /> <hr className="my-2 w-100" />
{ !item.clickUrl && { !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> } { item.clickUrl && (item.clickUrl.length > 0) && <Button onClick={ visitUrl }>{ LocalizeText(item.clickUrlText) }</Button> }
</Column> </Column>
</> } </> }

View File

@ -9,7 +9,7 @@ interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewP
export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> = props => 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 [ searchValue, setSearchValue ] = useState('');
const [ results, setResults ] = useState<string[]>([]); const [ results, setResults ] = useState<string[]>([]);
@ -18,8 +18,8 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
{ {
OpenUrl(item.clickUrl); OpenUrl(item.clickUrl);
close(); onClose();
}, [ item, close ]); }, [ item, onClose ]);
useEffect(() => useEffect(() =>
{ {
@ -36,7 +36,7 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
const isAction = (item.clickUrl && item.clickUrl.startsWith('event:')); const isAction = (item.clickUrl && item.clickUrl.startsWith('event:'));
return ( return (
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }> <LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest }>
<Flex fullWidth alignItems="center" position="relative"> <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) } /> <input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={ searchValue } onChange={ event => updateSearchValue(event.target.value) } />
</Flex> </Flex>
@ -51,7 +51,7 @@ export const NotificationSeachAlertView: FC<NotificationDefaultAlertViewProps> =
<hr className="my-2"/> <hr className="my-2"/>
<Column alignItems="center" center gap={ 1 }> <Column alignItems="center" center gap={ 1 }>
{ !isAction && !item.clickUrl && { !isAction && !item.clickUrl &&
<Button onClick={ close }>{ LocalizeText('generic.close') }</Button> } <Button onClick={ onClose }>{ LocalizeText('generic.close') }</Button> }
{ item.clickUrl && (item.clickUrl.length > 0) && { item.clickUrl && (item.clickUrl.length > 0) &&
<Button onClick={ visitUrl }>{ LocalizeText(item.clickUrlText) }</Button> } <Button onClick={ visitUrl }>{ LocalizeText(item.clickUrlText) }</Button> }
</Column> </Column>

View File

@ -2,11 +2,11 @@ import { NotificationBubbleItem, NotificationBubbleType } from '../../../../api'
import { NotificationClubGiftBubbleView } from './NotificationClubGiftBubbleView'; import { NotificationClubGiftBubbleView } from './NotificationClubGiftBubbleView';
import { NotificationDefaultBubbleView } from './NotificationDefaultBubbleView'; import { NotificationDefaultBubbleView } from './NotificationDefaultBubbleView';
export const GetBubbleLayout = (item: NotificationBubbleItem, close: () => void) => export const GetBubbleLayout = (item: NotificationBubbleItem, onClose: () => void) =>
{ {
if(!item) return null; if(!item) return null;
const props = { key: item.id, item, close }; const props = { key: item.id, item, onClose };
switch(item.notificationType) switch(item.notificationType)
{ {

View File

@ -9,17 +9,17 @@ export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationB
export const NotificationClubGiftBubbleView: FC<NotificationClubGiftBubbleViewProps> = props => export const NotificationClubGiftBubbleView: FC<NotificationClubGiftBubbleViewProps> = props =>
{ {
const { item = null, close = null, ...rest } = props; const { item = null, onClose = null, ...rest } = props;
return ( 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"> <div className="d-flex align-items-center gap-2 mb-2">
<LayoutCurrencyIcon type="hc" className="flex-shrink-0" /> <LayoutCurrencyIcon type="hc" className="flex-shrink-0" />
<span className="ms-1">{ LocalizeText('notifications.text.club_gift') }</span> <span className="ms-1">{ LocalizeText('notifications.text.club_gift') }</span>
</div> </div>
<div className="d-flex align-items-center justify-content-end gap-2"> <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> <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> </div>
</LayoutNotificationBubbleView> </LayoutNotificationBubbleView>
); );

View File

@ -9,12 +9,12 @@ export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBu
export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = props => 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 />'); const htmlText = item.message.replace(/\r\n|\r|\n/g, '<br />');
return ( 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"> <Flex center className="bubble-image-container">
{ (item.iconUrl && item.iconUrl.length) && { (item.iconUrl && item.iconUrl.length) &&
<img className="no-select" src={ item.iconUrl } alt="" /> } <img className="no-select" src={ item.iconUrl } alt="" /> }

View File

@ -1,11 +1,11 @@
import { NotificationConfirmItem } from '../../../../api'; import { NotificationConfirmItem } from '../../../../api';
import { NotificationDefaultConfirmView } from './NotificationDefaultConfirmView'; import { NotificationDefaultConfirmView } from './NotificationDefaultConfirmView';
export const GetConfirmLayout = (item: NotificationConfirmItem, close: () => void) => export const GetConfirmLayout = (item: NotificationConfirmItem, onClose: () => void) =>
{ {
if(!item) return null; if(!item) return null;
const props = { key: item.id, item, close }; const props = { key: item.id, item, onClose };
switch(item.confirmType) switch(item.confirmType)
{ {

View File

@ -9,25 +9,25 @@ export interface NotificationDefaultConfirmViewProps extends LayoutNotificationA
export const NotificationDefaultConfirmView: FC<NotificationDefaultConfirmViewProps> = props => 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 { message = null, onConfirm = null, onCancel = null, confirmText = null, cancelText = null, title = null } = item;
const confirm = () => const confirm = () =>
{ {
if(onConfirm) onConfirm(); if(onConfirm) onConfirm();
close(); onClose();
} }
const cancel = () => const cancel = () =>
{ {
if(onCancel) onCancel(); if(onCancel) onCancel();
close(); onClose();
} }
return ( return (
<LayoutNotificationAlertView title={ title } close={ close } { ...rest } type={ NotificationAlertType.ALERT }> <LayoutNotificationAlertView title={ title } onClose={ onClose } { ...rest } type={ NotificationAlertType.ALERT }>
<Flex grow center> <Flex grow center>
<Text>{ message }</Text> <Text>{ message }</Text>
</Flex> </Flex>

View File

@ -7,12 +7,12 @@ import { ContextMenuHeaderView } from '../context-menu/ContextMenuHeaderView';
interface AvatarInfoRentableBotChatViewProps interface AvatarInfoRentableBotChatViewProps
{ {
chatEvent: RoomWidgetUpdateRentableBotChatEvent; chatEvent: RoomWidgetUpdateRentableBotChatEvent;
close(): void; onClose(): void;
} }
export const AvatarInfoRentableBotChatView: FC<AvatarInfoRentableBotChatViewProps> = props => 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 // 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 [ newText, setNewText ] = useState<string>(chatEvent.chat === '${bot.skill.chatter.configuration.text.placeholder}' ? '' : chatEvent.chat);
const [ automaticChat, setAutomaticChat ] = useState<boolean>(chatEvent.automaticChat); 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)); SendMessageComposer(new BotSkillSaveComposer(chatEvent.botId, BotSkillsEnum.SETUP_CHAT, chatConfiguration));
close(); onClose();
} }
return ( return (
@ -58,7 +58,7 @@ export const AvatarInfoRentableBotChatView: FC<AvatarInfoRentableBotChatViewProp
</Flex> </Flex>
</Column> </Column>
<Flex alignItems="center" justifyContent="between" gap={ 1 }> <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> <Button fullWidth variant="success" onClick={ save }>{ LocalizeText('save') }</Button>
</Flex> </Flex>
</Column> </Column>

View File

@ -7,7 +7,7 @@ import { useRoom } from '../../../../hooks';
interface AvatarInfoUseProductConfirmViewProps interface AvatarInfoUseProductConfirmViewProps
{ {
item: UseProductItem; item: UseProductItem;
close: () => void; onClose: () => void;
} }
const _Str_5091: number = -1; const _Str_5091: number = -1;
@ -21,7 +21,7 @@ const _Str_9653: number = 6;
export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmViewProps> = props => 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 [ mode, setMode ] = useState(_Str_5091);
const [ petData, setPetData ] = useState<RoomUserData>(null); const [ petData, setPetData ] = useState<RoomUserData>(null);
const [ furniData, setFurniData ] = useState<IFurnitureData>(null); const [ furniData, setFurniData ] = useState<IFurnitureData>(null);
@ -38,8 +38,8 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
{ {
roomSession.usePetProduct(item.requestRoomObjectId, petData.webID); roomSession.usePetProduct(item.requestRoomObjectId, petData.webID);
close(); onClose();
}, [ roomSession, item, petData, close ]); }, [ roomSession, item, petData, onClose ]);
const getPetImage = useMemo(() => const getPetImage = useMemo(() =>
{ {
@ -223,7 +223,7 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
return ( return (
<NitroCardView className="nitro-use-product-confirmation"> <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> <NitroCardContentView center>
<Flex gap={ 2 } overflow="hidden"> <Flex gap={ 2 } overflow="hidden">
<Column> <Column>
@ -270,7 +270,7 @@ export const AvatarInfoUseProductConfirmView: FC<AvatarInfoUseProductConfirmView
</> } </> }
</Column> </Column>
<Flex alignItems="center" justifyContent="between"> <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> <Button variant="success" onClick={ useProduct }>{ LocalizeText('useproduct.widget.use') }</Button>
</Flex> </Flex>
</Column> </Column>

View File

@ -10,7 +10,7 @@ interface AvatarInfoUseProductViewProps
{ {
item: UseProductItem; item: UseProductItem;
updateConfirmingProduct: (product: UseProductItem) => void; updateConfirmingProduct: (product: UseProductItem) => void;
close: () => void; onClose: () => void;
} }
const PRODUCT_PAGE_UKNOWN: number = 0; const PRODUCT_PAGE_UKNOWN: number = 0;
@ -24,7 +24,7 @@ const PRODUCT_PAGE_FERTILIZE: number = 7;
export const AvatarInfoUseProductView: FC<AvatarInfoUseProductViewProps> = props => 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 [ mode, setMode ] = useState(0);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
@ -87,7 +87,7 @@ export const AvatarInfoUseProductView: FC<AvatarInfoUseProductViewProps> = props
}, [ item, updateConfirmingProduct ]); }, [ item, updateConfirmingProduct ]);
return ( 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> <ContextMenuHeaderView>
{ item.name } { item.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -51,7 +51,7 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
{ {
if(!roomSession || isGameMode) return null; 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) if(avatarInfo)
{ {
@ -62,7 +62,7 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
if(!isDecorating) return null; if(!isDecorating) return null;
return <AvatarInfoWidgetFurniView avatarInfo={ info } close={ () => setAvatarInfo(null) } />; return <AvatarInfoWidgetFurniView avatarInfo={ info } onClose={ () => setAvatarInfo(null) } />;
} }
case AvatarInfoUser.OWN_USER: case AvatarInfoUser.OWN_USER:
case AvatarInfoUser.PEER: { case AvatarInfoUser.PEER: {
@ -74,20 +74,20 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
{ {
if(RoomEnterEffect.isRunning()) return null; 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: { case AvatarInfoPet.PET_INFO: {
const info = (avatarInfo as AvatarInfoPet); 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: { 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) switch(avatarInfo.type)
{ {
case AvatarInfoFurni.FURNI: 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.OWN_USER:
case AvatarInfoUser.PEER: 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: 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: 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: 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"> <Column alignItems="end" className="nitro-infostand-container">
{ getInfostandView() } { getInfostandView() }
</Column> } </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) => { (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) }/> } { rentableBotChatEvent && <AvatarInfoRentableBotChatView chatEvent={ rentableBotChatEvent } onClose={ () => setRentableBotChatEvent(null) }/> }
{ confirmingProduct && <AvatarInfoUseProductConfirmView item={ confirmingProduct } close={ () => updateConfirmingProduct(null) } /> } { confirmingProduct && <AvatarInfoUseProductConfirmView item={ confirmingProduct } onClose={ () => updateConfirmingProduct(null) } /> }
</> </>
) )
} }

View File

@ -6,12 +6,12 @@ import { Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text } from
interface InfoStandWidgetBotViewProps interface InfoStandWidgetBotViewProps
{ {
avatarInfo: AvatarInfoUser; avatarInfo: AvatarInfoUser;
close: () => void; onClose: () => void;
} }
export const InfoStandWidgetBotView: FC<InfoStandWidgetBotViewProps> = props => export const InfoStandWidgetBotView: FC<InfoStandWidgetBotViewProps> = props =>
{ {
const { avatarInfo = null, close = null } = props; const { avatarInfo = null, onClose = null } = props;
if(!avatarInfo) return null; if(!avatarInfo) return null;
@ -21,7 +21,7 @@ export const InfoStandWidgetBotView: FC<InfoStandWidgetBotViewProps> = props =>
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex alignItems="center" justifyContent="between" gap={ 1 }> <Flex alignItems="center" justifyContent="between" gap={ 1 }>
<Text variant="white" small wrap>{ avatarInfo.name }</Text> <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> </Flex>
<hr className="m-0" /> <hr className="m-0" />
</Column> </Column>

View File

@ -8,7 +8,7 @@ import { useMessageEvent, useRoom } from '../../../../../hooks';
interface InfoStandWidgetFurniViewProps interface InfoStandWidgetFurniViewProps
{ {
avatarInfo: AvatarInfoFurni; avatarInfo: AvatarInfoFurni;
close: () => void; onClose: () => void;
} }
const PICKUP_MODE_NONE: number = 0; const PICKUP_MODE_NONE: number = 0;
@ -17,7 +17,7 @@ const PICKUP_MODE_FULL: number = 2;
export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props => export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props =>
{ {
const { avatarInfo = null, close = null } = props; const { avatarInfo = null, onClose = null } = props;
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
const [ pickupMode, setPickupMode ] = useState(0); const [ pickupMode, setPickupMode ] = useState(0);
@ -278,7 +278,7 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex alignItems="center" justifyContent="between" gap={ 1 }> <Flex alignItems="center" justifyContent="between" gap={ 1 }>
<Text variant="white" small wrap>{ avatarInfo.name }</Text> <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> </Flex>
<hr className="m-0" /> <hr className="m-0" />
</Column> </Column>

View File

@ -6,12 +6,12 @@ import { Base, Column, Flex, LayoutPetImageView, Text, UserProfileIconView } fro
interface InfoStandWidgetPetViewProps interface InfoStandWidgetPetViewProps
{ {
avatarInfo: AvatarInfoPet; avatarInfo: AvatarInfoPet;
close: () => void; onClose: () => void;
} }
export const InfoStandWidgetPetView: FC<InfoStandWidgetPetViewProps> = props => export const InfoStandWidgetPetView: FC<InfoStandWidgetPetViewProps> = props =>
{ {
const { avatarInfo = null, close = null } = props; const { avatarInfo = null, onClose = null } = props;
if(!avatarInfo) return null; if(!avatarInfo) return null;
@ -21,7 +21,7 @@ export const InfoStandWidgetPetView: FC<InfoStandWidgetPetViewProps> = props =>
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex alignItems="center" justifyContent="between" gap={ 1 }> <Flex alignItems="center" justifyContent="between" gap={ 1 }>
<Text variant="white" small wrap>{ avatarInfo.name }</Text> <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> </Flex>
<Text variant="white" small wrap>{ LocalizeText(`pet.breed.${ avatarInfo.petType }.${ avatarInfo.petBreed }`) }</Text> <Text variant="white" small wrap>{ LocalizeText(`pet.breed.${ avatarInfo.petType }.${ avatarInfo.petBreed }`) }</Text>
<hr className="m-0" /> <hr className="m-0" />

View File

@ -7,12 +7,12 @@ import { Button, Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text
interface InfoStandWidgetRentableBotViewProps interface InfoStandWidgetRentableBotViewProps
{ {
avatarInfo: AvatarInfoRentableBot; avatarInfo: AvatarInfoRentableBot;
close: () => void; onClose: () => void;
} }
export const InfoStandWidgetRentableBotView: FC<InfoStandWidgetRentableBotViewProps> = props => export const InfoStandWidgetRentableBotView: FC<InfoStandWidgetRentableBotViewProps> = props =>
{ {
const { avatarInfo = null, close = null } = props; const { avatarInfo = null, onClose = null } = props;
const canPickup = useMemo(() => const canPickup = useMemo(() =>
{ {
@ -34,7 +34,7 @@ export const InfoStandWidgetRentableBotView: FC<InfoStandWidgetRentableBotViewPr
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex alignItems="center" justifyContent="between" gap={ 1 }> <Flex alignItems="center" justifyContent="between" gap={ 1 }>
<Text variant="white" small wrap>{ avatarInfo.name }</Text> <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> </Flex>
<hr className="m-0" /> <hr className="m-0" />
</Column> </Column>

View File

@ -10,12 +10,12 @@ interface InfoStandWidgetUserViewProps
{ {
avatarInfo: AvatarInfoUser; avatarInfo: AvatarInfoUser;
setAvatarInfo: Dispatch<SetStateAction<AvatarInfoUser>>; setAvatarInfo: Dispatch<SetStateAction<AvatarInfoUser>>;
close: () => void; onClose: () => void;
} }
export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props => 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 [ motto, setMotto ] = useState<string>(null);
const [ isEditingMotto, setIsEditingMotto ] = useState(false); const [ isEditingMotto, setIsEditingMotto ] = useState(false);
const [ relationships, setRelationships ] = useState<RelationshipStatusInfoMessageParser>(null); const [ relationships, setRelationships ] = useState<RelationshipStatusInfoMessageParser>(null);
@ -128,7 +128,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
<UserProfileIconView userId={ avatarInfo.webID } /> <UserProfileIconView userId={ avatarInfo.webID } />
<Text variant="white" small wrap>{ avatarInfo.name }</Text> <Text variant="white" small wrap>{ avatarInfo.name }</Text>
</Flex> </Flex>
<FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ close } /> <FontAwesomeIcon icon="times" className="cursor-pointer" onClick={ onClose } />
</Flex> </Flex>
<hr className="m-0" /> <hr className="m-0" />
</Column> </Column>

View File

@ -11,7 +11,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetAvatarViewProps interface AvatarInfoWidgetAvatarViewProps
{ {
avatarInfo: AvatarInfoUser; avatarInfo: AvatarInfoUser;
close: () => void; onClose: () => void;
} }
const MODE_NORMAL = 0; const MODE_NORMAL = 0;
@ -24,7 +24,7 @@ const MODE_RELATIONSHIP = 6;
export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = props => 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 [ mode, setMode ] = useState(MODE_NORMAL);
const [ respectsLeft, setRespectsLeft ] = useState(0); const [ respectsLeft, setRespectsLeft ] = useState(0);
const { canRequestFriend = null } = useFriends(); const { canRequestFriend = null } = useFriends();
@ -197,7 +197,7 @@ export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = p
} }
} }
if(hideMenu) close(); if(hideMenu) onClose();
} }
useEffect(() => useEffect(() =>
@ -207,7 +207,7 @@ export const AvatarInfoWidgetAvatarView: FC<AvatarInfoWidgetAvatarViewProps> = p
}, [ avatarInfo ]); }, [ avatarInfo ]);
return ( 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) }> <ContextMenuHeaderView className="cursor-pointer" onClick={ event => GetUserProfile(avatarInfo.webID) }>
{ avatarInfo.name } { avatarInfo.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -18,7 +18,7 @@ export const AvatarInfoWidgetDecorateView: FC<AvatarInfoWidgetDecorateViewProps>
const { userId = -1, userName = '', roomIndex = -1, setIsDecorating = null } = props; const { userId = -1, userName = '', roomIndex = -1, setIsDecorating = null } = props;
return ( return (
<ContextMenuView objectId={ roomIndex } category={ RoomObjectCategory.UNIT } close={ null }> <ContextMenuView objectId={ roomIndex } category={ RoomObjectCategory.UNIT } onClose={ null }>
<ContextMenuListView> <ContextMenuListView>
<ContextMenuListItemView onClick={ event => setIsDecorating(false) }> <ContextMenuListItemView onClick={ event => setIsDecorating(false) }>
{ LocalizeText('widget.avatar.stop_decorating') } { LocalizeText('widget.avatar.stop_decorating') }

View File

@ -10,12 +10,12 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetFurniViewProps interface AvatarInfoWidgetFurniViewProps
{ {
avatarInfo: AvatarInfoFurni; avatarInfo: AvatarInfoFurni;
close: () => void; onClose: () => void;
} }
export const AvatarInfoWidgetFurniView: FC<AvatarInfoWidgetFurniViewProps> = props => export const AvatarInfoWidgetFurniView: FC<AvatarInfoWidgetFurniViewProps> = props =>
{ {
const { avatarInfo = null, close = null } = props; const { avatarInfo = null, onClose = null } = props;
const processAction = (name: string) => const processAction = (name: string) =>
{ {
@ -42,7 +42,7 @@ export const AvatarInfoWidgetFurniView: FC<AvatarInfoWidgetFurniViewProps> = pro
} }
return ( return (
<ContextMenuView objectId={ avatarInfo.id } category={ avatarInfo.category } close={ close } collapsable={ true }> <ContextMenuView objectId={ avatarInfo.id } category={ avatarInfo.category } onClose={ onClose } collapsable={ true }>
<ContextMenuHeaderView> <ContextMenuHeaderView>
{ avatarInfo.name } { avatarInfo.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -5,12 +5,12 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetNameViewProps interface AvatarInfoWidgetNameViewProps
{ {
nameInfo: AvatarInfoName; nameInfo: AvatarInfoName;
close: () => void; onClose: () => void;
} }
export const AvatarInfoWidgetNameView: FC<AvatarInfoWidgetNameViewProps> = props => export const AvatarInfoWidgetNameView: FC<AvatarInfoWidgetNameViewProps> = props =>
{ {
const { nameInfo = null, close = null } = props; const { nameInfo = null, onClose = null } = props;
const getClassNames = useMemo(() => const getClassNames = useMemo(() =>
{ {
@ -22,7 +22,7 @@ export const AvatarInfoWidgetNameView: FC<AvatarInfoWidgetNameViewProps> = props
}, [ nameInfo ]); }, [ nameInfo ]);
return ( 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"> <div className="text-shadow">
{ nameInfo.name } { nameInfo.name }
</div> </div>

View File

@ -14,7 +14,7 @@ interface AvatarInfoWidgetOwnAvatarViewProps
avatarInfo: AvatarInfoUser; avatarInfo: AvatarInfoUser;
isDancing: boolean; isDancing: boolean;
setIsDecorating: Dispatch<SetStateAction<boolean>>; setIsDecorating: Dispatch<SetStateAction<boolean>>;
close: () => void; onClose: () => void;
} }
const MODE_NORMAL = 0; const MODE_NORMAL = 0;
@ -25,7 +25,7 @@ const MODE_SIGNS = 4;
export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProps> = props => 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 [ mode, setMode ] = useState((isDancing && HasHabboClub()) ? MODE_CLUB_DANCES : MODE_NORMAL);
const { roomSession = null } = useRoom(); 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)); const isShowDecorate = () => (avatarInfo.amIOwner || avatarInfo.amIAnyRoomController || (avatarInfo.roomControllerLevel > RoomControllerLevel.GUEST));
@ -115,7 +115,7 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
const isRidingHorse = IsRidingHorse(); const isRidingHorse = IsRidingHorse();
return ( 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) }> <ContextMenuHeaderView className="cursor-pointer" onClick={ event => GetUserProfile(avatarInfo.webID) }>
{ avatarInfo.name } { avatarInfo.name }

View File

@ -9,7 +9,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetOwnPetViewProps interface AvatarInfoWidgetOwnPetViewProps
{ {
avatarInfo: AvatarInfoPet; avatarInfo: AvatarInfoPet;
close: () => void; onClose: () => void;
} }
const MODE_NORMAL: number = 0; const MODE_NORMAL: number = 0;
@ -19,7 +19,7 @@ const MODE_MONSTER_PLANT: number = 3;
export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = props => 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 [ mode, setMode ] = useState(MODE_NORMAL);
const [ respectsLeft, setRespectsLeft ] = useState(0); const [ respectsLeft, setRespectsLeft ] = useState(0);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
@ -118,7 +118,7 @@ export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = p
} }
} }
if(hideMenu) close(); if(hideMenu) onClose();
} }
useEffect(() => useEffect(() =>
@ -136,7 +136,7 @@ export const AvatarInfoWidgetOwnPetView: FC<AvatarInfoWidgetOwnPetViewProps> = p
}, [ avatarInfo ]); }, [ avatarInfo ]);
return ( 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> <ContextMenuHeaderView>
{ avatarInfo.name } { avatarInfo.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -9,7 +9,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetPetViewProps interface AvatarInfoWidgetPetViewProps
{ {
avatarInfo: AvatarInfoPet; avatarInfo: AvatarInfoPet;
close: () => void; onClose: () => void;
} }
const MODE_NORMAL: number = 0; const MODE_NORMAL: number = 0;
@ -19,7 +19,7 @@ const MODE_MONSTER_PLANT: number = 3;
export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props => 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 [ mode, setMode ] = useState(MODE_NORMAL);
const [ respectsLeft, setRespectsLeft ] = useState(0); const [ respectsLeft, setRespectsLeft ] = useState(0);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
@ -85,7 +85,7 @@ export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props =
} }
} }
if(hideMenu) close(); if(hideMenu) onClose();
} }
useEffect(() => useEffect(() =>
@ -103,7 +103,7 @@ export const AvatarInfoWidgetPetView: FC<AvatarInfoWidgetPetViewProps> = props =
}, [ avatarInfo ]); }, [ avatarInfo ]);
return ( 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> <ContextMenuHeaderView>
{ avatarInfo.name } { avatarInfo.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -10,7 +10,7 @@ import { ContextMenuView } from '../../context-menu/ContextMenuView';
interface AvatarInfoWidgetRentableBotViewProps interface AvatarInfoWidgetRentableBotViewProps
{ {
avatarInfo: AvatarInfoRentableBot; avatarInfo: AvatarInfoRentableBot;
close: () => void; onClose: () => void;
} }
const MODE_NORMAL = 0; const MODE_NORMAL = 0;
@ -19,7 +19,7 @@ const MODE_CHANGE_MOTTO = 2;
export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotViewProps> = props => 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 [ mode, setMode ] = useState(MODE_NORMAL);
const [ newName, setNewName ] = useState(''); const [ newName, setNewName ] = useState('');
const [ newMotto, setNewMotto ] = useState(''); const [ newMotto, setNewMotto ] = useState('');
@ -55,7 +55,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
parseInt(pieces[2]), parseInt(pieces[2]),
((pieces[3]) ? ((pieces[3].toLowerCase() === 'true') || (pieces[3] === '1')) : false))); ((pieces[3]) ? ((pieces[3].toLowerCase() === 'true') || (pieces[3] === '1')) : false)));
close(); onClose();
} }
return; return;
@ -120,7 +120,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
} }
} }
if(hideMenu) close(); if(hideMenu) onClose();
} }
useEffect(() => useEffect(() =>
@ -131,7 +131,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
const canControl = (avatarInfo.amIOwner || avatarInfo.amIAnyRoomController); const canControl = (avatarInfo.amIOwner || avatarInfo.amIAnyRoomController);
return ( 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> <ContextMenuHeaderView>
{ avatarInfo.name } { avatarInfo.name }
</ContextMenuHeaderView> </ContextMenuHeaderView>

View File

@ -8,12 +8,12 @@ interface ChooserWidgetViewProps
title: string; title: string;
items: RoomObjectItem[]; items: RoomObjectItem[];
selectItem: (item: RoomObjectItem) => void; selectItem: (item: RoomObjectItem) => void;
close: () => void; onClose: () => void;
} }
export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props => 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 [ selectedItem, setSelectedItem ] = useState<RoomObjectItem>(null);
const [ searchValue, setSearchValue ] = useState(''); const [ searchValue, setSearchValue ] = useState('');
const canSeeId = GetSessionDataManager().isModerator; const canSeeId = GetSessionDataManager().isModerator;
@ -45,7 +45,7 @@ export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props =>
return ( return (
<NitroCardView className="nitro-chooser-widget" theme="primary-slim"> <NitroCardView className="nitro-chooser-widget" theme="primary-slim">
<NitroCardHeaderView headerText={ title } onCloseClick={ close } /> <NitroCardHeaderView headerText={ title } onCloseClick={ onClose } />
<NitroCardContentView overflow="hidden"> <NitroCardContentView overflow="hidden">
<input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={ searchValue } onChange={ event => setSearchValue(event.target.value) } /> <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"> <Column fullHeight overflow="auto">

View File

@ -6,7 +6,7 @@ import { ChooserWidgetView } from './ChooserWidgetView';
export const FurniChooserWidgetView: FC<{}> = props => 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(() => useEffect(() =>
{ {
@ -27,5 +27,5 @@ export const FurniChooserWidgetView: FC<{}> = props =>
if(!items) return null; 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 } />;
} }

View File

@ -6,7 +6,7 @@ import { ChooserWidgetView } from './ChooserWidgetView';
export const UserChooserWidgetView: FC<{}> = props => 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(() => useEffect(() =>
{ {
@ -27,5 +27,5 @@ export const UserChooserWidgetView: FC<{}> = props =>
if(!items) return null; 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 } />;
} }

View File

@ -10,7 +10,7 @@ interface ContextMenuViewProps extends BaseProps<HTMLDivElement>
category: number; category: number;
userType?: number; userType?: number;
fades?: boolean; fades?: boolean;
close: () => void; onClose: () => void;
collapsable?: boolean; collapsable?: boolean;
} }
@ -27,7 +27,7 @@ let FADE_TIME = 1;
export const ContextMenuView: FC<ContextMenuViewProps> = props => 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 [ pos, setPos ] = useState<{ x: number, y: number }>({ x: null, y: null });
const [ opacity, setOpacity ] = useState(1); const [ opacity, setOpacity ] = useState(1);
const [ isFading, setIsFading ] = useState(false); const [ isFading, setIsFading ] = useState(false);
@ -44,13 +44,13 @@ export const ContextMenuView: FC<ContextMenuViewProps> = props =>
if(newOpacity <= 0) if(newOpacity <= 0)
{ {
close(); onClose();
return false; return false;
} }
setOpacity(newOpacity); setOpacity(newOpacity);
}, [ isFading, close ]); }, [ isFading, onClose ]);
const updatePosition = useCallback((bounds: NitroRectangle, location: NitroPoint) => const updatePosition = useCallback((bounds: NitroRectangle, location: NitroPoint) =>
{ {

View File

@ -6,13 +6,13 @@ import { useFurnitureBackgroundColorWidget } from '../../../../hooks';
export const FurnitureBackgroundColorView: FC<{}> = props => 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; if(objectId === -1) return null;
return ( return (
<NitroCardView theme="primary-slim" className="nitro-room-widget-toner"> <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"> <NitroCardContentView overflow="hidden" justifyContent="between">
<Column overflow="auto" gap={ 1 }> <Column overflow="auto" gap={ 1 }>
<Column> <Column>

View File

@ -4,9 +4,9 @@ import { useFurnitureBadgeDisplayWidget } from '../../../../hooks';
export const FurnitureBadgeDisplayView: FC<{}> = props => 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; 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 } />;
} }

View File

@ -11,7 +11,7 @@ export const FurnitureDimmerView: FC<{}> = props =>
const [ isVisible, setIsVisible ] = useState(false); 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 { 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)); FurnitureDimmerUtilities.previewDimmer(color, brightness, (effectId === 2));
@ -33,7 +33,7 @@ export const FurnitureDimmerView: FC<{}> = props =>
return ( return (
<NitroCardView className="nitro-room-widget-dimmer"> <NitroCardView className="nitro-room-widget-dimmer">
<NitroCardHeaderView headerText={ LocalizeText('widget.dimmer.title') } onCloseClick={ close } /> <NitroCardHeaderView headerText={ LocalizeText('widget.dimmer.title') } onCloseClick={ onClose } />
{ (dimmerState === 1) && { (dimmerState === 1) &&
<NitroCardTabsView> <NitroCardTabsView>
{ presets.map(preset => <NitroCardTabsItemView key={ preset.id } isActive={ (selectedPresetId === preset.id) } onClick={ event => selectPresetId(preset.id) }>{ LocalizeText(`widget.dimmer.tab.${ preset.id }`) }</NitroCardTabsItemView>) } { presets.map(preset => <NitroCardTabsItemView key={ preset.id } isActive={ (selectedPresetId === preset.id) } onClick={ event => selectPresetId(preset.id) }>{ LocalizeText(`widget.dimmer.tab.${ preset.id }`) }</NitroCardTabsItemView>) }

View File

@ -5,13 +5,13 @@ import { useFurnitureExchangeWidget } from '../../../../hooks';
export const FurnitureExchangeCreditView: FC<{}> = props => 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; if(objectId === -1) return null;
return ( return (
<NitroCardView className="nitro-widget-exchange-credit" theme="primary-slim"> <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> <NitroCardContentView center>
<Flex overflow="hidden" gap={ 2 }> <Flex overflow="hidden" gap={ 2 }>
<Column center> <Column center>

View File

@ -5,13 +5,13 @@ import { useFurnitureExternalImageWidget } from '../../../../hooks';
export const FurnitureExternalImageView: FC<{}> = props => 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; if((objectId === -1) || !photoData) return null;
return ( return (
<NitroCardView className="nitro-external-image-widget" theme="primary-slim"> <NitroCardView className="nitro-external-image-widget" theme="primary-slim">
<NitroCardHeaderView headerText="" onCloseClick={ close } /> <NitroCardHeaderView headerText="" onCloseClick={ onClose } />
<NitroCardContentView> <NitroCardContentView>
<Flex center className="picture-preview border border-black" style={ photoData.w ? { backgroundImage: 'url(' + photoData.w + ')' } : {} }> <Flex center className="picture-preview border border-black" style={ photoData.w ? { backgroundImage: 'url(' + photoData.w + ')' } : {} }>
{ !photoData.w && { !photoData.w &&

View File

@ -5,7 +5,7 @@ import { useFurnitureFriendFurniWidget } from '../../../../hooks';
export const FurnitureFriendFurniView: FC<{}> = props => 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; if(objectId === -1) return null;
@ -13,7 +13,7 @@ export const FurnitureFriendFurniView: FC<{}> = props =>
{ {
return ( return (
<NitroCardView className="nitro-engraving-lock" theme="primary-slim"> <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> <NitroCardContentView>
<h5 className="text-black text-center fw-bold mt-2 mb-2"> <h5 className="text-black text-center fw-bold mt-2 mb-2">
{ LocalizeText('friend.furniture.confirm.lock.subtitle') } { LocalizeText('friend.furniture.confirm.lock.subtitle') }
@ -37,7 +37,7 @@ export const FurnitureFriendFurniView: FC<{}> = props =>
return ( return (
<DraggableWindow handleSelector=".nitro-engraving-lock-view"> <DraggableWindow handleSelector=".nitro-engraving-lock-view">
<div className={ `nitro-engraving-lock-view engraving-lock-${ type }` }> <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"> <Flex justifyContent="center">
<div className="engraving-lock-avatar"> <div className="engraving-lock-avatar">
<LayoutAvatarImageView figure={ figures[0] } direction={ 2 } /> <LayoutAvatarImageView figure={ figures[0] } direction={ 2 } />

View File

@ -5,13 +5,13 @@ import { useFurniturePresentWidget } from '../../../../hooks';
export const FurnitureGiftOpeningView: FC<{}> = props => 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; if(objectId === -1) return null;
return ( return (
<NitroCardView className="nitro-gift-opening" theme="primary-slim"> <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> <NitroCardContentView>
{ (placedItemId === -1) && { (placedItemId === -1) &&
<Column overflow="hidden"> <Column overflow="hidden">

View File

@ -15,7 +15,7 @@ export const FurnitureMannequinView: FC<{}> = props =>
{ {
const [ renderedFigure, setRenderedFigure ] = useState<string>(null); const [ renderedFigure, setRenderedFigure ] = useState<string>(null);
const [ mode, setMode ] = useState(MODE_NONE); 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(() => useEffect(() =>
{ {
@ -82,7 +82,7 @@ export const FurnitureMannequinView: FC<{}> = props =>
return ( return (
<NitroCardView className="nitro-mannequin no-resize" theme="primary-slim"> <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> <NitroCardContentView center>
<Flex fullWidth gap={ 2 } overflow="hidden"> <Flex fullWidth gap={ 2 } overflow="hidden">
<Column> <Column>

View File

@ -7,13 +7,13 @@ import { useFurnitureStackHeightWidget } from '../../../../hooks';
export const FurnitureStackHeightView: FC<{}> = props => 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; if(objectId === -1) return null;
return ( return (
<NitroCardView className="nitro-widget-custom-stack-height" theme="primary-slim"> <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"> <NitroCardContentView justifyContent="between">
<Text>{ LocalizeText('widget.custom.stack.height.text') }</Text> <Text>{ LocalizeText('widget.custom.stack.height.text') }</Text>
<Flex gap={ 2 }> <Flex gap={ 2 }>

View File

@ -17,7 +17,7 @@ const getStickieColorName = (color: string) =>
export const FurnitureStickieView: FC<{}> = props => 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); const [ isEditing, setIsEditing ] = useState(false);
useEffect(() => useEffect(() =>
@ -41,7 +41,7 @@ export const FurnitureStickieView: FC<{}> = props =>
}) } }) }
</> } </> }
</div> </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>
<div className="stickie-context"> <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> } { !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> }

View File

@ -4,9 +4,9 @@ import { useFurnitureTrophyWidget } from '../../../../hooks';
export const FurnitureTrophyView: FC<{}> = props => 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; 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 } />;
} }

View File

@ -8,7 +8,7 @@ import { useFurnitureYoutubeWidget } from '../../../../hooks';
export const FurnitureYoutubeDisplayView: FC<{}> = props => export const FurnitureYoutubeDisplayView: FC<{}> = props =>
{ {
const [ player, setPlayer ] = useState<any>(null); 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 }) => const onStateChange = useCallback((event: { target: YouTubePlayer; data: number }) =>
{ {
@ -69,7 +69,7 @@ export const FurnitureYoutubeDisplayView: FC<{}> = props =>
return ( return (
<NitroCardView className="youtube-tv-widget"> <NitroCardView className="youtube-tv-widget">
<NitroCardHeaderView headerText={ '' } onCloseClick={ close } /> <NitroCardHeaderView headerText={ '' } onCloseClick={ onClose } />
<NitroCardContentView> <NitroCardContentView>
<div className="row w-100 h-100"> <div className="row w-100 h-100">
<div className="youtube-video-container col-9"> <div className="youtube-video-container col-9">

View File

@ -6,30 +6,30 @@ import { useRoom } from '../../../../../hooks';
interface EffectBoxConfirmViewProps interface EffectBoxConfirmViewProps
{ {
objectId: number; objectId: number;
close: () => void; onClose: () => void;
} }
export const EffectBoxConfirmView: FC<EffectBoxConfirmViewProps> = props => export const EffectBoxConfirmView: FC<EffectBoxConfirmViewProps> = props =>
{ {
const { objectId = -1, close = null } = props; const { objectId = -1, onClose = null } = props;
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
const useProduct = () => const useProduct = () =>
{ {
roomSession.useMultistateItem(objectId); roomSession.useMultistateItem(objectId);
close(); onClose();
} }
return ( return (
<NitroCardView className="nitro-use-product-confirmation"> <NitroCardView className="nitro-use-product-confirmation">
<NitroCardHeaderView headerText={ LocalizeText('effectbox.header.title') } onCloseClick={ close } /> <NitroCardHeaderView headerText={ LocalizeText('effectbox.header.title') } onCloseClick={ onClose } />
<NitroCardContentView center> <NitroCardContentView center>
<Flex gap={ 2 }> <Flex gap={ 2 }>
<Column justifyContent="between"> <Column justifyContent="between">
<Text>{ LocalizeText('effectbox.header.description') }</Text> <Text>{ LocalizeText('effectbox.header.description') }</Text>
<Flex alignItems="center" justifyContent="between"> <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> <Button variant="success" onClick={ useProduct }>{ LocalizeText('generic.ok') }</Button>
</Flex> </Flex>
</Column> </Column>

View File

@ -16,18 +16,18 @@ const EFFECTBOX_OPEN: string = 'EFFECTBOX_OPEN';
export const FurnitureContextMenuView: FC<{}> = props => 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 ( return (
<> <>
{ (confirmMode === MONSTERPLANT_SEED_CONFIRMATION) && { (confirmMode === MONSTERPLANT_SEED_CONFIRMATION) &&
<MonsterPlantSeedConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> } <MonsterPlantSeedConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
{ (confirmMode === PURCHASABLE_CLOTHING_CONFIRMATION) && { (confirmMode === PURCHASABLE_CLOTHING_CONFIRMATION) &&
<PurchasableClothingConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> } <PurchasableClothingConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
{ (confirmMode === EFFECTBOX_OPEN) && { (confirmMode === EFFECTBOX_OPEN) &&
<EffectBoxConfirmView objectId={ confirmingObjectId } close={ closeConfirm } /> } <EffectBoxConfirmView objectId={ confirmingObjectId } onClose={ closeConfirm } /> }
{ (objectId >= 0) && mode && { (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) && { (mode === ContextMenuEnum.FRIEND_FURNITURE) &&
<> <>
<ContextMenuHeaderView> <ContextMenuHeaderView>

View File

@ -7,7 +7,7 @@ import { useRoom } from '../../../../../hooks';
interface MonsterPlantSeedConfirmViewProps interface MonsterPlantSeedConfirmViewProps
{ {
objectId: number; objectId: number;
close: () => void; onClose: () => void;
} }
const MODE_DEFAULT: number = -1; const MODE_DEFAULT: number = -1;
@ -15,7 +15,7 @@ const MODE_MONSTERPLANT_SEED: number = 0;
export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> = props => 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 [ furniData, setFurniData ] = useState<IFurnitureData>(null);
const [ mode, setMode ] = useState(MODE_DEFAULT); const [ mode, setMode ] = useState(MODE_DEFAULT);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
@ -24,7 +24,7 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
{ {
roomSession.useMultistateItem(objectId); roomSession.useMultistateItem(objectId);
close(); onClose();
} }
useEffect(() => useEffect(() =>
@ -48,19 +48,19 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
if(mode === MODE_DEFAULT) if(mode === MODE_DEFAULT)
{ {
close(); onClose();
return; return;
} }
setMode(mode); setMode(mode);
}, [ roomSession, objectId, close ]); }, [ roomSession, objectId, onClose ]);
if(mode === MODE_DEFAULT) return null; if(mode === MODE_DEFAULT) return null;
return ( return (
<NitroCardView className="nitro-use-product-confirmation"> <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> <NitroCardContentView center>
<Flex gap={ 2 } overflow="hidden"> <Flex gap={ 2 } overflow="hidden">
<Column> <Column>
@ -74,7 +74,7 @@ export const MonsterPlantSeedConfirmView: FC<MonsterPlantSeedConfirmViewProps> =
<Text>{ LocalizeText('useproduct.widget.info.plant_seed') }</Text> <Text>{ LocalizeText('useproduct.widget.info.plant_seed') }</Text>
</Column> </Column>
<Flex alignItems="center" justifyContent="between"> <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> <Button variant="success" onClick={ useProduct }>{ LocalizeText('widget.monsterplant_seed.button.use') }</Button>
</Flex> </Flex>
</Column> </Column>

View File

@ -7,7 +7,7 @@ import { useRoom } from '../../../../../hooks';
interface PurchasableClothingConfirmViewProps interface PurchasableClothingConfirmViewProps
{ {
objectId: number; objectId: number;
close: () => void; onClose: () => void;
} }
const MODE_DEFAULT: number = -1; const MODE_DEFAULT: number = -1;
@ -15,7 +15,7 @@ const MODE_PURCHASABLE_CLOTHING: number = 0;
export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewProps> = props => 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 [ mode, setMode ] = useState(MODE_DEFAULT);
const [ gender, setGender ] = useState<string>(FigureData.MALE); const [ gender, setGender ] = useState<string>(FigureData.MALE);
const [ newFigure, setNewFigure ] = useState<string>(null); const [ newFigure, setNewFigure ] = useState<string>(null);
@ -26,7 +26,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
GetConnection().send(new RedeemItemClothingComposer(objectId)); GetConnection().send(new RedeemItemClothingComposer(objectId));
GetConnection().send(new UserFigureComposer(gender, newFigure)); GetConnection().send(new UserFigureComposer(gender, newFigure));
close(); onClose();
} }
useEffect(() => useEffect(() =>
@ -62,7 +62,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
if(mode === MODE_DEFAULT) if(mode === MODE_DEFAULT)
{ {
close(); onClose();
return; return;
} }
@ -73,13 +73,13 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
// if owns clothing, change to it // if owns clothing, change to it
setMode(mode); setMode(mode);
}, [ roomSession, objectId, close ]); }, [ roomSession, objectId, onClose ]);
if(mode === MODE_DEFAULT) return null; if(mode === MODE_DEFAULT) return null;
return ( return (
<NitroCardView className="nitro-use-product-confirmation"> <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> <NitroCardContentView center>
<Flex gap={ 2 } overflow="hidden"> <Flex gap={ 2 } overflow="hidden">
<Column> <Column>
@ -93,7 +93,7 @@ export const PurchasableClothingConfirmView: FC<PurchasableClothingConfirmViewPr
<Text>{ LocalizeText('useproduct.widget.info.bind_clothing') }</Text> <Text>{ LocalizeText('useproduct.widget.info.bind_clothing') }</Text>
</Column> </Column>
<Flex alignItems="center" justifyContent="between"> <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> <Button variant="success" onClick={ useProduct }>{ LocalizeText('useproduct.widget.bind_clothing') }</Button>
</Flex> </Flex>
</Column> </Column>

View File

@ -21,7 +21,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
const [ needsSave, setNeedsSave ] = useState<boolean>(false); const [ needsSave, setNeedsSave ] = useState<boolean>(false);
const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null, saveWired = null } = useWired(); const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null, saveWired = null } = useWired();
const close = () => setTrigger(null); const onClose = () => setTrigger(null);
const onSave = () => const onSave = () =>
{ {
@ -85,7 +85,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
return ( return (
<NitroCardView uniqueKey="nitro-wired" className="nitro-wired" theme="primary-slim"> <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> <NitroCardContentView>
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex alignItems="center" gap={ 1 }> <Flex alignItems="center" gap={ 1 }>
@ -103,7 +103,7 @@ export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
</> } </> }
<Flex alignItems="center" gap={ 1 }> <Flex alignItems="center" gap={ 1 }>
<Button fullWidth variant="success" onClick={ onSave }>{ LocalizeText('wiredfurni.ready') }</Button> <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> </Flex>
</NitroCardContentView> </NitroCardContentView>
</NitroCardView> </NitroCardView>

View File

@ -17,7 +17,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
const applyToner = () => SendMessageComposer(new ApplyTonerComposer(objectId, hue, saturation, lightness)); const applyToner = () => SendMessageComposer(new ApplyTonerComposer(objectId, hue, saturation, lightness));
const toggleToner = () => roomSession.useMultistateItem(objectId); const toggleToner = () => roomSession.useMultistateItem(objectId);
const close = () => const onClose = () =>
{ {
DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.CLEAR_PREVIEW)); DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.CLEAR_PREVIEW));
@ -46,7 +46,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; if((event.id !== objectId) || (event.category !== category)) return;
close(); onClose();
}); });
useEffect(() => useEffect(() =>
@ -56,7 +56,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.PREVIEW, hue, saturation, lightness)); DispatchUiEvent(new RoomWidgetUpdateBackgroundColorPreviewEvent(RoomWidgetUpdateBackgroundColorPreviewEvent.PREVIEW, hue, saturation, lightness));
}, [ objectId, category, 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; export const useFurnitureBackgroundColorWidget = useFurnitureBackgroundColorWidgetState;

View File

@ -16,7 +16,7 @@ const useFurnitureBadgeDisplayWidgetState = () =>
const [ senderName, setSenderName ] = useState(''); const [ senderName, setSenderName ] = useState('');
const { simpleAlert = null } = useNotification(); const { simpleAlert = null } = useNotification();
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -66,10 +66,10 @@ const useFurnitureBadgeDisplayWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureBadgeDisplayWidget = useFurnitureBadgeDisplayWidgetState;

View File

@ -19,7 +19,7 @@ const useFurnitureContextMenuWidgetState = () =>
const [ isGroupMember, setIsGroupMember ] = useState(false); const [ isGroupMember, setIsGroupMember ] = useState(false);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
const close = useCallback(() => const onClose = useCallback(() =>
{ {
setObjectId(-1); setObjectId(-1);
setGroupData(null); setGroupData(null);
@ -63,7 +63,7 @@ const useFurnitureContextMenuWidgetState = () =>
} }
} }
close(); onClose();
} }
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>([ useRoomEngineEvent<RoomEngineTriggerWidgetEvent>([
@ -86,7 +86,7 @@ const useFurnitureContextMenuWidgetState = () =>
setConfirmingObjectId(object.id); setConfirmingObjectId(object.id);
setConfirmMode(MONSTERPLANT_SEED_CONFIRMATION); setConfirmMode(MONSTERPLANT_SEED_CONFIRMATION);
close(); onClose();
return; return;
case RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG: case RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG:
if(!IsOwnerOfFurniture(object)) return; if(!IsOwnerOfFurniture(object)) return;
@ -94,7 +94,7 @@ const useFurnitureContextMenuWidgetState = () =>
setConfirmingObjectId(object.id); setConfirmingObjectId(object.id);
setConfirmMode(EFFECTBOX_OPEN); setConfirmMode(EFFECTBOX_OPEN);
close(); onClose();
return; return;
case RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG: case RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:
if(!IsOwnerOfFurniture(object)) return; if(!IsOwnerOfFurniture(object)) return;
@ -102,7 +102,7 @@ const useFurnitureContextMenuWidgetState = () =>
setConfirmingObjectId(object.id); setConfirmingObjectId(object.id);
setConfirmMode(PURCHASABLE_CLOTHING_CONFIRMATION); setConfirmMode(PURCHASABLE_CLOTHING_CONFIRMATION);
close(); onClose();
return; return;
case RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU: case RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU:
@ -128,7 +128,7 @@ const useFurnitureContextMenuWidgetState = () =>
return; return;
case RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU: case RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU:
if(object.id === objectId) close(); if(object.id === objectId) onClose();
return; return;
} }
}); });
@ -143,7 +143,7 @@ const useFurnitureContextMenuWidgetState = () =>
setMode(GROUP_FURNITURE); 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; export const useFurnitureContextMenuWidget = useFurnitureContextMenuWidgetState;

View File

@ -10,7 +10,7 @@ const useFurnitureExchangeWidgetState = () =>
const [ category, setCategory ] = useState(-1); const [ category, setCategory ] = useState(-1);
const [ value, setValue ] = useState(0); const [ value, setValue ] = useState(0);
const close = useCallback(() => const onClose = useCallback(() =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -21,7 +21,7 @@ const useFurnitureExchangeWidgetState = () =>
{ {
GetRoomSession().connection.send(new FurnitureExchangeComposer(objectId)); GetRoomSession().connection.send(new FurnitureExchangeComposer(objectId));
close(); onClose();
} }
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, event => useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, event =>
@ -39,10 +39,10 @@ const useFurnitureExchangeWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; if((event.id !== objectId) || (event.category !== category)) return;
close(); onClose();
}); });
return { objectId, value, redeem, close }; return { objectId, value, redeem, onClose };
} }
export const useFurnitureExchangeWidget = useFurnitureExchangeWidgetState; export const useFurnitureExchangeWidget = useFurnitureExchangeWidgetState;

View File

@ -10,7 +10,7 @@ const useFurnitureExternalImageWidgetState = () =>
const [ category, setCategory ] = useState(-1); const [ category, setCategory ] = useState(-1);
const [ photoData, setPhotoData ] = useState<IPhotoData>(null); const [ photoData, setPhotoData ] = useState<IPhotoData>(null);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -35,10 +35,10 @@ const useFurnitureExternalImageWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; if((event.id !== objectId) || (event.category !== category)) return;
close(); onClose();
}); });
return { objectId, photoData, close }; return { objectId, photoData, onClose };
} }
export const useFurnitureExternalImageWidget = useFurnitureExternalImageWidgetState; export const useFurnitureExternalImageWidget = useFurnitureExternalImageWidgetState;

View File

@ -14,7 +14,7 @@ const useFurnitureFriendFurniWidgetState = () =>
const [ date, setDate ] = useState<string>(null); const [ date, setDate ] = useState<string>(null);
const [ stage, setStage ] = useState(0); const [ stage, setStage ] = useState(0);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -28,7 +28,7 @@ const useFurnitureFriendFurniWidgetState = () =>
{ {
GetRoomSession().connection.send(new FriendFurniConfirmLockMessageComposer(objectId, flag)); GetRoomSession().connection.send(new FriendFurniConfirmLockMessageComposer(objectId, flag));
close(); onClose();
} }
useMessageEvent<LoveLockFurniStartEvent>(LoveLockFurniStartEvent, event => useMessageEvent<LoveLockFurniStartEvent>(LoveLockFurniStartEvent, event =>
@ -39,8 +39,8 @@ const useFurnitureFriendFurniWidgetState = () =>
setStage(parser.start ? 1 : 2); setStage(parser.start ? 1 : 2);
}); });
useMessageEvent<LoveLockFurniFinishedEvent>(LoveLockFurniFinishedEvent, event => close()); useMessageEvent<LoveLockFurniFinishedEvent>(LoveLockFurniFinishedEvent, event => onClose());
useMessageEvent<LoveLockFurniFriendConfirmedEvent>(LoveLockFurniFriendConfirmedEvent, event => close()); useMessageEvent<LoveLockFurniFriendConfirmedEvent>(LoveLockFurniFriendConfirmedEvent, event => onClose());
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, event => useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, event =>
{ {
@ -66,10 +66,10 @@ const useFurnitureFriendFurniWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureFriendFurniWidget = useFurnitureFriendFurniWidgetState;

View File

@ -13,7 +13,7 @@ const useFurnitureMannequinWidgetState = () =>
const [ clubLevel, setClubLevel ] = useState(HabboClubLevelEnum.NO_CLUB); const [ clubLevel, setClubLevel ] = useState(HabboClubLevelEnum.NO_CLUB);
const [ name, setName ] = useState(null); const [ name, setName ] = useState(null);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -28,7 +28,7 @@ const useFurnitureMannequinWidgetState = () =>
SendMessageComposer(new FurnitureMannequinSaveLookComposer(objectId)); SendMessageComposer(new FurnitureMannequinSaveLookComposer(objectId));
close(); onClose();
} }
const wearFigure = () => const wearFigure = () =>
@ -37,7 +37,7 @@ const useFurnitureMannequinWidgetState = () =>
SendMessageComposer(new FurnitureMultiStateComposer(objectId)); SendMessageComposer(new FurnitureMultiStateComposer(objectId));
close(); onClose();
} }
const saveName = () => const saveName = () =>
@ -71,10 +71,10 @@ const useFurnitureMannequinWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureMannequinWidget = useFurnitureMannequinWidgetState;

View File

@ -25,7 +25,7 @@ const useFurniturePresentWidgetState = () =>
const [ imageUrl, setImageUrl ] = useState<string>(null); const [ imageUrl, setImageUrl ] = useState<string>(null);
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setClassId(-1); setClassId(-1);
@ -199,7 +199,7 @@ const useFurniturePresentWidgetState = () =>
if(!roomObject) return null; if(!roomObject) return null;
close(); onClose();
setObjectId(event.objectId); setObjectId(event.objectId);
setClassId(-1); setClassId(-1);
@ -211,7 +211,7 @@ const useFurniturePresentWidgetState = () =>
useFurniRemovedEvent((objectId !== -1), event => useFurniRemovedEvent((objectId !== -1), event =>
{ {
if(event.id === objectId) close(); if(event.id === objectId) onClose();
if(event.id === placedItemId) 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; export const useFurniturePresentWidget = useFurniturePresentWidgetState;

View File

@ -13,7 +13,7 @@ const useFurnitureStackHeightWidgetState = () =>
const [ height, setHeight ] = useState(0); const [ height, setHeight ] = useState(0);
const [ pendingHeight, setPendingHeight ] = useState(-1); const [ pendingHeight, setPendingHeight ] = useState(-1);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -61,7 +61,7 @@ const useFurnitureStackHeightWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; if((event.id !== objectId) || (event.category !== category)) return;
close(); onClose();
}); });
useEffect(() => useEffect(() =>
@ -73,7 +73,7 @@ const useFurnitureStackHeightWidgetState = () =>
return () => clearTimeout(timeout); return () => clearTimeout(timeout);
}, [ objectId, pendingHeight ]); }, [ objectId, pendingHeight ]);
return { objectId, height, maxHeight: MAX_HEIGHT, close, updateHeight }; return { objectId, height, maxHeight: MAX_HEIGHT, onClose, updateHeight };
} }
export const useFurnitureStackHeightWidget = useFurnitureStackHeightWidgetState; export const useFurnitureStackHeightWidget = useFurnitureStackHeightWidgetState;

View File

@ -12,7 +12,7 @@ const useFurnitureStickieWidgetState = () =>
const [ text, setText ] = useState(''); const [ text, setText ] = useState('');
const [ canModify, setCanModify ] = useState(false); const [ canModify, setCanModify ] = useState(false);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -73,10 +73,10 @@ const useFurnitureStickieWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureStickieWidget = useFurnitureStickieWidgetState;

View File

@ -13,7 +13,7 @@ const useFurnitureTrophyWidgetState = () =>
const [ date, setDate ] = useState(''); const [ date, setDate ] = useState('');
const [ message, setMessage ] = useState(''); const [ message, setMessage ] = useState('');
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -54,10 +54,10 @@ const useFurnitureTrophyWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureTrophyWidget = useFurnitureTrophyWidgetState;

View File

@ -21,7 +21,7 @@ const useFurnitureYoutubeWidgetState = () =>
const [ playlists, setPlaylists ] = useState<YoutubeDisplayPlaylist[]>(null); const [ playlists, setPlaylists ] = useState<YoutubeDisplayPlaylist[]>(null);
const [ hasControl, setHasControl ] = useState(false); const [ hasControl, setHasControl ] = useState(false);
const close = () => const onClose = () =>
{ {
setObjectId(-1); setObjectId(-1);
setCategory(-1); setCategory(-1);
@ -118,10 +118,10 @@ const useFurnitureYoutubeWidgetState = () =>
{ {
if((event.id !== objectId) || (event.category !== category)) return; 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; export const useFurnitureYoutubeWidget = useFurnitureYoutubeWidgetState;

View File

@ -9,7 +9,7 @@ const useFurniChooserWidgetState = () =>
const [ items, setItems ] = useState<RoomObjectItem[]>(null); const [ items, setItems ] = useState<RoomObjectItem[]>(null);
const { roomSession = null } = useRoom(); 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); 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; export const useFurniChooserWidget = useFurniChooserWidgetState;

View File

@ -9,7 +9,7 @@ const useUserChooserWidgetState = () =>
const [ items, setItems ] = useState<RoomObjectItem[]>(null); const [ items, setItems ] = useState<RoomObjectItem[]>(null);
const { roomSession = null } = useRoom(); 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); 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; export const useUserChooserWidget = useUserChooserWidgetState;