11import PropTypes from 'prop-types' ;
2- import React , { useState , Suspense } from 'react' ;
2+ import React , { useState } from 'react' ;
33import styled from 'styled-components' ;
44import { Close , EditOutlined , ExpandMoreRounded } from '@mui/icons-material' ;
55import { Button , IconButton } from '@mui/material' ;
@@ -9,15 +9,8 @@ import DesignTokenColors from '../../Style/DesignTokenColors';
99import VerifyOtherWaysModal from './VerifyOtherWaysModal' ;
1010import VerifyWithEmailModal from './VerifyWithEmailModal' ;
1111import AppObservableStore from '../../../stores/AppObservableStore' ;
12- import webAppConfig from '../../../../config' ;
1312import useVoterCanEditPolitician from '../../../../hooks/useVoterCanEditPolitician' ;
1413
15- const nextReleaseFeaturesEnabled = webAppConfig . ENABLE_NEXT_RELEASE_FEATURES === undefined ? false : webAppConfig . ENABLE_NEXT_RELEASE_FEATURES ;
16-
17-
18- const OpenExternalWebSite = React . lazy ( ( ) => import ( /* webpackChunkName: 'OpenExternalWebSite' */ '../../Widgets/OpenExternalWebSite' ) ) ;
19-
20- const updateCandidateInformationLink = 'https://docs.google.com/forms/d/e/1FAIpQLSePdeW32PClaSO1pUWBJnQ75wFGPOtviNaqOABBYps7NIH3hA/viewform?usp=sf_link' ;
2114const CustomTooltip = muiStyled ( ( { className, ...props } ) => (
2215 < Tooltip { ...props } classes = { { popper : className } } />
2316) ) ( ( ) => ( {
@@ -52,78 +45,50 @@ const UpdatePoliticianInformation = ({ politicianName, politicianWeVoteId }) =>
5245 < UpdateInformationWrapper >
5346 { ! ! ( politicianName ) && (
5447 < >
55- { nextReleaseFeaturesEnabled ? (
56- < >
57- { voterCanEditPoliticianProfile ? (
58- < CustomTooltip
59- interactive
60- arrow
61- placement = "right"
62- open = { tooltipOpen }
63- onOpen = { ( ) => setTooltipOpen ( true ) }
64- onClose = { ( ) => setTooltipOpen ( false ) }
65- title = { (
66- < TooltipContent >
67- < CloseButton size = "small" onClick = { ( ) => setTooltipOpen ( false ) } >
68- < Close fontSize = "small" />
69- </ CloseButton >
70- Edit your candidate’s profile here
71- < GotItButton onClick = { ( ) => setTooltipOpen ( false ) } >
72- GOT IT
73- </ GotItButton >
74- </ TooltipContent >
75- ) }
76- >
77- < EditProfileWrapper
78- onMouseEnter = { ( ) => setTooltipOpen ( true ) }
79- onClick = { handleEditProfile }
80- >
81- < EditOutlined fontSize = "small" style = { { marginRight : 4 } } />
82- Edit profile
83- </ EditProfileWrapper >
84- </ CustomTooltip >
85- ) : (
86- < CandidateStaffAccessButton
87- onClick = { handleOpenVerifyWithEmailModal }
88- >
89- Candidate staff access
90- < ExpandMoreRounded />
91- </ CandidateStaffAccessButton >
48+ { voterCanEditPoliticianProfile ? (
49+ < CustomTooltip
50+ interactive
51+ arrow
52+ placement = "right"
53+ open = { tooltipOpen }
54+ onOpen = { ( ) => setTooltipOpen ( true ) }
55+ onClose = { ( ) => setTooltipOpen ( false ) }
56+ title = { (
57+ < TooltipContent >
58+ < CloseButton size = "small" onClick = { ( ) => setTooltipOpen ( false ) } >
59+ < Close fontSize = "small" />
60+ </ CloseButton >
61+ Edit your candidate’s profile here
62+ < GotItButton onClick = { ( ) => setTooltipOpen ( false ) } >
63+ GOT IT
64+ </ GotItButton >
65+ </ TooltipContent >
9266 ) }
93- < VerifyOtherWaysModal
94- politicianName = { politicianName }
95- politicianWeVoteId = { politicianWeVoteId }
96- />
97- < VerifyWithEmailModal
98- politicianName = { politicianName }
99- politicianWeVoteId = { politicianWeVoteId }
100- / >
101- </ >
67+ >
68+ < EditProfileWrapper
69+ onMouseEnter = { ( ) => setTooltipOpen ( true ) }
70+ onClick = { handleEditProfile }
71+ >
72+ < EditOutlined fontSize = "small" style = { { marginRight : 4 } } />
73+ Edit profile
74+ </ EditProfileWrapper >
75+ </ CustomTooltip >
10276 ) : (
103- < Suspense fallback = { < > </ > } >
104- < FlexLayoutDiv >
105- < CandidateStaffText >
106- For candidate staff:
107- </ CandidateStaffText >
108- < AddInfoLink >
109- < OpenExternalWebSite
110- linkIdAttribute = "updateCandidateInformation"
111- url = { updateCandidateInformationLink }
112- target = "_blank"
113- className = "u-link-color"
114- body = { (
115- < div >
116- Add info
117- </ div >
118- ) }
119- destinationPageName = "PoliticianEditForm"
120- destinationPageType = "politician"
121- trackingOn
122- />
123- </ AddInfoLink >
124- </ FlexLayoutDiv >
125- </ Suspense >
77+ < CandidateStaffAccessButton
78+ onClick = { handleOpenVerifyWithEmailModal }
79+ >
80+ Candidate staff access
81+ < ExpandMoreRounded />
82+ </ CandidateStaffAccessButton >
12683 ) }
84+ < VerifyOtherWaysModal
85+ politicianName = { politicianName }
86+ politicianWeVoteId = { politicianWeVoteId }
87+ />
88+ < VerifyWithEmailModal
89+ politicianName = { politicianName }
90+ politicianWeVoteId = { politicianWeVoteId }
91+ />
12792 </ >
12893 ) }
12994 </ UpdateInformationWrapper >
@@ -135,10 +100,6 @@ UpdatePoliticianInformation.propTypes = {
135100 politicianWeVoteId : PropTypes . string ,
136101} ;
137102
138- const AddInfoLink = styled ( 'div' ) `
139- font-size: 12px;
140- ` ;
141-
142103const CandidateStaffAccessButton = styled ( 'button' ) `
143104 background: transparent;
144105 border: none;
@@ -147,22 +108,12 @@ const CandidateStaffAccessButton = styled('button')`
147108 margin-top: -3px;
148109` ;
149110
150- const CandidateStaffText = styled ( 'div' ) `
151- color:${ DesignTokenColors . neutralUI100 } ;
152- font-size: 10px;
153- ` ;
154-
155111const EditProfileWrapper = styled ( 'div' ) `
156112 color: ${ DesignTokenColors . primary500 } ;
157113 cursor: pointer;
158114 font-size: 12px;
159115` ;
160116
161- const FlexLayoutDiv = styled ( 'div' ) `
162- display: flex;
163- align-items: flex-end;
164- ` ;
165-
166117const UpdateInformationWrapper = styled ( 'div' ) `
167118 align-items: flex-start;
168119 display: flex;
0 commit comments