mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +01:00
fix reporting
This commit is contained in:
parent
e589fb7539
commit
5e3483645d
@ -1,6 +1,6 @@
|
|||||||
import { GetCfhStatusMessageComposer } from '@nitrots/nitro-renderer';
|
import { GetCfhStatusMessageComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { DispatchUiEvent, LocalizeText, ReportState, SendMessageComposer } from '../../../api';
|
import { DispatchUiEvent, LocalizeText, ReportState, ReportType, SendMessageComposer } from '../../../api';
|
||||||
import { Button, Column, Text } from '../../../common';
|
import { Button, Column, Text } from '../../../common';
|
||||||
import { GuideToolEvent } from '../../../events';
|
import { GuideToolEvent } from '../../../events';
|
||||||
import { useHelp } from '../../../hooks';
|
import { useHelp } from '../../../hooks';
|
||||||
@ -14,8 +14,9 @@ export const HelpIndexView: FC<{}> = props =>
|
|||||||
setActiveReport(prevValue =>
|
setActiveReport(prevValue =>
|
||||||
{
|
{
|
||||||
const currentStep = ReportState.SELECT_USER;
|
const currentStep = ReportState.SELECT_USER;
|
||||||
|
const reportType = ReportType.BULLY;
|
||||||
|
|
||||||
return { ...prevValue, currentStep };
|
return { ...prevValue, currentStep, reportType };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ export const SelectReportedUserView: FC<{}> = props =>
|
|||||||
return Array.from(users.values());
|
return Array.from(users.values());
|
||||||
}, [ chatHistory ]);
|
}, [ chatHistory ]);
|
||||||
|
|
||||||
const submitUser = () =>
|
const submitUser = (userId: number) =>
|
||||||
{
|
{
|
||||||
if(selectedUserId <= 0) return;
|
if(userId <= 0) return;
|
||||||
|
|
||||||
setActiveReport(prevValue =>
|
setActiveReport(prevValue =>
|
||||||
{
|
{
|
||||||
return { ...prevValue, reportedUserId: selectedUserId, currentStep: ReportState.SELECT_CHATS };
|
return { ...prevValue, reportedUserId: userId, currentStep: ReportState.SELECT_CHATS };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ export const SelectReportedUserView: FC<{}> = props =>
|
|||||||
<Button variant="secondary" onClick={ back }>
|
<Button variant="secondary" onClick={ back }>
|
||||||
{ LocalizeText('generic.back') }
|
{ LocalizeText('generic.back') }
|
||||||
</Button>
|
</Button>
|
||||||
<Button disabled={ (selectedUserId <= 0) } onClick={ submitUser }>
|
<Button disabled={ (selectedUserId <= 0) } onClick={ () => submitUser(selectedUserId) }>
|
||||||
{ LocalizeText('help.emergency.main.submit.button') }
|
{ LocalizeText('help.emergency.main.submit.button') }
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Loading…
Reference in New Issue
Block a user