Updated frontend-build to v12 (#962)

* feat: rebase previous frontend-build upgrade

* chore: make welcome message to default to empty
This commit is contained in:
Bilal Qamar
2023-01-30 22:20:07 +05:00
committed by GitHub
parent b500546e8d
commit b3d33667d4
164 changed files with 847 additions and 798 deletions

View File

@@ -7,7 +7,7 @@ import messages from './messages';
// This component shows an effort estimate provided by the backend block data. Either time, activities, or both.
function EffortEstimate(props) {
const EffortEstimate = (props) => {
const {
block: {
effortActivities,
@@ -54,7 +54,7 @@ function EffortEstimate(props) {
{content}
</span>
);
}
};
EffortEstimate.defaultProps = {
className: null,

View File

@@ -6,23 +6,21 @@ import { Hyperlink } from '@edx/paragon';
import messages from '../courseware/course/course-exit/messages';
function IntlDashboardLink({ intl }) {
return (
<Hyperlink
variant="muted"
isInline
destination={`${getConfig().LMS_BASE_URL}/dashboard`}
>
{intl.formatMessage(messages.dashboardLink)}
</Hyperlink>
);
}
const IntlDashboardLink = ({ intl }) => (
<Hyperlink
variant="muted"
isInline
destination={`${getConfig().LMS_BASE_URL}/dashboard`}
>
{intl.formatMessage(messages.dashboardLink)}
</Hyperlink>
);
IntlDashboardLink.propTypes = {
intl: intlShape.isRequired,
};
function IntlIdVerificationSupportLink({ intl }) {
const IntlIdVerificationSupportLink = ({ intl }) => {
if (!getConfig().SUPPORT_URL_ID_VERIFICATION) {
return null;
}
@@ -35,13 +33,13 @@ function IntlIdVerificationSupportLink({ intl }) {
{intl.formatMessage(messages.idVerificationSupportLink)}
</Hyperlink>
);
}
};
IntlIdVerificationSupportLink.propTypes = {
intl: intlShape.isRequired,
};
function IntlProfileLink({ intl }) {
const IntlProfileLink = ({ intl }) => {
const { username } = getAuthenticatedUser();
return (
@@ -53,7 +51,7 @@ function IntlProfileLink({ intl }) {
{intl.formatMessage(messages.profileLink)}
</Hyperlink>
);
}
};
IntlProfileLink.propTypes = {
intl: intlShape.isRequired,

View File

@@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { camelCaseObject, getConfig } from '@edx/frontend-platform';
@@ -50,13 +51,17 @@ async function calculateVoucherDiscount(voucher, sku, username) {
.then(res => camelCaseObject(res));
}
function StreakModal({
const CloseText = ({ intl }) => (
<span>
{intl.formatMessage(messages.streakButton)}
<span className="sr-only">. {intl.formatMessage(messages.streakButtonSrOnly)}</span>
</span>
);
const StreakModal = ({
courseId, metadataModel, streakLengthToCelebrate, intl, isStreakCelebrationOpen,
closeStreakCelebration, streakDiscountCouponEnabled, verifiedMode, ...rest
}) {
if (!isStreakCelebrationOpen) {
return null;
}
}) => {
const { org, celebrations, username } = useModel('courseHomeMeta', courseId);
const factoid = getRandomFactoid(intl, streakLengthToCelebrate);
// eslint-disable-next-line no-unused-vars
@@ -106,15 +111,11 @@ function StreakModal({
} else {
setDiscountPercent(0);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [streakDiscountCouponEnabled, username, verifiedMode]);
function CloseText() {
return (
<span>
{intl.formatMessage(messages.streakButton)}
<span className="sr-only">. {intl.formatMessage(messages.streakButtonSrOnly)}</span>
</span>
);
if (!isStreakCelebrationOpen) {
return null;
}
let upgradeUrl;
@@ -230,12 +231,12 @@ function StreakModal({
</>
)}
{ !queryingDiscount && !showOffer && (
<ModalDialog.CloseButton className="px-5" variant="primary"><CloseText /></ModalDialog.CloseButton>
<ModalDialog.CloseButton className="px-5" variant="primary"><CloseText intl={intl} /></ModalDialog.CloseButton>
)}
</ModalDialog.Footer>
</ModalDialog>
);
}
};
StreakModal.defaultProps = {
isStreakCelebrationOpen: false,