11import React , { useState } from "react"
2+ import Helmet from "react-helmet"
23import * as Sentry from "@sentry/react"
34import { useMutation } from "@apollo/client"
45import { EditableContent } from "./components/editable-content"
@@ -8,6 +9,7 @@ import { GitHubAuthButton } from "./github-auth-button"
89import type { UserAccountViewProps } from "../types/user-types"
910import { OrcidConsentForm } from "./components/orcid-consent-form"
1011import { validateHttpHttpsUrl } from "../utils/validationUtils"
12+ import { pageTitle } from "../resources/strings.js"
1113
1214export const UserAccountView : React . FC < UserAccountViewProps > = ( {
1315 orcidUser,
@@ -84,66 +86,73 @@ export const UserAccountView: React.FC<UserAccountViewProps> = ({
8486 }
8587
8688 return (
87- < div data-testid = "user-account-view" className = { styles . useraccountview } >
88- < h3 > Account</ h3 >
89- < ul className = { styles . accountDetail } >
90- < li >
91- < span > Name:</ span >
92- { orcidUser . name }
93- </ li >
94- < li >
95- < span > Email:</ span >
96- { orcidUser . email }
97- </ li >
98- < li >
99- < span > ORCID:</ span >
100- { orcidUser . orcid }
101- </ li >
102- { orcidUser ?. github &&
103- (
104- < li >
105- < span > GitHub:</ span >
106- { orcidUser . github }
107- </ li >
108- ) }
109- < li >
110- < GitHubAuthButton sync = { orcidUser . githubSynced } />
111- </ li >
112- </ ul >
89+ < >
90+ < Helmet >
91+ < title >
92+ { orcidUser . name || "User" } profile - { pageTitle }
93+ </ title >
94+ </ Helmet >
95+ < div data-testid = "user-account-view" className = { styles . useraccountview } >
96+ < h3 > Account</ h3 >
97+ < ul className = { styles . accountDetail } >
98+ < li >
99+ < span > Name:</ span >
100+ { orcidUser . name }
101+ </ li >
102+ < li >
103+ < span > Email:</ span >
104+ { orcidUser . email }
105+ </ li >
106+ < li >
107+ < span > ORCID:</ span >
108+ { orcidUser . orcid }
109+ </ li >
110+ { orcidUser ?. github &&
111+ (
112+ < li >
113+ < span > GitHub:</ span >
114+ { orcidUser . github }
115+ </ li >
116+ ) }
117+ < li >
118+ < GitHubAuthButton sync = { orcidUser . githubSynced } />
119+ </ li >
120+ </ ul >
113121
114- < EditableContent
115- editableContent = { userLinks }
116- setRows = { handleLinksChange }
117- heading = "Links"
118- validation = { validateHttpHttpsUrl }
119- validationMessage = "Invalid URL format. Please start with http:// or https://"
120- data-testid = "links-section"
121- />
122+ < EditableContent
123+ editableContent = { userLinks }
124+ setRows = { handleLinksChange }
125+ heading = "Links"
126+ validation = { validateHttpHttpsUrl }
127+ validationMessage = "Invalid URL format. Please start with http:// or https://"
128+ data-testid = "links-section"
129+ />
122130
123- { orcidUser ?. id && orcidUser ?. orcid !== undefined && (
124- < div className = { styles . umbOrcidConsent } >
125- < div className = { styles . umbOrcidHeading } >
126- < h4 > ORCID Integration</ h4 >
131+ { orcidUser ?. id && orcidUser ?. orcid !== undefined && (
132+ < div className = { styles . umbOrcidConsent } >
133+ < div className = { styles . umbOrcidHeading } >
134+ < h4 > ORCID Integration</ h4 >
135+ </ div >
136+ < OrcidConsentForm
137+ userId = { orcidUser . id }
138+ initialOrcidConsent = { orcidUser . orcidConsent }
139+ />
127140 </ div >
128- < OrcidConsentForm
129- userId = { orcidUser . id }
130- initialOrcidConsent = { orcidUser . orcidConsent }
131- />
132- </ div >
133- ) }
141+ ) }
134142
135- < EditableContent
136- editableContent = { userLocation }
137- setRows = { handleLocationChange }
138- heading = "Location"
139- data-testid = "location-section"
140- />
141- < EditableContent
142- editableContent = { userInstitution }
143- setRows = { handleInstitutionChange }
144- heading = "Institution"
145- data-testid = "institution-section"
146- />
147- </ div >
143+ < EditableContent
144+ editableContent = { userLocation }
145+ setRows = { handleLocationChange }
146+ heading = "Location"
147+ data-testid = "location-section"
148+ />
149+ < EditableContent
150+ editableContent = { userInstitution }
151+ setRows = { handleInstitutionChange }
152+ heading = "Institution"
153+ data-testid = "institution-section"
154+ />
155+ </ div >
156+ </ >
148157 )
149158}
0 commit comments