@@ -4,7 +4,7 @@ import { Box, Button, Divider, SelectChangeEvent, Stack, Typography } from "@mui
44import { ErrorBoundary , Suspense } from "@suspensive/react" ;
55import { enqueueSnackbar , OptionsObject } from "notistack" ;
66import * as React from "react" ;
7- import { Navigate , useParams } from "react-router-dom" ;
7+ import { Link , Navigate , useParams } from "react-router-dom" ;
88import * as R from "remeda" ;
99
1010import { useAppContext } from "../../contexts/app_context" ;
@@ -57,12 +57,14 @@ const InnerSessionEditor: React.FC = () => {
5757 const participantPortalClient = Common . Hooks . BackendParticipantPortalAPI . useParticipantPortalClient ( ) ;
5858 const updateSessionMutation = Common . Hooks . BackendParticipantPortalAPI . useUpdatePresentationMutation ( participantPortalClient ) ;
5959 const { data : session } = Common . Hooks . BackendParticipantPortalAPI . useRetrievePresentationQuery ( participantPortalClient , sessionId || "" ) ;
60+ const { data : profile } = Common . Hooks . BackendParticipantPortalAPI . useSignedInUserQuery ( participantPortalClient ) ;
6061 const [ editorState , setEditorState ] = React . useState < SessionEditorState > ( {
6162 openSubmitConfirmDialog : false ,
6263 ...( session || DummySessionInfo ) ,
6364 } ) ;
6465
65- if ( ! sessionId || ! session || ! ( R . isArray ( editorState . speakers ) && ! R . isEmpty ( editorState . speakers ) ) ) return < Navigate to = "/" replace /> ;
66+ if ( ! sessionId || ! session || ! profile || ! ( R . isArray ( editorState . speakers ) && ! R . isEmpty ( editorState . speakers ) ) )
67+ return < Navigate to = "/" replace /> ;
6668
6769 // 유저는 하나의 세션에 발표자가 한번만 가능하고, 백엔드에서 본 유저의 세션 발표자 정보만 제공하므로, 첫 번째 발표자 정보를 사용해도 안전합니다.
6870 const speaker = editorState . speakers [ 0 ] ;
@@ -137,6 +139,7 @@ const InnerSessionEditor: React.FC = () => {
137139 description_ko : editorState . description_ko ,
138140 description_en : editorState . description_en ,
139141 image : editorState . image || null ,
142+ speakers : editorState . speakers ,
140143 } ,
141144 {
142145 onSuccess : ( ) => {
@@ -198,6 +201,26 @@ const InnerSessionEditor: React.FC = () => {
198201
199202 < SecondaryTitle variant = "h5" children = { titleStrForSpeaker } />
200203 < Box sx = { { width : "100%" , mb : 2 , textAlign : "start" } } children = { speakerEditDescription } />
204+ < MultiLanguageField
205+ label = { { ko : "발표자 별칭" , en : "Speaker Nickname" } }
206+ description = { {
207+ ko : (
208+ < Stack spacing = { 1 } >
209+ < Typography variant = "body2" color = "textSecondary" children = "발표자 별칭은 프로필 편집에서 변경할 수 있어요." />
210+ < Link to = "/user" children = { < Button size = "small" variant = "contained" children = "프로필 수정 페이지로 이동" /> } />
211+ </ Stack >
212+ ) ,
213+ en : (
214+ < Stack spacing = { 1 } >
215+ < Typography variant = "body2" color = "textSecondary" children = "You can change speaker nickname in the profile editor." />
216+ < Link to = "/user" children = { < Button size = "small" variant = "contained" children = "Go to Profile Editor" /> } />
217+ </ Stack >
218+ ) ,
219+ } }
220+ value = { { ko : profile . nickname_ko || "" , en : profile . nickname_en || "" } }
221+ disabled
222+ fullWidth
223+ />
201224 < MultiLanguageMarkdownField
202225 label = { { ko : "발표자 소개" , en : "Speaker Biography" } }
203226 value = { { ko : speaker . biography_ko || "" , en : speaker . biography_en || "" } }
0 commit comments