Skip to content

Commit 41eefef

Browse files
enhance(apps/frontend-manage): add display name to lecturer cockpit (#4953)
1 parent d9be47a commit 41eefef

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

apps/frontend-manage/src/components/liveQuiz/cockpit/LiveQuizTimeline.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@fortawesome/free-solid-svg-icons'
1212
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
1313
import { LocaleType } from '@klicker-uzh/graphql/dist/ops'
14-
import { Button, H1, Tooltip } from '@uzh-bf/design-system'
14+
import { Button, H1, H4, Tooltip } from '@uzh-bf/design-system'
1515
import { useTranslations } from 'next-intl'
1616
import Link from 'next/link'
1717
import { useRouter } from 'next/router'
@@ -28,6 +28,7 @@ interface LiveQuizTimelineProps {
2828
assessmentMode: boolean
2929
quizId: string
3030
quizName: string
31+
quizDisplayName: string
3132
quizPin?: string | null
3233
blocks?: QuizTimelineBlock[]
3334
language?: LocaleType | null
@@ -43,6 +44,7 @@ function LiveQuizTimeline({
4344
assessmentMode,
4445
quizId,
4546
quizName,
47+
quizDisplayName,
4648
quizPin,
4749
blocks = [],
4850
language,
@@ -114,13 +116,18 @@ function LiveQuizTimeline({
114116

115117
return (
116118
<div className="flex flex-col md:flex-row md:flex-wrap">
117-
<div className="flex flex-1 flex-row flex-wrap items-end justify-between gap-y-2 md:flex-auto md:pb-2">
118-
<div className="flex flex-row flex-wrap items-end gap-8">
119-
<H1 className={{ root: 'm-0 text-xl' }}>Quiz: {quizName}</H1>
120-
<RuntimeCounter startedAt={startedAt} />
119+
<div className="flex flex-1 flex-col items-center gap-y-2 pb-3 md:flex-wrap lg:flex-row lg:items-end">
120+
<div className="flex flex-1 flex-col flex-wrap items-center text-center lg:items-start lg:text-left">
121+
<H1>Quiz: {quizName}</H1>
122+
<H4>
123+
{t('manage.activityWizard.displayName')}: {quizDisplayName}
124+
</H4>
125+
</div>
126+
127+
<div className="flex flex-1 flex-col flex-wrap items-center justify-center gap-y-2 text-xl">
121128
{quizPin && (
122129
<span
123-
className="text-uzh-red-100 -mb-0.5 h-max text-xl font-bold"
130+
className="text-uzh-red-100 -mb-0.5 h-max flex-1 font-bold"
124131
data-cy="live-quiz-pin"
125132
>
126133
<span>{t('shared.generic.pin')}: </span>
@@ -130,10 +137,20 @@ function LiveQuizTimeline({
130137
</span>
131138
</span>
132139
)}
140+
<div className="flex flex-1 gap-8">
141+
<RuntimeCounter startedAt={startedAt} />
142+
</div>
133143
</div>
134144

135-
<div className="mt-1.5 flex flex-row flex-wrap items-end gap-2 sm:mt-0">
136-
<div className="flex w-full flex-row flex-wrap gap-2 sm:w-max">
145+
<div className="flex flex-1 flex-row flex-wrap justify-end gap-2">
146+
<div
147+
className={twMerge(
148+
'justify-center gap-2 sm:w-max sm:justify-end',
149+
assessmentMode
150+
? 'flex flex-1 flex-row flex-wrap'
151+
: 'grid grid-cols-2'
152+
)}
153+
>
137154
<Button
138155
onClick={() => setEmbedModalOpen(true)}
139156
disabled={isFeedbackQuiz}
@@ -146,7 +163,7 @@ function LiveQuizTimeline({
146163
</Button.Label>
147164
</Button>
148165
<Button
149-
className={{ root: 'h-8 sm:w-max' }}
166+
className={{ root: 'h-8' }}
150167
onClick={() => setQRModal(true)}
151168
data={{ cy: 'open-qr-modal' }}
152169
>

apps/frontend-manage/src/pages/quizzes/[id]/cockpit.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function Cockpit() {
6969
const {
7070
id,
7171
name,
72+
displayName,
7273
pinCode,
7374
isLiveQAEnabled,
7475
isGamificationEnabled,
@@ -89,6 +90,7 @@ function Cockpit() {
8990
assessmentMode={isAssessmentEnabled}
9091
quizId={id}
9192
quizName={name}
93+
quizDisplayName={displayName}
9294
quizPin={pinCode}
9395
blocks={blocks ?? []}
9496
language={course?.language ?? null}

0 commit comments

Comments
 (0)