Changed requested changes

This commit is contained in:
oobjectt 2022-12-11 21:23:40 +01:00
parent eb0c8a48ec
commit 84032c62d8
3 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import { CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpMessageComposer } from '@nitrots/nitro-renderer'; import { CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpMessageComposer } from '@nitrots/nitro-renderer';
import { FC } from 'react'; import { FC } from 'react';
import { LocalizeText, ReportType, SendMessageComposer } from '../../../api'; import { LocalizeText, ReportType, SendMessageComposer } from '../../../api';
import { Button, Column, Text } from '../../../common'; import { Button, Column, Text } from '../../../common';
@ -16,8 +16,7 @@ export const ReportSummaryView: FC<{}> = props =>
{ {
case ReportType.BULLY: case ReportType.BULLY:
case ReportType.EMERGENCY: case ReportType.EMERGENCY:
case ReportType.ROOM: case ReportType.ROOM: {
case ReportType.PHOTO: {
const reportedRoomId = ((activeReport.roomId <= 0) ? activeReport.reportedChats[0].roomId : activeReport.roomId); const reportedRoomId = ((activeReport.roomId <= 0) ? activeReport.reportedChats[0].roomId : activeReport.roomId);
activeReport.reportedChats.forEach(entry => chats.push(entry.webId, entry.message)); activeReport.reportedChats.forEach(entry => chats.push(entry.webId, entry.message));
@ -36,6 +35,9 @@ export const ReportSummaryView: FC<{}> = props =>
case ReportType.MESSAGE: case ReportType.MESSAGE:
SendMessageComposer(new CallForHelpFromForumMessageMessageComposer(activeReport.groupId, activeReport.threadId, activeReport.messageId, activeReport.cfhTopic, activeReport.message)); SendMessageComposer(new CallForHelpFromForumMessageMessageComposer(activeReport.groupId, activeReport.threadId, activeReport.messageId, activeReport.cfhTopic, activeReport.message));
break; break;
case ReportType.PHOTO:
SendMessageComposer(new CallForHelpFromPhotoMessageComposer(activeReport.extraData, activeReport.roomId, activeReport.reportedUserId, activeReport.cfhTopic, activeReport.roomObjectId));
break;
} }
setActiveReport(null); setActiveReport(null);

View File

@ -1,20 +1,19 @@
import { GetSessionDataManager, ReportType } from 'api'; import { GetSessionDataManager, ReportType } from 'api';
import { FC } from 'react'; import { FC } from 'react';
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common'; import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
import { useFurnitureExternalImageWidget, useHelp, useNavigator } from '../../../../hooks'; import { useFurnitureExternalImageWidget, useHelp } from '../../../../hooks';
import { CameraWidgetShowPhotoView } from '../../../camera/views/CameraWidgetShowPhotoView'; import { CameraWidgetShowPhotoView } from '../../../camera/views/CameraWidgetShowPhotoView';
export const FurnitureExternalImageView: FC<{}> = props => export const FurnitureExternalImageView: FC<{}> = props =>
{ {
const { objectId = -1, currentPhotoIndex = -1, currentPhotos = null, onClose = null } = useFurnitureExternalImageWidget(); const { objectId = -1, currentPhotoIndex = -1, currentPhotos = null, onClose = null } = useFurnitureExternalImageWidget();
const { navigatorData = null } = useNavigator();
const { report = null } = useHelp(); const { report = null } = useHelp();
if((objectId === -1) || (currentPhotoIndex === -1)) return null; if((objectId === -1) || (currentPhotoIndex === -1)) return null;
return ( return (
<NitroCardView className="nitro-external-image-widget" theme="primary-slim"> <NitroCardView className="nitro-external-image-widget" theme="primary-slim">
<NitroCardHeaderView headerText="" isGalleryPhoto={ true } onReportPhoto={ () => report(ReportType.PHOTO, { reportedUserId: GetSessionDataManager().userId, roomId: navigatorData.enteredGuestRoom.roomId, roomName: navigatorData.enteredGuestRoom.roomName }) } onCloseClick={ onClose } /> <NitroCardHeaderView headerText="" isGalleryPhoto={ true } onReportPhoto={ () => report(ReportType.PHOTO, { extraData: currentPhotos[currentPhotoIndex].w, roomId: currentPhotos[currentPhotoIndex].s, reportedUserId: GetSessionDataManager().userId, roomObjectId: Number(currentPhotos[currentPhotoIndex].u) }) } onCloseClick={ onClose } />
<NitroCardContentView> <NitroCardContentView>
<CameraWidgetShowPhotoView currentIndex={ currentPhotoIndex } currentPhotos={ currentPhotos } /> <CameraWidgetShowPhotoView currentIndex={ currentPhotoIndex } currentPhotos={ currentPhotos } />
</NitroCardContentView> </NitroCardContentView>

View File

@ -39,7 +39,6 @@ const useHelpState = () =>
newReport.currentStep = ReportState.SELECT_CHATS; newReport.currentStep = ReportState.SELECT_CHATS;
break; break;
case ReportType.ROOM: case ReportType.ROOM:
case ReportType.PHOTO:
newReport.roomId = options.roomId; newReport.roomId = options.roomId;
newReport.roomName = options.roomName; newReport.roomName = options.roomName;
newReport.currentStep = ReportState.SELECT_TOPICS; newReport.currentStep = ReportState.SELECT_TOPICS;
@ -55,6 +54,13 @@ const useHelpState = () =>
newReport.messageId = options.messageId; newReport.messageId = options.messageId;
newReport.currentStep = ReportState.SELECT_TOPICS; newReport.currentStep = ReportState.SELECT_TOPICS;
break; break;
case ReportType.PHOTO:
newReport.extraData = options.extraData;
newReport.roomId = options.roomId;
newReport.reportedUserId = options.reportedUserId;
newReport.roomObjectId = options.roomObjectId;
newReport.currentStep = ReportState.SELECT_TOPICS;
break;
case ReportType.GUIDE: case ReportType.GUIDE:
break; break;
} }