mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-30 00:50:50 +01:00
Changed requested changes
This commit is contained in:
parent
eb0c8a48ec
commit
84032c62d8
@ -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 { LocalizeText, ReportType, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
@ -16,8 +16,7 @@ export const ReportSummaryView: FC<{}> = props =>
|
||||
{
|
||||
case ReportType.BULLY:
|
||||
case ReportType.EMERGENCY:
|
||||
case ReportType.ROOM:
|
||||
case ReportType.PHOTO: {
|
||||
case ReportType.ROOM: {
|
||||
const reportedRoomId = ((activeReport.roomId <= 0) ? activeReport.reportedChats[0].roomId : activeReport.roomId);
|
||||
|
||||
activeReport.reportedChats.forEach(entry => chats.push(entry.webId, entry.message));
|
||||
@ -36,6 +35,9 @@ export const ReportSummaryView: FC<{}> = props =>
|
||||
case ReportType.MESSAGE:
|
||||
SendMessageComposer(new CallForHelpFromForumMessageMessageComposer(activeReport.groupId, activeReport.threadId, activeReport.messageId, activeReport.cfhTopic, activeReport.message));
|
||||
break;
|
||||
case ReportType.PHOTO:
|
||||
SendMessageComposer(new CallForHelpFromPhotoMessageComposer(activeReport.extraData, activeReport.roomId, activeReport.reportedUserId, activeReport.cfhTopic, activeReport.roomObjectId));
|
||||
break;
|
||||
}
|
||||
|
||||
setActiveReport(null);
|
||||
|
@ -1,20 +1,19 @@
|
||||
import { GetSessionDataManager, ReportType } from 'api';
|
||||
import { FC } from 'react';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { useFurnitureExternalImageWidget, useHelp, useNavigator } from '../../../../hooks';
|
||||
import { useFurnitureExternalImageWidget, useHelp } from '../../../../hooks';
|
||||
import { CameraWidgetShowPhotoView } from '../../../camera/views/CameraWidgetShowPhotoView';
|
||||
|
||||
export const FurnitureExternalImageView: FC<{}> = props =>
|
||||
{
|
||||
const { objectId = -1, currentPhotoIndex = -1, currentPhotos = null, onClose = null } = useFurnitureExternalImageWidget();
|
||||
const { navigatorData = null } = useNavigator();
|
||||
const { report = null } = useHelp();
|
||||
|
||||
if((objectId === -1) || (currentPhotoIndex === -1)) return null;
|
||||
|
||||
return (
|
||||
<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>
|
||||
<CameraWidgetShowPhotoView currentIndex={ currentPhotoIndex } currentPhotos={ currentPhotos } />
|
||||
</NitroCardContentView>
|
||||
|
@ -39,7 +39,6 @@ const useHelpState = () =>
|
||||
newReport.currentStep = ReportState.SELECT_CHATS;
|
||||
break;
|
||||
case ReportType.ROOM:
|
||||
case ReportType.PHOTO:
|
||||
newReport.roomId = options.roomId;
|
||||
newReport.roomName = options.roomName;
|
||||
newReport.currentStep = ReportState.SELECT_TOPICS;
|
||||
@ -55,6 +54,13 @@ const useHelpState = () =>
|
||||
newReport.messageId = options.messageId;
|
||||
newReport.currentStep = ReportState.SELECT_TOPICS;
|
||||
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:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user