From 78cd946335bddf7fe2a8f28fc6dbd803ac30fde9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 27 Nov 2021 04:48:13 -0300 Subject: [PATCH] batshit crazy --- public/renderer-config.json | 2 +- public/ui-config.json | 4 +- .../guide-tool/guide_tool_duty_switch.png | Bin 0 -> 537 bytes .../guide-tool/guide_tool_info_icon.png | Bin 0 -> 184 bytes src/events/guide-tool/GuideToolEvent.ts | 10 + src/events/guide-tool/index.ts | 1 + src/events/index.ts | 1 + src/views/Styles.scss | 1 + src/views/guide-tool/GuideToolView.scss | 27 +++ src/views/guide-tool/GuideToolView.tsx | 216 ++++++++++++++++++ .../guide-tool/common/GuideSessionState.ts | 21 ++ src/views/guide-tool/common/index.ts | 1 + .../guide-accept/GuideToolAcceptView.tsx | 30 +++ .../guide-accept/GuideToolAcceptView.types.ts | 6 + .../guide-tool-menu/GuideToolMenuView.tsx | 66 ++++++ .../GuideToolMenuView.types.ts | 14 ++ .../views/ongoing/GuideToolOngoingView.tsx | 27 +++ .../ongoing/GuideToolOngoingView.types.ts | 7 + .../GuildToolUserCreateRequestView.tsx | 15 ++ src/views/help/HelpView.scss | 3 +- src/views/help/HelpView.tsx | 2 +- src/views/help/views/DescribeReportView.tsx | 13 +- src/views/help/views/HelpIndexView.tsx | 34 ++- .../help/views/SelectReportedChatsView.tsx | 23 +- .../help/views/SelectReportedUserView.tsx | 26 +-- src/views/help/views/SelectTopicView.tsx | 39 ++-- src/views/main/MainView.tsx | 2 + src/views/toolbar/ToolbarView.tsx | 20 +- src/views/toolbar/ToolbarView.types.ts | 1 + src/views/toolbar/me/ToolbarMeView.tsx | 6 +- src/views/toolbar/me/ToolbarMeView.types.ts | 1 + 31 files changed, 535 insertions(+), 84 deletions(-) create mode 100644 src/assets/images/guide-tool/guide_tool_duty_switch.png create mode 100644 src/assets/images/guide-tool/guide_tool_info_icon.png create mode 100644 src/events/guide-tool/GuideToolEvent.ts create mode 100644 src/events/guide-tool/index.ts create mode 100644 src/views/guide-tool/GuideToolView.scss create mode 100644 src/views/guide-tool/GuideToolView.tsx create mode 100644 src/views/guide-tool/common/GuideSessionState.ts create mode 100644 src/views/guide-tool/common/index.ts create mode 100644 src/views/guide-tool/views/guide-accept/GuideToolAcceptView.tsx create mode 100644 src/views/guide-tool/views/guide-accept/GuideToolAcceptView.types.ts create mode 100644 src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.tsx create mode 100644 src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.types.ts create mode 100644 src/views/guide-tool/views/ongoing/GuideToolOngoingView.tsx create mode 100644 src/views/guide-tool/views/ongoing/GuideToolOngoingView.types.ts create mode 100644 src/views/guide-tool/views/user-create-request/GuildToolUserCreateRequestView.tsx diff --git a/public/renderer-config.json b/public/renderer-config.json index 40a50115..163a131d 100644 --- a/public/renderer-config.json +++ b/public/renderer-config.json @@ -30,7 +30,7 @@ "system.animation.fps": 24, "system.limits.fps": false, "system.dispatcher.log": false, - "system.packet.log": false, + "system.packet.log": true, "system.pong.manually": true, "system.pong.interval.ms": 20000, "room.color.skip.transition": true, diff --git a/public/ui-config.json b/public/ui-config.json index 050c4e4c..57a57347 100644 --- a/public/ui-config.json +++ b/public/ui-config.json @@ -5,7 +5,9 @@ "thumbnails.url": "https://nitro.nitrots.co/camera/thumbnail/%thumbnail%.png", "url.prefix": "http://localhost:3000", "floorplan.tile.url": "${asset.url}/floorplan-editor/tiles.json", - "habbopages.url": "http://localhost:3000/", + "habbopages.url": "${url.prefix}/", + "group.homepage.url": "${url.prefix}/groups/%groupid%/id", + "guide.help.alpha.groupid": 0, "chat.viewer.height.percentage": 0.40, "widget.dimmer.colorwheel": false, "hotelview": { diff --git a/src/assets/images/guide-tool/guide_tool_duty_switch.png b/src/assets/images/guide-tool/guide_tool_duty_switch.png new file mode 100644 index 0000000000000000000000000000000000000000..f7de6be96bfd11af9b9cf0ca66ac90c781e9e395 GIT binary patch literal 537 zcmV+!0_OdRP)28x7NWH%(Tzlc3o&>B@udVU3wR~!apk)9*L_ab-P`oRIYbff<3W!3>XEO zmU>=1AKGQuA#uB>ff}~ZYh?l@0mbKO{(PK}cs-UtSbkMwB|gBH2SJb-g*Dc&Fc95? z2`yA8o3P=~IlR_zw@Lw1UBlrk6%4@-A`ND8whDobMx)qfgTWv%(dV$%DNM!m^@Z2) z!}=>R7&57%&r8^FjVEJMDhx?`l}XPQ3d@rDg5eJv94kt}aFELelO|aYs~VRDsINVo z-GW7x>Y9q_MUfR0>sAOC1r`~-e_GL$O3ZAXuW!;c@-OIeqfR$jae1aKtcB&zJ)aX61x`wMP3n~70%($% bnUa10rA77?wG|{O00000NkvXXu0mjf-iqfB literal 0 HcmV?d00001 diff --git a/src/assets/images/guide-tool/guide_tool_info_icon.png b/src/assets/images/guide-tool/guide_tool_info_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..32c4a3531d85f39e7dcc6eaa55cff6eda3aa1568 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6H!3HD+Ytl-ARK2H*V@SoVw^JRt4k+-je4erA z?En7@mbQu=bSuw!vy%JXBOj#|Y0XoDwq@MRsk)HK*{F0uhN+H`mzuPg-fE_e+;I-~V k{Ys^S7d$>qxp+^uaJkH_!>z3>K&LQxy85}Sb4q9e0GcOBdH?_b literal 0 HcmV?d00001 diff --git a/src/events/guide-tool/GuideToolEvent.ts b/src/events/guide-tool/GuideToolEvent.ts new file mode 100644 index 00000000..f77cec35 --- /dev/null +++ b/src/events/guide-tool/GuideToolEvent.ts @@ -0,0 +1,10 @@ +import { NitroEvent } from '@nitrots/nitro-renderer'; + +export class GuideToolEvent extends NitroEvent +{ + public static readonly SHOW_GUIDE_TOOL: string = 'GTE_SHOW_GUIDE_TOOL'; + public static readonly HIDE_GUIDE_TOOL: string = 'GTE_HIDE_GUIDE_TOOL'; + public static readonly TOGGLE_GUIDE_TOOL: string = 'GTE_TOGGLE_GUIDE_TOOL'; + public static readonly CREATE_HELP_REQUEST: string = 'GTE_CREATE_HELP_REQUEST'; + public static readonly CREATE_BULLY_REQUEST: string = 'GTE_CREATE_BULLY_REQUEST'; +} diff --git a/src/events/guide-tool/index.ts b/src/events/guide-tool/index.ts new file mode 100644 index 00000000..6cbff543 --- /dev/null +++ b/src/events/guide-tool/index.ts @@ -0,0 +1 @@ +export * from './GuideToolEvent'; diff --git a/src/events/index.ts b/src/events/index.ts index 9d4842ca..cbb71d26 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -2,6 +2,7 @@ export * from './avatar-editor'; export * from './camera'; export * from './catalog'; export * from './friends'; +export * from './guide-tool'; export * from './inventory'; export * from './navigator'; export * from './notification-center'; diff --git a/src/views/Styles.scss b/src/views/Styles.scss index a727aa12..937d0a5a 100644 --- a/src/views/Styles.scss +++ b/src/views/Styles.scss @@ -24,3 +24,4 @@ @import './help/HelpView'; @import './floorplan-editor/FloorplanEditorView'; @import './nitropedia/NitropediaView'; +@import './guide-tool/GuideToolView'; diff --git a/src/views/guide-tool/GuideToolView.scss b/src/views/guide-tool/GuideToolView.scss new file mode 100644 index 00000000..ab7f4aec --- /dev/null +++ b/src/views/guide-tool/GuideToolView.scss @@ -0,0 +1,27 @@ +.nitro-guide-tool { + width: 250px; + + .duty-status { + border-radius: 0.25rem; + border-color: #B6BEC5 !important; + background-color: #CDD3D9; + border: 2px solid; + } + + .duty-switch { + width: 38px; + height: 21px; + cursor: pointer; + background-image: url(../../assets/images/guide-tool/guide_tool_duty_switch.png); + + &.off { + background-position: 0px -22px; + } + } + + .info-icon { + width: 23px; + height: 24px; + background-image: url(../../assets/images/guide-tool/guide_tool_info_icon.png); + } +} diff --git a/src/views/guide-tool/GuideToolView.tsx b/src/views/guide-tool/GuideToolView.tsx new file mode 100644 index 00000000..1382bdea --- /dev/null +++ b/src/views/guide-tool/GuideToolView.tsx @@ -0,0 +1,216 @@ +import { GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionStartedMessageEvent, ILinkEventTracker, PerkAllowancesMessageEvent, PerkEnum } from '@nitrots/nitro-renderer'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { AddEventLinkTracker, GetConfiguration, LocalizeText, RemoveLinkEventTracker } from '../../api'; +import { GuideToolEvent, NotificationAlertEvent } from '../../events'; +import { CreateMessageHook, dispatchUiEvent, SendMessageHook, useUiEvent } from '../../hooks'; +import { NitroCardHeaderView, NitroCardView } from '../../layout'; +import { GuideSessionState } from './common'; +import { GuideToolAcceptView } from './views/guide-accept/GuideToolAcceptView'; +import { GuideToolMenuView } from './views/guide-tool-menu/GuideToolMenuView'; +import { GuideToolOngoingView } from './views/ongoing/GuideToolOngoingView'; +import { GuildToolUserCreateRequestView } from './views/user-create-request/GuildToolUserCreateRequestView'; + +export const GuideToolView: FC<{}> = props => +{ + const [ isVisible, setIsVisible ] = useState(false); + const [ headerText, setHeaderText ] = useState(LocalizeText('guide.help.guide.tool.title')); + const [ sessionState, setSessionState ] = useState(GuideSessionState.GUIDE_TOOL_MENU); + + const [ isOnDuty, setIsOnDuty ] = useState(false); + const [ isHandlingBullyReports, setIsHandlingBullyReports ] = useState(false); + const [ isHandlingGuideRequests, setIsHandlingGuideRequests ] = useState(false); + const [ isHandlingHelpRequests, setIsHandlingHelpRequests ] = useState(false); + + const [ helpersOnDuty, setHelpersOnDuty ] = useState(0); + const [ guidesOnDuty, setGuidesOnDuty ] = useState(0); + const [ guardiansOnDuty, setGuardiansOnDuty ] = useState(0); + + const [ helpRequestDescription, setHelpRequestDescription ] = useState(null); + const [ helpRequestCountdown, setHelpRequestCountdown ] = useState(0); + + const [ ongoingUserId, setOngoingUserId ] = useState(0); + const [ ongoingUsername, setOngoingUsername ] = useState(null); + const [ ongoingFigure, setOngoingFigure ] = useState(null); + + const onGuideToolEvent = useCallback((event: GuideToolEvent) => + { + switch(event.type) + { + case GuideToolEvent.SHOW_GUIDE_TOOL: + setIsVisible(true); + return; + case GuideToolEvent.HIDE_GUIDE_TOOL: + setIsVisible(false); + return; + case GuideToolEvent.TOGGLE_GUIDE_TOOL: + setIsVisible(value => !value); + return; + case GuideToolEvent.CREATE_HELP_REQUEST: + setSessionState(GuideSessionState.USER_CREATE); + setHeaderText(LocalizeText('guide.help.request.user.create.title')); + setIsVisible(true); + return; + } + }, []); + + useUiEvent(GuideToolEvent.SHOW_GUIDE_TOOL, onGuideToolEvent); + useUiEvent(GuideToolEvent.HIDE_GUIDE_TOOL, onGuideToolEvent); + useUiEvent(GuideToolEvent.TOGGLE_GUIDE_TOOL, onGuideToolEvent); + useUiEvent(GuideToolEvent.CREATE_HELP_REQUEST, onGuideToolEvent); + + const onPerkAllowancesMessageEvent = useCallback((event: PerkAllowancesMessageEvent) => + { + const parser = event.getParser(); + + if(!parser.isAllowed(PerkEnum.USE_GUIDE_TOOL) && isOnDuty) + { + setIsOnDuty(false); + SendMessageHook(new GuideSessionOnDutyUpdateMessageComposer(false, false, false, false)); + } + }, [ isOnDuty, setIsOnDuty ]); + + CreateMessageHook(PerkAllowancesMessageEvent, onPerkAllowancesMessageEvent); + + const onGuideOnDutyStatusMessageEvent = useCallback((event: GuideOnDutyStatusMessageEvent) => + { + const parser = event.getParser(); + + setIsOnDuty(parser.onDuty); + setGuidesOnDuty(parser.guidesOnDuty); + setHelpersOnDuty(parser.helpersOnDuty); + setGuardiansOnDuty(parser.guardiansOnDuty); + }, [ setIsOnDuty, setHelpersOnDuty, setGuidesOnDuty, setGuardiansOnDuty ]); + + CreateMessageHook(GuideOnDutyStatusMessageEvent, onGuideOnDutyStatusMessageEvent); + + const onGuideSessionAttachedMessageEvent = useCallback((event: GuideSessionAttachedMessageEvent) => + { + const parser = event.getParser(); + + if(parser.asGuide) + { + if(!isOnDuty) return; + + setSessionState(GuideSessionState.GUIDE_ACCEPT); + setHeaderText(LocalizeText('guide.help.request.guide.accept.title')); + setHelpRequestDescription(parser.helpRequestDescription); + setHelpRequestCountdown(parser.roleSpecificWaitTime); + } + else + { + setSessionState(GuideSessionState.USER_PENDING); + setHeaderText(LocalizeText('guide.help.request.user.pending.title')); + setHelpRequestDescription(parser.helpRequestDescription); + } + + setIsVisible(true); + }, [ isOnDuty ]); + + CreateMessageHook(GuideSessionAttachedMessageEvent, onGuideSessionAttachedMessageEvent); + + const onGuideSessionStartedMessageEvent = useCallback((event: GuideSessionStartedMessageEvent) => + { + const parser = event.getParser(); + + if(isOnDuty) + { + setSessionState(GuideSessionState.GUIDE_ONGOING); + setHeaderText(LocalizeText('guide.help.request.guide.ongoing.title', ['name'], [parser.requesterName])); + setOngoingUserId(parser.requesterUserId); + setOngoingUsername(parser.requesterName); + setOngoingFigure(parser.requesterFigure); + } + else + { + setSessionState(GuideSessionState.USER_ONGOING); + setHeaderText(LocalizeText('guide.help.request.user.ongoing.title', ['name'], [parser.guideName])); + setOngoingUserId(parser.guideUserId); + setOngoingUsername(parser.guideName); + setOngoingFigure(parser.guideFigure); + } + + setIsVisible(true); + }, [ isOnDuty ]); + + CreateMessageHook(GuideSessionStartedMessageEvent, onGuideSessionStartedMessageEvent); + + const linkReceived = useCallback((url: string) => + { + const parts = url.split('/'); + + if(parts.length < 2) return; + + switch(parts[1]) + { + case 'tour': + //Create Tour Request + return; + } + }, []); + + useEffect(() => + { + const linkTracker: ILinkEventTracker = { + linkReceived, + eventUrlPrefix: 'help/' + }; + + AddEventLinkTracker(linkTracker); + + return () => RemoveLinkEventTracker(linkTracker); + }, [ linkReceived ]); + + const processAction = useCallback((action: string) => + { + switch(action) + { + case 'close': + setIsVisible(false); + return; + case 'toggle_duty': + if(!isHandlingBullyReports && !isHandlingGuideRequests && !isHandlingHelpRequests) + { + dispatchUiEvent(new NotificationAlertEvent([LocalizeText('guide.help.guide.tool.noqueueselected.message')], null, null, null, LocalizeText('guide.help.guide.tool.noqueueselected.caption'), null)); + return; + } + + setIsOnDuty(v => + { + SendMessageHook(new GuideSessionOnDutyUpdateMessageComposer(!v, v ? false : isHandlingGuideRequests, v ? false : isHandlingHelpRequests, v ? false : isHandlingBullyReports)); + return !v; + }); + + return; + case 'forum_link': + const url: string = GetConfiguration('group.homepage.url', '').replace('%groupid%', GetConfiguration('guide.help.alpha.groupid', '0')); + window.open(url); + return; + } + }, [isHandlingBullyReports, isHandlingGuideRequests, isHandlingHelpRequests]); + + if(!isVisible) return null; + + return ( + + processAction('close') } /> + { sessionState === GuideSessionState.GUIDE_TOOL_MENU && + } + { sessionState === GuideSessionState.GUIDE_ACCEPT && + } + { [ GuideSessionState.GUIDE_ONGOING, GuideSessionState.USER_ONGOING].includes(sessionState) && + } + { sessionState === GuideSessionState.USER_CREATE && } + + ); +}; diff --git a/src/views/guide-tool/common/GuideSessionState.ts b/src/views/guide-tool/common/GuideSessionState.ts new file mode 100644 index 00000000..02d225f0 --- /dev/null +++ b/src/views/guide-tool/common/GuideSessionState.ts @@ -0,0 +1,21 @@ +export class GuideSessionState +{ + public static readonly NONE: string = 'NONE'; + public static readonly ERROR: string = 'ERROR'; + public static readonly REJECTED: string = 'REJECTED'; + public static readonly USER_CREATE: string = 'USER_CREATE'; + public static readonly USER_PENDING: string = 'USER_PENDING'; + public static readonly USER_ONGOING: string = 'USER_ONGOING'; + public static readonly USER_FEEDBACK: string = 'USER_FEEDBACK'; + public static readonly USER_THANKS: string = 'USER_THANKS'; + public static readonly USER_GUIDE_DISCONNECTED: string = 'USER_GUIDE_DISCONNECTED'; + public static readonly GUIDE_TOOL_MENU: string = 'GUIDE_TOOL_MENU'; + public static readonly GUIDE_ACCEPT: string = 'GUIDE_ACCEPT'; + public static readonly GUIDE_ONGOING: string = 'GUIDE_ONGOING'; + public static readonly GUIDE_CLOSED: string = 'GUIDE_CLOSED'; + public static readonly GUARDIAN_CHAT_REVIEW_ACCEPT: string = 'GUARDIAN_CHAT_REVIEW_ACCEPT'; + public static readonly GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS: string = 'GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS'; + public static readonly GUARDIAN_CHAT_REVIEW_VOTE: string = 'GUARDIAN_CHAT_REVIEW_VOTE'; + public static readonly GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS: string = 'GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS'; + public static readonly GUARDIAN_CHAT_REVIEW_RESULTS: string = 'GUARDIAN_CHAT_REVIEW_RESULTS'; +} diff --git a/src/views/guide-tool/common/index.ts b/src/views/guide-tool/common/index.ts new file mode 100644 index 00000000..e8583b2d --- /dev/null +++ b/src/views/guide-tool/common/index.ts @@ -0,0 +1 @@ +export * from './GuideSessionState'; diff --git a/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.tsx b/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.tsx new file mode 100644 index 00000000..9f4d4887 --- /dev/null +++ b/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.tsx @@ -0,0 +1,30 @@ +import { GuideSessionGuideDecidesMessageComposer } from '@nitrots/nitro-renderer'; +import { FC, useCallback } from 'react'; +import { LocalizeText } from '../../../../api'; +import { SendMessageHook } from '../../../../hooks'; +import { NitroCardContentView } from '../../../../layout'; +import { GuideToolAcceptViewProps } from './GuideToolAcceptView.types'; + +export const GuideToolAcceptView: FC = props => +{ + const { helpRequestDescription = null, helpRequestCountdown = 0, processAction = null } = props; + + const answerRequest = useCallback((response: boolean) => + { + SendMessageHook(new GuideSessionGuideDecidesMessageComposer(response)); + }, []); + + return ( + +
+
{ LocalizeText('guide.help.request.guide.accept.request.title') }
+
{ LocalizeText('guide.help.request.type.1') }
+
{ helpRequestDescription }
+
+
+ + +
+
+ ); +}; diff --git a/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.types.ts b/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.types.ts new file mode 100644 index 00000000..ff4fb926 --- /dev/null +++ b/src/views/guide-tool/views/guide-accept/GuideToolAcceptView.types.ts @@ -0,0 +1,6 @@ +export interface GuideToolAcceptViewProps +{ + helpRequestDescription: string; + helpRequestCountdown: number; + processAction: (action: string) => void; +} diff --git a/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.tsx b/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.tsx new file mode 100644 index 00000000..dae7667e --- /dev/null +++ b/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.tsx @@ -0,0 +1,66 @@ +import { FC } from 'react'; +import { LocalizeText } from '../../../../api'; +import { NitroCardContentView } from '../../../../layout'; +import { GuideToolMenuViewProps } from './GuideToolMenuView.types'; + +export const GuideToolMenuView: FC = props => +{ + const { + isOnDuty = false, + isHandlingGuideRequests = false, + setIsHandlingGuideRequests = null, + isHandlingHelpRequests = false, + setIsHandlingHelpRequests = null, + isHandlingBullyReports = false, + setIsHandlingBullyReports = null, + guidesOnDuty = 0, + helpersOnDuty = 0, + guardiansOnDuty = 0, + processAction = null + } = props; + + return ( + <> + +
+
+
processAction('toggle_duty') } /> +
+
+
{ LocalizeText('guide.help.guide.tool.yourstatus') }
+
{ LocalizeText(`guide.help.guide.tool.duty.${(isOnDuty ? 'on' : 'off')}`) }
+
+
+
+
{ LocalizeText('guide.help.guide.tool.tickettypeselection.caption') }
+
+ { setIsHandlingGuideRequests(e.target.checked) } } /> + +
+
+ { setIsHandlingHelpRequests(e.target.checked) } } /> + +
+
+ { setIsHandlingBullyReports(e.target.checked) } } /> + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+ + + ); +} diff --git a/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.types.ts b/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.types.ts new file mode 100644 index 00000000..9f3c8655 --- /dev/null +++ b/src/views/guide-tool/views/guide-tool-menu/GuideToolMenuView.types.ts @@ -0,0 +1,14 @@ +export interface GuideToolMenuViewProps +{ + isOnDuty: boolean; + isHandlingGuideRequests: boolean; + setIsHandlingGuideRequests: (value: boolean) => void; + isHandlingHelpRequests: boolean; + setIsHandlingHelpRequests: (value: boolean) => void; + isHandlingBullyReports: boolean; + setIsHandlingBullyReports: (value: boolean) => void; + guidesOnDuty: number; + helpersOnDuty: number; + guardiansOnDuty: number; + processAction: (action: string) => void; +} diff --git a/src/views/guide-tool/views/ongoing/GuideToolOngoingView.tsx b/src/views/guide-tool/views/ongoing/GuideToolOngoingView.tsx new file mode 100644 index 00000000..aee380e5 --- /dev/null +++ b/src/views/guide-tool/views/ongoing/GuideToolOngoingView.tsx @@ -0,0 +1,27 @@ +import { FC } from 'react'; +import { LocalizeText } from '../../../../api'; +import { NitroCardContentView } from '../../../../layout'; +import { GuideToolOngoingViewProps } from './GuideToolOngoingView.types'; + +export const GuideToolOngoingView: FC = props => +{ + const { isGuide = false, userId = 0, userName = null, userFigure = null } = props; + + return ( + +
+ { isGuide && } + { isGuide && } + { !isGuide &&
+
{ userName }
+
{ LocalizeText('guide.help.request.user.ongoing.guide.desc') }
+
} +
{ LocalizeText('guide.help.common.report.link') }
+
+
+
chat
+
+
{ LocalizeText('guide.help.request.' + (isGuide ? 'guide' : 'user') + '.ongoing.close.link') }
+
+ ); +}; diff --git a/src/views/guide-tool/views/ongoing/GuideToolOngoingView.types.ts b/src/views/guide-tool/views/ongoing/GuideToolOngoingView.types.ts new file mode 100644 index 00000000..c1f17b97 --- /dev/null +++ b/src/views/guide-tool/views/ongoing/GuideToolOngoingView.types.ts @@ -0,0 +1,7 @@ +export interface GuideToolOngoingViewProps +{ + isGuide: boolean; + userId: number; + userName: string; + userFigure: string; +} diff --git a/src/views/guide-tool/views/user-create-request/GuildToolUserCreateRequestView.tsx b/src/views/guide-tool/views/user-create-request/GuildToolUserCreateRequestView.tsx new file mode 100644 index 00000000..dd81430c --- /dev/null +++ b/src/views/guide-tool/views/user-create-request/GuildToolUserCreateRequestView.tsx @@ -0,0 +1,15 @@ +import { FC } from 'react'; +import { LocalizeText } from '../../../../api'; +import { NitroCardContentView } from '../../../../layout'; + +export const GuildToolUserCreateRequestView: FC<{}> = props => +{ + return ( + +
+ { LocalizeText('guide.help.request.user.create.help') } +
+ +
+ ); +}; diff --git a/src/views/help/HelpView.scss b/src/views/help/HelpView.scss index b6ba7d76..0ec4ade2 100644 --- a/src/views/help/HelpView.scss +++ b/src/views/help/HelpView.scss @@ -1,6 +1,5 @@ .nitro-help { - height: 430px; - width: 300px; + width: 280px; .index-image { background: url('../../assets/images/help/help_index.png'); diff --git a/src/views/help/HelpView.tsx b/src/views/help/HelpView.tsx index 9ebea6eb..5ee1dd9b 100644 --- a/src/views/help/HelpView.tsx +++ b/src/views/help/HelpView.tsx @@ -68,7 +68,7 @@ export const HelpView: FC<{}> = props => {isVisible && - + setIsVisible(false)} /> diff --git a/src/views/help/views/DescribeReportView.tsx b/src/views/help/views/DescribeReportView.tsx index f936d225..3b99e8be 100644 --- a/src/views/help/views/DescribeReportView.tsx +++ b/src/views/help/views/DescribeReportView.tsx @@ -34,17 +34,14 @@ export const DescribeReportView: FC<{}> = props => }, [helpReportState, message, setHelpReportState]); return ( - <> -
-

{LocalizeText('help.emergency.chat_report.subtitle')}

-
{LocalizeText('help.cfh.input.text')}
-
- +
+

{LocalizeText('help.emergency.chat_report.subtitle')}

+
{LocalizeText('help.cfh.input.text')}