diff --git a/src/account-settings/Alert.jsx b/src/account-settings/Alert.jsx
index 6b69be1..39290fc 100644
--- a/src/account-settings/Alert.jsx
+++ b/src/account-settings/Alert.jsx
@@ -2,18 +2,16 @@ import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
-function Alert(props) {
- return (
-
-
- {props.icon}
-
-
- {props.children}
-
+const Alert = (props) => (
+
+
+ {props.icon}
- );
-}
+
+ {props.children}
+
+
+);
Alert.propTypes = {
className: PropTypes.string,
diff --git a/src/account-settings/DOBForm.jsx b/src/account-settings/DOBForm.jsx
index d93828a..3b14439 100644
--- a/src/account-settings/DOBForm.jsx
+++ b/src/account-settings/DOBForm.jsx
@@ -10,7 +10,7 @@ import { YEAR_OF_BIRTH_OPTIONS } from './data/constants';
import { editableFieldSelector } from './data/selectors';
import { saveSettingsReset } from './data/actions';
-function DOBModal(props) {
+const DOBModal = (props) => {
const {
saveState,
error,
@@ -131,7 +131,7 @@ function DOBModal(props) {
>
);
-}
+};
DOBModal.propTypes = {
saveState: PropTypes.oneOf(['default', 'pending', 'complete', 'error']),
diff --git a/src/account-settings/EditableField.jsx b/src/account-settings/EditableField.jsx
index aeaa750..1288cce 100644
--- a/src/account-settings/EditableField.jsx
+++ b/src/account-settings/EditableField.jsx
@@ -20,7 +20,7 @@ import {
import { editableFieldSelector } from './data/selectors';
import CertificatePreference from './certificate-preference/CertificatePreference';
-function EditableField(props) {
+const EditableField = (props) => {
const {
name,
label,
@@ -179,7 +179,7 @@ function EditableField(props) {
}}
/>
);
-}
+};
EditableField.propTypes = {
name: PropTypes.string.isRequired,
diff --git a/src/account-settings/EmailField.jsx b/src/account-settings/EmailField.jsx
index 9e74bb4..5922ecf 100644
--- a/src/account-settings/EmailField.jsx
+++ b/src/account-settings/EmailField.jsx
@@ -18,7 +18,7 @@ import {
} from './data/actions';
import { editableFieldSelector } from './data/selectors';
-function EmailField(props) {
+const EmailField = (props) => {
const {
name,
label,
@@ -169,7 +169,7 @@ function EmailField(props) {
}}
/>
);
-}
+};
EmailField.propTypes = {
name: PropTypes.string.isRequired,
diff --git a/src/account-settings/JumpNav.jsx b/src/account-settings/JumpNav.jsx
index f305899..2f76446 100644
--- a/src/account-settings/JumpNav.jsx
+++ b/src/account-settings/JumpNav.jsx
@@ -8,10 +8,10 @@ import { NavHashLink } from 'react-router-hash-link';
import Scrollspy from 'react-scrollspy';
import messages from './AccountSettingsPage.messages';
-function JumpNav({
+const JumpNav = ({
intl,
displayDemographicsLink,
-}) {
+}) => {
const stickToTop = useWindowSize().width > breakpoints.small.minWidth;
return (
@@ -69,7 +69,7 @@ function JumpNav({
);
-}
+};
JumpNav.propTypes = {
intl: intlShape.isRequired,
diff --git a/src/account-settings/NotFoundPage.jsx b/src/account-settings/NotFoundPage.jsx
index f4c087e..5dfa17a 100644
--- a/src/account-settings/NotFoundPage.jsx
+++ b/src/account-settings/NotFoundPage.jsx
@@ -1,16 +1,16 @@
import React from 'react';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
-export default function NotFoundPage() {
- return (
-
- );
-}
+const NotFoundPage = () => (
+
+);
+
+export default NotFoundPage;
diff --git a/src/account-settings/OneTimeDismissibleAlert.jsx b/src/account-settings/OneTimeDismissibleAlert.jsx
index fb6f4a1..a8683ad 100644
--- a/src/account-settings/OneTimeDismissibleAlert.jsx
+++ b/src/account-settings/OneTimeDismissibleAlert.jsx
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Alert } from '@edx/paragon';
-export default function OneTimeDismissibleAlert(props) {
+const OneTimeDismissibleAlert = (props) => {
const [dismissed, setDismissed] = useState(localStorage.getItem(props.id) !== 'true');
const onClose = () => {
@@ -25,7 +25,7 @@ export default function OneTimeDismissibleAlert(props) {
);
-}
+};
OneTimeDismissibleAlert.propTypes = {
id: PropTypes.string.isRequired,
@@ -41,3 +41,5 @@ OneTimeDismissibleAlert.defaultProps = {
header: undefined,
body: undefined,
};
+
+export default OneTimeDismissibleAlert;
diff --git a/src/account-settings/SwitchContent.jsx b/src/account-settings/SwitchContent.jsx
index 65aebb2..4d383d9 100644
--- a/src/account-settings/SwitchContent.jsx
+++ b/src/account-settings/SwitchContent.jsx
@@ -22,7 +22,7 @@ const onChildExit = (htmlNode) => {
}
};
-function SwitchContent({ expression, cases, className }) {
+const SwitchContent = ({ expression, cases, className }) => {
const getContent = (caseKey) => {
if (cases[caseKey]) {
if (typeof cases[caseKey] === 'string') {
@@ -48,7 +48,7 @@ function SwitchContent({ expression, cases, className }) {
{getContent(expression)}
);
-}
+};
SwitchContent.propTypes = {
expression: PropTypes.string,
diff --git a/src/account-settings/certificate-preference/CertificatePreference.jsx b/src/account-settings/certificate-preference/CertificatePreference.jsx
index 78befb0..4adb574 100644
--- a/src/account-settings/certificate-preference/CertificatePreference.jsx
+++ b/src/account-settings/certificate-preference/CertificatePreference.jsx
@@ -21,14 +21,14 @@ import { certPreferenceSelector } from '../data/selectors';
import commonMessages from '../AccountSettingsPage.messages';
import messages from './messages';
-function CertificatePreference({
+const CertificatePreference = ({
intl,
fieldName,
originalFullName,
originalVerifiedName,
saveState,
useVerifiedNameForCerts,
-}) {
+}) => {
const dispatch = useDispatch();
const [checked, setChecked] = useState(false);
const [modalIsOpen, setModalIsOpen] = useState(false);
@@ -152,7 +152,7 @@ function CertificatePreference({
>
) : null;
-}
+};
CertificatePreference.propTypes = {
intl: intlShape.isRequired,
diff --git a/src/account-settings/coaching/CoachingConsent.jsx b/src/account-settings/coaching/CoachingConsent.jsx
index c356068..bd3728f 100644
--- a/src/account-settings/coaching/CoachingConsent.jsx
+++ b/src/account-settings/coaching/CoachingConsent.jsx
@@ -17,28 +17,24 @@ import LogoSVG from '../../logo.svg';
import { fetchSettings } from '../data/actions';
import { coachingConsentPageSelector } from '../data/selectors';
-function Logo({ src, alt, ...attributes }) {
- return

;
-}
+const Logo = ({ src, alt, ...attributes }) =>

;
-function SuccessMessage(props) {
- return (
-
-
-
{props.header}
-
{props.message}
-
- {props.continue}
-
-
- );
-}
+const SuccessMessage = (props) => (
+
+
+
{props.header}
+
{props.message}
+
+ {props.continue}
+
+
+);
-function AutoRedirect(props) {
+const AutoRedirect = (props) => {
window.location.href = props.redirectUrl;
// eslint-disable-next-line react/jsx-no-useless-fragment
return <>>;
-}
+};
const VIEWS = {
NOT_LOADED: 'NOT_LOADED',
diff --git a/src/account-settings/coaching/CoachingConsentForm.jsx b/src/account-settings/coaching/CoachingConsentForm.jsx
index 351f459..28232ff 100644
--- a/src/account-settings/coaching/CoachingConsentForm.jsx
+++ b/src/account-settings/coaching/CoachingConsentForm.jsx
@@ -8,86 +8,80 @@ import PropTypes from 'prop-types';
import Alert from '../Alert';
import messages from './CoachingConsent.messages';
-function ErrorMessage(props) {
- return
{props.message}
;
-}
+const ErrorMessage = (props) =>
{props.message}
;
-function ManagedProfileAlert({ profileDataManager }) {
- return (
-
- {profileDataManager},
- }}
- />
-
- );
-}
-function CoachingForm(props) {
- return (
-
-
- {props.intl.formatMessage(messages['account.settings.coaching.consent.welcome.header'])}
-
-
{props.intl.formatMessage(messages['account.settings.coaching.consent.description'])}
-
+const ManagedProfileAlert = ({ profileDataManager }) => (
+
+ {profileDataManager},
+ }}
+ />
+
+);
+const CoachingForm = (props) => (
+
+
+ {props.intl.formatMessage(messages['account.settings.coaching.consent.welcome.header'])}
+
+
{props.intl.formatMessage(messages['account.settings.coaching.consent.description'])}
+
- );
-}
+
+);
CoachingForm.defaultProps = {
formErrors: {
diff --git a/src/account-settings/coaching/CoachingToggle.jsx b/src/account-settings/coaching/CoachingToggle.jsx
index 4ab00b8..a6a8827 100644
--- a/src/account-settings/coaching/CoachingToggle.jsx
+++ b/src/account-settings/coaching/CoachingToggle.jsx
@@ -8,69 +8,67 @@ import { editableFieldSelector } from '../data/selectors';
import { saveSettings, updateDraft, saveMultipleSettings } from '../data/actions';
import EditableField from '../EditableField';
-function CoachingToggle(props) {
- return (
- <>
-
{
- const { coaching } = props;
- if (coaching.coaching_consent === true) {
- return props.saveMultipleSettings([
- {
- formId: 'coaching',
- commitValues: {
- ...coaching,
- phone_number: props.phone_number,
- },
+const CoachingToggle = (props) => (
+ <>
+ {
+ const { coaching } = props;
+ if (coaching.coaching_consent === true) {
+ return props.saveMultipleSettings([
+ {
+ formId: 'coaching',
+ commitValues: {
+ ...coaching,
+ phone_number: props.phone_number,
},
- {
- formId: 'phone_number',
- commitValues: props.phone_number,
- },
- ], 'phone_number');
- }
- return props.saveSettings('phone_number', props.phone_number);
+ },
+ {
+ formId: 'phone_number',
+ commitValues: props.phone_number,
+ },
+ ], 'phone_number');
+ }
+ return props.saveSettings('phone_number', props.phone_number);
+ }}
+ />
+
+ {
+ const { name } = e.target;
+ // eslint-disable-next-line camelcase
+ const { user, eligible_for_coaching } = props.coaching;
+ const value = {
+ user,
+ // eslint-disable-next-line camelcase
+ eligible_for_coaching,
+ coaching_consent: e.target.checked,
+ };
+ props.saveSettings(name, value);
}}
/>
-
- {
- const { name } = e.target;
- // eslint-disable-next-line camelcase
- const { user, eligible_for_coaching } = props.coaching;
- const value = {
- user,
- // eslint-disable-next-line camelcase
- eligible_for_coaching,
- coaching_consent: e.target.checked,
- };
- props.saveSettings(name, value);
- }}
- />
-
-
- >
- );
-}
+
+
+ >
+);
CoachingToggle.defaultProps = {
phone_number: '',
diff --git a/src/account-settings/delete-account/BeforeProceedingBanner.jsx b/src/account-settings/delete-account/BeforeProceedingBanner.jsx
index ceefafc..6f05132 100644
--- a/src/account-settings/delete-account/BeforeProceedingBanner.jsx
+++ b/src/account-settings/delete-account/BeforeProceedingBanner.jsx
@@ -12,7 +12,7 @@ import messages from './messages';
// Components
import Alert from '../Alert';
-function BeforeProceedingBanner(props) {
+const BeforeProceedingBanner = (props) => {
const { instructionMessageId, intl, supportArticleUrl } = props;
return (
@@ -35,7 +35,7 @@ function BeforeProceedingBanner(props) {
/>
);
-}
+};
BeforeProceedingBanner.propTypes = {
instructionMessageId: PropTypes.string.isRequired,
diff --git a/src/account-settings/delete-account/PrintingInstructions.jsx b/src/account-settings/delete-account/PrintingInstructions.jsx
index 77df69c..36b932a 100644
--- a/src/account-settings/delete-account/PrintingInstructions.jsx
+++ b/src/account-settings/delete-account/PrintingInstructions.jsx
@@ -5,7 +5,7 @@ import { Hyperlink } from '@edx/paragon';
import { getConfig } from '@edx/frontend-platform';
import messages from './messages';
-function PrintingInstructions(props) {
+const PrintingInstructions = (props) => {
const actionLink = (
);
-}
+};
PrintingInstructions.propTypes = {
intl: intlShape.isRequired,
diff --git a/src/account-settings/delete-account/SuccessModal.jsx b/src/account-settings/delete-account/SuccessModal.jsx
index b3c88ca..aadcfdc 100644
--- a/src/account-settings/delete-account/SuccessModal.jsx
+++ b/src/account-settings/delete-account/SuccessModal.jsx
@@ -5,7 +5,7 @@ import { Modal } from '@edx/paragon';
import messages from './messages';
-export function SuccessModal(props) {
+export const SuccessModal = (props) => {
const { status, intl, onClose } = props;
return (
);
-}
+};
SuccessModal.propTypes = {
status: PropTypes.oneOf(['confirming', 'pending', 'deleted', 'failed']),
diff --git a/src/account-settings/demographics/Checkboxes.jsx b/src/account-settings/demographics/Checkboxes.jsx
index a5db8b4..c8cf396 100644
--- a/src/account-settings/demographics/Checkboxes.jsx
+++ b/src/account-settings/demographics/Checkboxes.jsx
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { CheckBox } from '@edx/paragon';
import { DECLINED } from '../data/constants';
-function Checkboxes(props) {
+const Checkboxes = (props) => {
const {
id,
options,
@@ -59,7 +59,7 @@ function Checkboxes(props) {
{renderCheckboxes()}
);
-}
+};
Checkboxes.propTypes = {
id: PropTypes.string.isRequired,
diff --git a/src/account-settings/name-change/NameChange.jsx b/src/account-settings/name-change/NameChange.jsx
index f8be734..08e4adc 100644
--- a/src/account-settings/name-change/NameChange.jsx
+++ b/src/account-settings/name-change/NameChange.jsx
@@ -21,13 +21,13 @@ import { nameChangeSelector } from '../data/selectors';
import { requestNameChange, requestNameChangeFailure, requestNameChangeReset } from './data/actions';
import messages from './messages';
-function NameChangeModal({
+const NameChangeModal = ({
targetFormId,
errors,
formValues,
intl,
saveState,
-}) {
+}) => {
const dispatch = useDispatch();
const { push } = useHistory();
const { username } = getAuthenticatedUser();
@@ -183,7 +183,7 @@ function NameChangeModal({
);
-}
+};
NameChangeModal.propTypes = {
targetFormId: PropTypes.string.isRequired,
diff --git a/src/account-settings/reset-password/ConfirmationAlert.jsx b/src/account-settings/reset-password/ConfirmationAlert.jsx
index c1f6b1a..b40d3ce 100644
--- a/src/account-settings/reset-password/ConfirmationAlert.jsx
+++ b/src/account-settings/reset-password/ConfirmationAlert.jsx
@@ -7,7 +7,7 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import Alert from '../Alert';
-function ConfirmationAlert(props) {
+const ConfirmationAlert = (props) => {
const { email } = props;
const technicalSupportLink = (
@@ -38,7 +38,7 @@ function ConfirmationAlert(props) {
/>
);
-}
+};
ConfirmationAlert.propTypes = {
email: PropTypes.string.isRequired,
diff --git a/src/account-settings/reset-password/RequestInProgressAlert.jsx b/src/account-settings/reset-password/RequestInProgressAlert.jsx
index 5a8867e..e59a9ac 100644
--- a/src/account-settings/reset-password/RequestInProgressAlert.jsx
+++ b/src/account-settings/reset-password/RequestInProgressAlert.jsx
@@ -5,19 +5,17 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import Alert from '../Alert';
-function RequestInProgressAlert() {
- return (
-
}
- >
-
-
- );
-}
+const RequestInProgressAlert = () => (
+
}
+ >
+
+
+);
export default RequestInProgressAlert;
diff --git a/src/account-settings/reset-password/ResetPassword.jsx b/src/account-settings/reset-password/ResetPassword.jsx
index 68f1d91..44a4d71 100644
--- a/src/account-settings/reset-password/ResetPassword.jsx
+++ b/src/account-settings/reset-password/ResetPassword.jsx
@@ -9,7 +9,7 @@ import messages from './messages';
import ConfirmationAlert from './ConfirmationAlert';
import RequestInProgressAlert from './RequestInProgressAlert';
-function ResetPassword(props) {
+const ResetPassword = (props) => {
const { email, intl, status } = props;
return (
@@ -47,7 +47,7 @@ function ResetPassword(props) {
{status === 'forbidden' ? : null}
);
-}
+};
ResetPassword.propTypes = {
email: PropTypes.string,
diff --git a/src/head/Head.jsx b/src/head/Head.jsx
index 5a92a66..fe0e983 100644
--- a/src/head/Head.jsx
+++ b/src/head/Head.jsx
@@ -5,16 +5,14 @@ import { getConfig } from '@edx/frontend-platform';
import messages from './messages';
-function Head({ intl }) {
- return (
-
-
- {intl.formatMessage(messages['account.page.title'], { siteName: getConfig().SITE_NAME })}
-
-
-
- );
-}
+const Head = ({ intl }) => (
+
+
+ {intl.formatMessage(messages['account.page.title'], { siteName: getConfig().SITE_NAME })}
+
+
+
+);
Head.propTypes = {
intl: intlShape.isRequired,
diff --git a/src/id-verification/AccessBlocked.jsx b/src/id-verification/AccessBlocked.jsx
index 8e5f2fd..7968124 100644
--- a/src/id-verification/AccessBlocked.jsx
+++ b/src/id-verification/AccessBlocked.jsx
@@ -6,7 +6,7 @@ import { injectIntl, intlShape, FormattedMessage } from '@edx/frontend-platform/
import messages from './IdVerification.messages';
import { ERROR_REASONS } from './IdVerificationContext';
-function AccessBlocked({ error, intl }) {
+const AccessBlocked = ({ error, intl }) => {
const handleMessage = () => {
if (error === ERROR_REASONS.COURSE_ENROLLMENT) {
return
{intl.formatMessage(messages['id.verification.access.blocked.enrollment'])}
;
@@ -39,7 +39,7 @@ function AccessBlocked({ error, intl }) {
);
-}
+};
AccessBlocked.propTypes = {
intl: intlShape.isRequired,
diff --git a/src/id-verification/CameraHelp.jsx b/src/id-verification/CameraHelp.jsx
index 0250494..f34c252 100644
--- a/src/id-verification/CameraHelp.jsx
+++ b/src/id-verification/CameraHelp.jsx
@@ -6,35 +6,33 @@ import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { getConfig } from '@edx/frontend-platform';
import messages from './IdVerification.messages';
-function CameraHelp(props) {
- return (
-