Skip to content

Commit a2b27a6

Browse files
authored
feat: Programs pages styled (#9)
* feat: Programs pages styled * fix: Package file updated
1 parent 78af716 commit a2b27a6

File tree

10 files changed

+19
-15
lines changed

10 files changed

+19
-15
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/course-home/outline-tab/DateSummary.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ const DateSummary = ({
3535
};
3636

3737
return (
38-
<li className="p-0 mb-3 small text-dark-500">
38+
<li className="p-0 px-3 mb-3 small">
3939
<div className="row">
4040
<FontAwesomeIcon icon={faCalendarAlt} className="ml-3 mt-1 mr-1" fixedWidth />
41-
<div className="ml-1 font-weight-bold">
41+
<div className="ml-1 font-weight-bold text-secondary">
4242
<FormattedDate
4343
value={dateBlock.date}
4444
day="numeric"

src/course-home/outline-tab/LmsHtmlFragment.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ import React, { useEffect, useRef } from 'react';
22
import PropTypes from 'prop-types';
33

44
import { getConfig } from '@edx/frontend-platform';
5+
import {
6+
getLocale, isRtl,
7+
} from '@edx/frontend-platform/i18n';
58

69
const LmsHtmlFragment = ({
710
className,
811
html,
912
title,
1013
...rest
1114
}) => {
15+
const isLocaleRtl = isRtl(getLocale());
1216
const wholePage = `
13-
<html>
17+
<html dir=${isLocaleRtl ? 'rtl' : 'ltr'}>
1418
<head>
1519
<base href="${getConfig().LMS_BASE_URL}" target="_parent">
1620
<link rel="stylesheet" href="/static/${getConfig().LEGACY_THEME_NAME ? `${getConfig().LEGACY_THEME_NAME}/` : ''}css/bootstrap/lms-main.css">

src/course-home/progress-tab/course-completion/CompletionDonutChart.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const CompletionDonutChart = ({ intl }) => {
3939
<circle className="donut-hole" fill="#fff" cx="21" cy="21" r="15.91549430918954" />
4040
<g className="donut-chart-text">
4141
<text x="50%" y="50%" className="donut-chart-number">
42-
{completePercentage}{isLocaleRtl && '\u200f'}%
42+
{completePercentage}%{isLocaleRtl && '\u200f'}
4343
</text>
4444
<text x="50%" y="50%" className="donut-chart-label">
4545
{intl.formatMessage(messages.donutLabel)}

src/course-home/progress-tab/grades/course-grade/CurrentGradeTooltip.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const CurrentGradeTooltip = ({ intl, tooltipClassName }) => {
4141
overlay={(
4242
<Popover id={`${isPassing ? 'passing' : 'non-passing'}-grade-tooltip`} aria-hidden="true" className={`grade-popover ${tooltipClassName}`}>
4343
<Popover.Content data-testid="currentGradeTooltipContent" className="text-white font-weight-bold">
44-
{currentGrade.toFixed(0)} {isLocaleRtl ? '\u200f' : ''}%
44+
{currentGrade.toFixed(0)}%
4545
</Popover.Content>
4646
</Popover>
4747
)}

src/course-home/progress-tab/grades/course-grade/PassingGradeTooltip.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const PassingGradeTooltip = ({ intl, passingGrade, tooltipClassName }) => {
2525
overlay={(
2626
<Popover id="minimum-grade-tooltip" className={`grade-popover bg-primary-500 ${tooltipClassName}`} aria-hidden="true">
2727
<Popover.Content className="text-white font-weight-bold">
28-
{passingGrade} {isLocaleRtl && '\u200f'}%
28+
{passingGrade}% {isLocaleRtl && '\u200f'}
2929
</Popover.Content>
3030
</Popover>
3131
)}

src/course-home/progress-tab/grades/detailed-grades/DetailedGradesTable.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const DetailedGradesTable = ({ intl }) => {
3535

3636
const detailedGradesData = subsectionScores.map((subsection) => ({
3737
subsectionTitle: <SubsectionTitleCell subsection={subsection} />,
38-
score: <span className={subsection.learnerHasAccess ? '' : 'greyed-out'}>{subsection.numPointsEarned}{isLocaleRtl ? '\\' : '/'}{subsection.numPointsPossible}</span>,
38+
score: <span className={subsection.learnerHasAccess ? '' : 'greyed-out'}>{subsection.numPointsEarned}<span className="sr-only">{isLocaleRtl ? '\\' : '/'}</span>/{subsection.numPointsPossible}</span>,
3939
}));
4040

4141
return (

src/course-home/progress-tab/grades/detailed-grades/ProblemScoreDrawer.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const ProblemScoreDrawer = ({ intl, problemScores, subsection }) => {
1616
<div className={classNames('col', 'p-0', { 'greyed-out': !subsection.learnerHasAccess })}>
1717
<ul className="list-unstyled row w-100 m-0" aria-labelledby="problem-score-label">
1818
{problemScores.map(problemScore => (
19-
<li className="ml-3">{problemScore.earned}{isLocaleRtl ? '\\' : '/'}{problemScore.possible}</li>
19+
<li className="ml-3">{problemScore.earned}<span className="sr-only">{isLocaleRtl ? '\\' : '/'}</span>/{problemScore.possible}</li>
2020
))}
2121
</ul>
2222
</div>

src/course-home/progress-tab/grades/grade-summary/GradeSummaryTable.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ const GradeSummaryTable = ({ intl, setAllOfSomeAssignmentTypeIsLocked }) => {
7474
type: {
7575
footnoteId, footnoteMarker, type: assignment.type, locked,
7676
},
77-
weight: { weight: `${(assignment.weight * 100).toFixed(0)}${isLocaleRtl ? '\u200f' : ''} %`, locked },
78-
grade: { grade: `${(assignment.averageGrade * 100).toFixed(0)}${isLocaleRtl ? '\u200f' : ''} %`, locked },
79-
weightedGrade: { weightedGrade: `${(assignment.weightedGrade * 100).toFixed(0)}${isLocaleRtl ? '\u200f' : ''} %`, locked },
77+
weight: { weight: `${(assignment.weight * 100).toFixed(0)}%${isLocaleRtl ? '\u200f' : ''}`, locked },
78+
grade: { grade: `${(assignment.averageGrade * 100).toFixed(0)}%${isLocaleRtl ? '\u200f' : ''}`, locked },
79+
weightedGrade: { weightedGrade: `${(assignment.weightedGrade * 100).toFixed(0)}%${isLocaleRtl ? '\u200f' : ''}`, locked },
8080
};
8181
});
8282
const getAssignmentTypeCell = (value) => (

src/course-home/progress-tab/grades/grade-summary/GradeSummaryTableFooter.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const GradeSummaryTableFooter = ({ intl }) => {
2828
<DataTable.TableFooter>
2929
<div className="row w-100 m-0">
3030
<div id="weighted-grade-summary" className="col-8 font-weight-semi-bold p-0">{intl.formatMessage(messages.weightedGradeSummary)}</div>
31-
<div data-testid="gradeSummaryFooterTotalWeightedGrade" aria-labelledby="weighted-grade-summary" className="col-4 p-0 text-right font-weight-semi-bold text-secondary">{totalGrade}{isLocaleRtl && '\u200f'} %</div>
31+
<div data-testid="gradeSummaryFooterTotalWeightedGrade" aria-labelledby="weighted-grade-summary" className="col-4 p-0 text-right font-weight-semi-bold text-secondary">{totalGrade}%{isLocaleRtl && '\u200f'}</div>
3232
</div>
3333
</DataTable.TableFooter>
3434
);

0 commit comments

Comments
 (0)