Skip to content

Commit

Permalink
Report room enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
oobjectt committed Dec 10, 2022
1 parent b479210 commit 54e0332
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/navigator/views/NavigatorRoomInfoView.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { RoomMuteComposer, RoomSettingsComposer, SecurityLevel, ToggleStaffPickMessageComposer, UpdateHomeRoomMessageComposer } from '@nitrots/nitro-renderer';
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 { RoomWidgetThumbnailEvent } from '../../../events';
import { useNavigator } from '../../../hooks';
import { useHelp, useNavigator } from '../../../hooks';

export class NavigatorRoomInfoViewProps
{
Expand All @@ -16,6 +16,7 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
const { onCloseClick = null } = props;
const [ isRoomPicked, setIsRoomPicked ] = useState(false);
const [ isRoomMuted, setIsRoomMuted ] = useState(false);
const { report = null } = useHelp();
const { navigatorData = null } = useNavigator();

const hasPermission = (permission: string) =>
Expand Down Expand Up @@ -71,6 +72,9 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
case 'open_floorplan_editor':
CreateLinkEvent('floor-editor/toggle');
return;
case 'report_room':
report(ReportType.ROOM, { roomId: navigatorData.enteredGuestRoom.roomId, roomName: navigatorData.enteredGuestRoom.roomName });
return;
case 'close':
onCloseClick();
return;
Expand Down Expand Up @@ -147,7 +151,7 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
<Button onClick={ () => processAction('toggle_pick') }>
{ LocalizeText(isRoomPicked ? 'navigator.staffpicks.unpick' : 'navigator.staffpicks.pick') }
</Button> }
<Button variant="danger" disabled>
<Button variant="danger" onClick={ () => processAction('report_room') }>
{ LocalizeText('help.emergency.main.report.room') }
</Button>
{ hasPermission('settings') &&
Expand Down

0 comments on commit 54e0332

Please sign in to comment.