@@ -80,7 +80,12 @@ const ProfilePage = ({ params }) => {
8080 }
8181
8282 return (
83- < Hyperlink className = "btn btn-brand btn-rounded font-weight-normal px-4 py-0625rem text-nowrap" target = "_blank" showLaunchIcon = { false } destination = { viewMyRecordsUrl } >
83+ < Hyperlink
84+ className = "btn btn-brand btn-rounded font-weight-normal px-4 py-0625rem text-nowrap"
85+ target = "_blank"
86+ showLaunchIcon = { false }
87+ destination = { viewMyRecordsUrl }
88+ >
8489 { intl . formatMessage ( messages [ 'profile.viewMyRecords' ] ) }
8590 </ Hyperlink >
8691 ) ;
@@ -98,64 +103,58 @@ const ProfilePage = ({ params }) => {
98103 )
99104 ) ;
100105
101- const renderContent = ( ) => {
102- if ( isLoadingProfile ) {
103- return < PageLoading srMessage = { intl . formatMessage ( messages [ 'profile.loading' ] ) } /> ;
104- }
105-
106- return (
107- < >
108- < div className = "profile-page-bg-banner bg-primary d-md-block align-items-center px-75rem py-4rem h-100 w-100" >
109- < div className = "col container-fluid w-100 h-100 bg-white py-0 px-25rem rounded-75" >
110- < div className = "col h-100 w-100 py-4 px-0 justify-content-start g-15rem" >
111- < div className = "row-auto d-flex flex-wrap align-items-center h-100 w-100 justify-content-start g-15rem" >
112- < ProfileAvatar
113- className = "col p-0"
114- src = { profileImage . src }
115- isDefault = { profileImage . isDefault }
116- onSave = { handleSaveProfilePhoto }
117- onDelete = { handleDeleteProfilePhoto }
118- savePhotoState = { savePhotoState }
119- isEditable = { isAuthenticatedUserProfile ( ) && ! requiresParentalConsent }
120- />
121- < div className = "col justify-content-start align-items-start h-100 w-100 m-0 p-0" >
122- < h1 className = "row h3 m-0 font-weight-bold text-truncate text-primary-500" > { params . username } </ h1 >
123- { isBlockVisible ( name ) && (
124- < p className = "row pt-2 text-gray-800 font-weight-normal m-0" > { name } </ p >
125- ) }
126- < div className = "row pt-2 m-0 g-1rem" >
127- < DateJoined date = { dateJoined } />
128- < UserCertificateSummary count = { courseCertificates . length } />
106+ return (
107+ < div className = "profile-page" >
108+ { isLoadingProfile ? (
109+ < PageLoading srMessage = { intl . formatMessage ( messages [ 'profile.loading' ] ) } />
110+ ) : (
111+ < >
112+ < div className = "profile-page-bg-banner bg-primary d-md-block align-items-center px-75rem py-4rem h-100 w-100" >
113+ < div className = "col container-fluid w-100 h-100 bg-white py-0 px-25rem rounded-75" >
114+ < div className = "col h-100 w-100 py-4 px-0 justify-content-start g-15rem" >
115+ < div className = "row-auto d-flex flex-wrap align-items-center h-100 w-100 justify-content-start g-15rem" >
116+ < ProfileAvatar
117+ className = "col p-0"
118+ src = { profileImage . src }
119+ isDefault = { profileImage . isDefault }
120+ onSave = { handleSaveProfilePhoto }
121+ onDelete = { handleDeleteProfilePhoto }
122+ savePhotoState = { savePhotoState }
123+ isEditable = { isAuthenticatedUserProfile ( ) && ! requiresParentalConsent }
124+ />
125+ < div className = "col justify-content-start align-items-start h-100 w-100 m-0 p-0" >
126+ < h1 className = "row h3 m-0 font-weight-bold text-truncate text-primary-500" > { params . username } </ h1 >
127+ { isBlockVisible ( name ) && (
128+ < p className = "row pt-2 text-gray-800 font-weight-normal m-0" > { name } </ p >
129+ ) }
130+ < div className = "row pt-2 m-0 g-1rem" >
131+ < DateJoined date = { dateJoined } />
132+ < UserCertificateSummary count = { courseCertificates . length } />
133+ </ div >
134+ </ div >
135+ < div className = "col-auto p-0" >
136+ { renderViewMyRecordsButton ( ) }
129137 </ div >
130138 </ div >
131- < div className = "col -auto p-0 " >
132- { renderViewMyRecordsButton ( ) }
139+ < div className = "row -auto d-flex align-items-center h-100 w-100 justify-content-start m-0 pt-4 " >
140+ { isYOBDisabled ( ) && < UsernameDescription /> }
133141 </ div >
134142 </ div >
135- < div className = "row -auto d-flex align-items-center h-100 w-100 justify-content-start m-0 pt-4 " >
136- { isYOBDisabled ( ) && < UsernameDescription /> }
143+ < div className = "ml -auto" >
144+ { renderPhotoUploadErrorMessage ( ) }
137145 </ div >
138146 </ div >
139- < div className = "ml-auto" >
140- { renderPhotoUploadErrorMessage ( ) }
141- </ div >
142147 </ div >
143- </ div >
144- < div className = "col container-fluid d-inline-flex px-75rem pt-4rem pb-6 h-100 w-100 align-items-start justify-content-center g-3rem" >
145- { isBlockVisible ( courseCertificates . length ) && (
146- < Certificates
147- certificates = { courseCertificates }
148- formId = "certificates"
149- />
150- ) }
151- </ div >
152- </ >
153- ) ;
154- } ;
155-
156- return (
157- < div className = "profile-page" >
158- { renderContent ( ) }
148+ < div className = "col container-fluid d-inline-flex px-75rem pt-4rem pb-6 h-100 w-100 align-items-start justify-content-center g-3rem" >
149+ { isBlockVisible ( courseCertificates . length ) && (
150+ < Certificates
151+ certificates = { courseCertificates }
152+ formId = "certificates"
153+ />
154+ ) }
155+ </ div >
156+ </ >
157+ ) }
159158 </ div >
160159 ) ;
161160} ;
0 commit comments