diff --git a/src/profile-v2/Certificates.jsx b/src/profile-v2/Certificates.jsx index 3a6cab3b4..cd8a227ee 100644 --- a/src/profile-v2/Certificates.jsx +++ b/src/profile-v2/Certificates.jsx @@ -32,7 +32,7 @@ const Certificates = ({ certificates }) => (

- {certificates && certificates.length > 0 ? ( + {certificates?.length > 0 ? (
{certificates.map(certificate => ( diff --git a/src/profile-v2/NotFoundPage.jsx b/src/profile-v2/NotFoundPage.jsx index 0963b153c..b33f0db11 100644 --- a/src/profile-v2/NotFoundPage.jsx +++ b/src/profile-v2/NotFoundPage.jsx @@ -3,7 +3,7 @@ import { FormattedMessage } from '@edx/frontend-platform/i18n'; const NotFoundPage = () => (
-

+

(

-
+
{srMessage && {srMessage}}
diff --git a/src/profile-v2/ProfilePage.jsx b/src/profile-v2/ProfilePage.jsx index cb2d1323b..22bcf7179 100644 --- a/src/profile-v2/ProfilePage.jsx +++ b/src/profile-v2/ProfilePage.jsx @@ -80,7 +80,12 @@ const ProfilePage = ({ params }) => { } return ( - + {intl.formatMessage(messages['profile.viewMyRecords'])} ); @@ -98,64 +103,58 @@ const ProfilePage = ({ params }) => { ) ); - const renderContent = () => { - if (isLoadingProfile) { - return ; - } - - return ( - <> -
-
-
-
- -
-

{params.username}

- {isBlockVisible(name) && ( -

{name}

- )} -
- - + return ( +
+ {isLoadingProfile ? ( + + ) : ( + <> +
+
+
+
+ +
+

{params.username}

+ {isBlockVisible(name) && ( +

{name}

+ )} +
+ + +
+
+
+ {renderViewMyRecordsButton()}
-
- {renderViewMyRecordsButton()} +
+ {isYOBDisabled() && }
-
- {isYOBDisabled() && } +
+ {renderPhotoUploadErrorMessage()}
-
- {renderPhotoUploadErrorMessage()} -
-
-
- {isBlockVisible(courseCertificates.length) && ( - - )} -
- - ); - }; - - return ( -
- {renderContent()} +
+ {isBlockVisible(courseCertificates.length) && ( + + )} +
+ + )}
); }; diff --git a/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap b/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap index 29a9d33d9..d0434b33a 100644 --- a/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap +++ b/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap @@ -7,8 +7,7 @@ exports[` Renders correctly in various states app loading 1`] = ` >
Renders correctly in various states viewing own profile
profile avatar
Renders correctly in various states without credentials
profile avatar
(
@@ -107,8 +107,7 @@ const ProfileAvatar = ({ ) : ( {intl.formatMessage(messages['profile.image.alt.attribute'])} diff --git a/src/profile-v2/index.scss b/src/profile-v2/index.scss index 9f634eb03..32762c523 100644 --- a/src/profile-v2/index.scss +++ b/src/profile-v2/index.scss @@ -144,7 +144,11 @@ // Todo: Move the following to edx-paragon .btn-rounded { - border-radius: 100px; + border-radius: 100px; +} + +.max-width-32em { + max-width: 32em; } .width-75rem { @@ -162,12 +166,17 @@ .height-2625rem { height: 2.625rem; } -.rounded-75{ - border-radius: 0.75rem; + +.height-50vh { + height: 50vh; } -.pt-4rem{ - padding-top: 4rem; +.rounded-75 { + border-radius: 0.75rem; +} + +.pt-4rem { + padding-top: 4rem; } .py-4rem { @@ -186,26 +195,34 @@ } .px-25rem { -padding-left: 2.5rem; -padding-right: 2.5rem; + padding-left: 2.5rem; + padding-right: 2.5rem; +} + +.g-15rem { + gap: 1.5rem; +} + +.g-5rem { + gap: 0.5rem; } -.g-15rem{ - gap: 1.5rem; +.g-1rem { + gap: 1rem; } -.g-5rem{ - gap: 0.5rem; +.g-3rem { + gap: 3rem; } -.g-1rem{ - gap: 1rem; +.color-black { + color: #000; } -.g-3rem{ - gap: 3rem; +.background-black-65 { + background-color: rgba(0,0,0,.65) } -.color-black{ - color: #000; +.object-fit-cover { + object-fit: cover; }