Skip to content

Commit 4825757

Browse files
committed
put course info back
1 parent a5aa25f commit 4825757

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/client/components/ChatV2/ChatV2.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ const ChatV2Content = () => {
359359
onClose={() => {
360360
setChatLeftSidePanelOpen(false)
361361
}}
362+
course={course}
362363
setSettingsModalOpen={setSettingsModalOpen}
363364
setDisclaimerStatus={setDisclaimerStatus}
364365
messages={messages}
@@ -373,6 +374,7 @@ const ChatV2Content = () => {
373374
position: 'fixed',
374375
top: 0,
375376
}}
377+
course={course}
376378
handleReset={handleReset}
377379
setSettingsModalOpen={setSettingsModalOpen}
378380
setDisclaimerStatus={setDisclaimerStatus}
@@ -555,7 +557,7 @@ const LeftMenu = ({
555557
setModel,
556558
}: {
557559
sx?: object
558-
course?: Course
560+
course: Course | undefined
559561
handleReset: () => void
560562
onClose?: () => void
561563
setSettingsModalOpen: React.Dispatch<React.SetStateAction<boolean>>

src/client/components/ChatV2/general/ChatInfo.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useCourse from '../../../hooks/useCourse'
88
import { PUBLIC_URL } from '../../../../config'
99

1010
export const ChatInfo = ({ course }: { course: Course }) => {
11+
1112
const { user } = useCurrentUser()
1213
const { data: chatInstance } = useCourse(course.courseId)
1314
const { t, i18n } = useTranslation()
@@ -16,19 +17,21 @@ export const ChatInfo = ({ course }: { course: Course }) => {
1617
if (!chatInstance || !user) return null
1718

1819
const amongResponsibles = chatInstance.responsibilities ? chatInstance.responsibilities.some((r) => r.user.id === user.id) : false
20+
1921
return (
20-
<Box mb={3}>
21-
<Typography variant="body2" fontStyle="italic">
22+
<Box mt={2} mb={4}>
23+
<Typography variant="body1" fontStyle="italic">
2224
{course.courseUnits.map((unit) => unit.code).join(', ')}
2325
</Typography>
2426
<Typography variant="h5" sx={{ fontWeight: 'bold', mb: 1, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
2527
{course?.name[language] || 'undefined course'}
26-
{(user.isAdmin && amongResponsibles) && (<Link href={`${PUBLIC_URL}/courses/${course.courseId}`}>
27-
<Typography variant="body2">{t('course:settings')}</Typography>
28-
</Link>)
29-
}
3028
</Typography>
31-
<Typography variant="body2">{formatDate(course.activityPeriod)}</Typography>
29+
<Typography variant="body1">{formatDate(course.activityPeriod)}</Typography>
30+
{(user.isAdmin && amongResponsibles) &&
31+
(<Link href={`${PUBLIC_URL}/courses/${course.courseId}`}>
32+
<Typography >{t('course:settings')}</Typography>
33+
</Link>)
34+
}
3235
</Box >
3336
)
3437
}

0 commit comments

Comments
 (0)