Report room enabled

This commit is contained in:
oobjectt 2022-12-10 21:31:30 +01:00
parent b479210aca
commit 54e0332ec6

View File

@ -1,10 +1,10 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { RoomMuteComposer, RoomSettingsComposer, SecurityLevel, ToggleStaffPickMessageComposer, UpdateHomeRoomMessageComposer } from '@nitrots/nitro-renderer'; import { RoomMuteComposer, RoomSettingsComposer, SecurityLevel, ToggleStaffPickMessageComposer, UpdateHomeRoomMessageComposer } from '@nitrots/nitro-renderer';
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { CreateLinkEvent, DispatchUiEvent, GetGroupInformation, GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../api'; import { CreateLinkEvent, DispatchUiEvent, GetGroupInformation, GetSessionDataManager, LocalizeText, ReportType, SendMessageComposer } from '../../../api';
import { Button, classNames, Column, Flex, LayoutBadgeImageView, LayoutRoomThumbnailView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text, UserProfileIconView } from '../../../common'; import { Button, classNames, Column, Flex, LayoutBadgeImageView, LayoutRoomThumbnailView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text, UserProfileIconView } from '../../../common';
import { RoomWidgetThumbnailEvent } from '../../../events'; import { RoomWidgetThumbnailEvent } from '../../../events';
import { useNavigator } from '../../../hooks'; import { useHelp, useNavigator } from '../../../hooks';
export class NavigatorRoomInfoViewProps export class NavigatorRoomInfoViewProps
{ {
@ -16,6 +16,7 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
const { onCloseClick = null } = props; const { onCloseClick = null } = props;
const [ isRoomPicked, setIsRoomPicked ] = useState(false); const [ isRoomPicked, setIsRoomPicked ] = useState(false);
const [ isRoomMuted, setIsRoomMuted ] = useState(false); const [ isRoomMuted, setIsRoomMuted ] = useState(false);
const { report = null } = useHelp();
const { navigatorData = null } = useNavigator(); const { navigatorData = null } = useNavigator();
const hasPermission = (permission: string) => const hasPermission = (permission: string) =>
@ -71,6 +72,9 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
case 'open_floorplan_editor': case 'open_floorplan_editor':
CreateLinkEvent('floor-editor/toggle'); CreateLinkEvent('floor-editor/toggle');
return; return;
case 'report_room':
report(ReportType.ROOM, { roomId: navigatorData.enteredGuestRoom.roomId, roomName: navigatorData.enteredGuestRoom.roomName });
return;
case 'close': case 'close':
onCloseClick(); onCloseClick();
return; return;
@ -147,7 +151,7 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
<Button onClick={ () => processAction('toggle_pick') }> <Button onClick={ () => processAction('toggle_pick') }>
{ LocalizeText(isRoomPicked ? 'navigator.staffpicks.unpick' : 'navigator.staffpicks.pick') } { LocalizeText(isRoomPicked ? 'navigator.staffpicks.unpick' : 'navigator.staffpicks.pick') }
</Button> } </Button> }
<Button variant="danger" disabled> <Button variant="danger" onClick={ () => processAction('report_room') }>
{ LocalizeText('help.emergency.main.report.room') } { LocalizeText('help.emergency.main.report.room') }
</Button> </Button>
{ hasPermission('settings') && { hasPermission('settings') &&