File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
frontend/packages/yki/src/components/registration/examSession Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ import { ExamSessionUtils } from 'utils/examSession';
20
20
21
21
const RegisterToExamButton = ( {
22
22
examSession,
23
- ariaLabel ,
23
+ ariaLabelPrefix ,
24
24
} : {
25
25
examSession : ExamSession ;
26
- ariaLabel ?: string ;
26
+ ariaLabelPrefix ?: string ;
27
27
} ) => {
28
28
const dispatch = useAppDispatch ( ) ;
29
29
const { t } = usePublicTranslation ( {
@@ -34,6 +34,12 @@ const RegisterToExamButton = ({
34
34
const { availablePlaces, availableQueue } =
35
35
ExamSessionUtils . getEffectiveRegistrationPeriodDetails ( examSession ) ;
36
36
37
+ const label = availablePlaces
38
+ ? t ( 'register' )
39
+ : availableQueue
40
+ ? t ( 'orderCancellationNotification' )
41
+ : t ( 'full' ) ;
42
+
37
43
return (
38
44
< CustomButtonLink
39
45
color = { Color . Secondary }
@@ -44,13 +50,9 @@ const RegisterToExamButton = ({
44
50
} }
45
51
to = { AppRoutes . ExamSession . replace ( / : e x a m S e s s i o n I d $ / , `${ examSession . id } ` ) }
46
52
fullWidth = { isPhone }
47
- aria-label = { ariaLabel }
53
+ aria-label = { ariaLabelPrefix ? ` ${ ariaLabelPrefix } : ${ label } ` : undefined }
48
54
>
49
- { availablePlaces
50
- ? t ( 'register' )
51
- : availableQueue
52
- ? t ( 'orderCancellationNotification' )
53
- : t ( 'full' ) }
55
+ { label }
54
56
</ CustomButtonLink >
55
57
) ;
56
58
} ;
@@ -207,7 +209,7 @@ const PublicExamSessionListingCellsForPhone = ({
207
209
{ registerActionAvailable ? (
208
210
< RegisterToExamButton
209
211
examSession = { examSession }
210
- ariaLabel = { translateCommon ( 'actions' ) }
212
+ ariaLabelPrefix = { translateCommon ( 'actions' ) }
211
213
/>
212
214
) : (
213
215
< Text
You can’t perform that action at this time.
0 commit comments