@@ -2,7 +2,10 @@ import React, { useEffect, useState } from 'react';
2
2
import { useLocation } from 'react-router-dom' ;
3
3
import PropTypes from 'prop-types' ;
4
4
5
- import { Form , Card , Icon } from '@openedx/paragon' ;
5
+ import {
6
+ Form , Card , Icon , useWindowSize , breakpoints ,
7
+ } from '@openedx/paragon' ;
8
+ import classNames from 'classnames' ;
6
9
import { history } from '@edx/frontend-platform' ;
7
10
import { sendTrackEvent } from '@edx/frontend-platform/analytics' ;
8
11
import { getAuthenticatedUser } from '@edx/frontend-platform/auth' ;
@@ -23,6 +26,7 @@ const WeeklyLearningGoalCard = ({
23
26
const {
24
27
courseId,
25
28
} = useSelector ( state => state . courseHome ) ;
29
+ const wideScreen = useWindowSize ( ) . width >= breakpoints . medium . minWidth ;
26
30
27
31
const {
28
32
isMasquerading,
@@ -94,11 +98,11 @@ const WeeklyLearningGoalCard = ({
94
98
data-testid = "weekly-learning-goal-card"
95
99
>
96
100
< Card . Header
97
- size = "sm"
101
+ size = { ! wideScreen ? 'sm' : 'md' }
98
102
title = { ( < div id = "set-weekly-goal-header" > { intl . formatMessage ( messages . setWeeklyGoal ) } </ div > ) }
99
103
subtitle = { intl . formatMessage ( messages . setWeeklyGoalDetail ) }
100
104
/>
101
- < Card . Section className = " text-gray-700 small" >
105
+ < Card . Section className = { classNames ( ' text-gray-700' , { small : ! wideScreen } ) } >
102
106
< div
103
107
role = "radiogroup"
104
108
aria-labelledby = "set-weekly-goal-header"
@@ -125,14 +129,17 @@ const WeeklyLearningGoalCard = ({
125
129
checked = { isGetReminderSelected }
126
130
onChange = { ( event ) => handleSubscribeToReminders ( event ) }
127
131
disabled = { ! daysPerWeekGoal }
132
+ className = { classNames ( { small : ! wideScreen } ) }
128
133
>
129
- < small > { intl . formatMessage ( messages . setGoalReminder ) } </ small >
134
+ { wideScreen
135
+ ? intl . formatMessage ( messages . setGoalReminder )
136
+ : < small > { intl . formatMessage ( messages . setGoalReminder ) } </ small > }
130
137
</ Form . Switch >
131
138
</ div >
132
139
</ Card . Section >
133
140
{ isGetReminderSelected && (
134
141
< Card . Section muted >
135
- < div className = "row w-100 m-0 small align-center" >
142
+ < div className = "row w-100 m-0 align-center" >
136
143
< div className = "d-flex align-items-center pr-1" >
137
144
< Icon
138
145
className = "text-primary-500"
0 commit comments