Skip to content

Commit 28ee748

Browse files
authored
Revisions to changes in prop spreading issue
1 parent cec966e commit 28ee748

File tree

9 files changed

+28
-80
lines changed

9 files changed

+28
-80
lines changed

src/js/components/Settings/SettingsAddress.jsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import PropTypes from 'prop-types';
21
import React, { Component } from 'react';
32
import Helmet from 'react-helmet';
43
import AnalyticsActions from '../../actions/AnalyticsActions';
@@ -37,14 +36,7 @@ export default class SettingsAddress extends Component {
3736
</h3>
3837
<div className={isWebApp() ? 'u-padding-bottom--md' : 'SettingsCardBottomCordova'}>
3938
<AddressBox
40-
classes={this.props.classes}
41-
externalUniqueId={this.props.externalUniqueId}
42-
returnNewTextForMapSearch={this.props.returnNewTextForMapSearch}
4339
saveUrl="/ballot"
44-
showCancelEditAddressButton={this.props.showCancelEditAddressButton}
45-
toggleEditingAddress={this.props.toggleEditingAddress}
46-
toggleSelectAddressModal={this.props.toggleSelectAddressModal}
47-
waitingMessage={this.props.waitingMessage}
4840
/>
4941
</div>
5042
</div>
@@ -54,13 +46,3 @@ export default class SettingsAddress extends Component {
5446
);
5547
}
5648
}
57-
SettingsAddress.propTypes = {
58-
classes: PropTypes.object,
59-
externalUniqueId: PropTypes.string,
60-
returnNewTextForMapSearch: PropTypes.func,
61-
saveUrl: PropTypes.string.isRequired,
62-
showCancelEditAddressButton: PropTypes.bool,
63-
toggleEditingAddress: PropTypes.func,
64-
toggleSelectAddressModal: PropTypes.func,
65-
waitingMessage: PropTypes.string,
66-
};

src/js/components/Twitter/TwitterAccountCard.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ export default class TwitterAccountCard extends Component {
1414
render () {
1515
renderLog('TwitterAccountCard'); // Set LOG_RENDER_EVENTS to log all renders
1616
const {
17-
twitterHandle, twitterDescription, twitterFollowersCount,
18-
twitterPhotoUrl, twitterUserWebsite,
17+
twitterDescription,
18+
twitterHandle,
19+
twitterFollowersCount,
20+
twitterPhotoUrl,
1921
twitterName,
22+
twitterUserWebsite,
2023
} = this.props;
2124

2225
// If the nameDisplay is in the twitterDescription, remove it from twitterDescription

src/js/components/Widgets/EditAddressInPlace.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,12 @@ class EditAddressInPlace extends Component {
8484
Please enter your full street address with house number for your correct ballot.
8585
</div>
8686
<AddressBox
87-
classes={this.props.classes}
8887
editingAddress
89-
externalUniqueId={this.props.externalUniqueId}
9088
returnNewTextForMapSearch={this.localTextForMapSearchUpdate}
9189
saveUrl={ballotBaseUrl}
9290
showCancelEditAddressButton
9391
toggleEditingAddress={this.toggleEditingAddress}
9492
toggleSelectAddressModal={this.incomingToggleFunction}
95-
waitingMessage={this.props.waitingMessage}
9693
/>
9794
</span>
9895
);
@@ -134,12 +131,9 @@ EditAddressInPlace.propTypes = {
134131
ballotBaseUrl: PropTypes.string,
135132
classes: PropTypes.object,
136133
defaultIsEditingAddress: PropTypes.bool,
137-
externalUniqueId: PropTypes.string,
138134
noAddressMessage: PropTypes.string,
139-
returnNewTextForMapSearch: PropTypes.func,
140135
toggleEditingAddress: PropTypes.func,
141136
toggleFunction: PropTypes.func,
142-
waitingMessage: PropTypes.string,
143137
};
144138

145139
const styles = {

src/js/pages/Ballot/Ballot.jsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,14 +1234,8 @@ class Ballot extends Component {
12341234
</h3>
12351235
<div>
12361236
<AddressBox
1237-
classes={this.props.classes}
1238-
externalUniqueId={this.props.externalUniqueId}
1239-
returnNewTextForMapSearch={this.props.returnNewTextForMapSearch}
1237+
// classes={this.props.classes}
12401238
saveUrl={ballotBaseUrl}
1241-
showCancelEditAddressButton={this.props.showCancelEditAddressButton}
1242-
toggleEditingAddress={this.props.toggleEditingAddress}
1243-
toggleSelectAddressModal={this.props.toggleSelectAddressModal}
1244-
waitingMessage={this.props.waitingMessage}
12451239
/>
12461240
</div>
12471241
</div>
@@ -1587,14 +1581,6 @@ Ballot.propTypes = {
15871581
classes: PropTypes.object,
15881582
location: PropTypes.object,
15891583
match: PropTypes.object,
1590-
externalUniqueId: PropTypes.string,
1591-
returnNewTextForMapSearch: PropTypes.func,
1592-
saveUrl: PropTypes.string.isRequired,
1593-
showCancelEditAddressButton: PropTypes.bool,
1594-
toggleEditingAddress: PropTypes.func,
1595-
toggleSelectAddressModal: PropTypes.func,
1596-
waitingMessage: PropTypes.string,
1597-
15981584
};
15991585

16001586
/* eslint-disable no-nested-ternary */

src/js/pages/Intro/Intro.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export default class Intro extends Component {
7777
return (
7878
<div>
7979
<Helmet title="Welcome to We Vote" />
80-
{ this.props.children || (
8180
<div className="container-fluid well u-stack--md u-inset--md">
8281
<h2 className="text-center">We Vote</h2>
8382
<label // eslint-disable-line
@@ -89,8 +88,6 @@ export default class Intro extends Component {
8988
This is our best guess - feel free to change.
9089
</span>
9190
<AddressBox
92-
/* {...this.props} */
93-
classes={this.props.classes}
9491
externalUniqueId={this.props.externalUniqueId}
9592
returnNewTextForMapSearch={this.props.returnNewTextForMapSearch}
9693
saveUrl="/ballot"
@@ -134,14 +131,12 @@ export default class Intro extends Component {
134131
</li>
135132
</ul>
136133
</div>
137-
)}
134+
)
138135
</div>
139136
);
140137
}
141138
}
142139
Intro.propTypes = {
143-
children: PropTypes.object,
144-
classes: PropTypes.object,
145140
externalUniqueId: PropTypes.string,
146141
returnNewTextForMapSearch: PropTypes.func,
147142
showCancelEditAddressButton: PropTypes.bool,

src/js/pages/Settings/Location.jsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import PropTypes from 'prop-types';
21
import React, { Component } from 'react';
32
import Helmet from 'react-helmet';
43
import AnalyticsActions from '../../actions/AnalyticsActions';
@@ -86,17 +85,8 @@ export default class Location extends Component {
8685
Enter address where you are registered to vote
8786
</h3>
8887
<div>
89-
{/* ask about location */}
9088
<AddressBox
91-
classes={this.props.classes}
92-
externalUniqueId={this.props.externalUniqueId}
93-
location={this.props.location}
94-
returnNewTextForMapSearch={this.props.returnNewTextForMapSearch}
9589
saveUrl="/ballot"
96-
showCancelEditAddressButton={this.props.showCancelEditAddressButton}
97-
toggleEditingAddress={this.props.toggleEditingAddress}
98-
toggleSelectAddressModal={this.props.toggleSelectAddressModal}
99-
waitingMessage={this.props.waitingMessage}
10090
/>
10191
</div>
10292
</div>
@@ -107,14 +97,3 @@ export default class Location extends Component {
10797
);
10898
}
10999
}
110-
Location.propTypes = {
111-
classes: PropTypes.object,
112-
externalUniqueId: PropTypes.string,
113-
location: PropTypes.object,
114-
returnNewTextForMapSearch: PropTypes.func,
115-
saveUrl: PropTypes.string.isRequired,
116-
showCancelEditAddressButton: PropTypes.bool,
117-
toggleEditingAddress: PropTypes.func,
118-
toggleSelectAddressModal: PropTypes.func,
119-
waitingMessage: PropTypes.string,
120-
};

src/js/pages/TwitterHandleLanding.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ export default class TwitterHandleLanding extends Component {
109109
this.setState({
110110
kindOfOwner,
111111
ownerWeVoteId,
112+
status,
112113
twitterHandle,
113114
twitterDescription,
114115
twitterFollowersCount,
115116
twitterName,
116117
twitterPhotoUrl,
117118
twitterUserWebsite,
118-
status,
119119
});
120120
}
121121

@@ -138,7 +138,11 @@ export default class TwitterHandleLanding extends Component {
138138
}
139139

140140
const {
141-
activeRoute, voter, kindOfOwner, ownerWeVoteId, twitterHandle: twitterHandleBeingViewed,
141+
activeRoute,
142+
voter,
143+
kindOfOwner,
144+
ownerWeVoteId,
145+
twitterHandle: twitterHandleBeingViewed,
142146
} = this.state;
143147
let displayableTwitterHandleBeingViewed = twitterHandleBeingViewed;
144148
if (isCordova() && activeRoute && activeRoute.length > 2) {
@@ -174,11 +178,10 @@ export default class TwitterHandleLanding extends Component {
174178
// }
175179

176180
if (kindOfOwner === 'CANDIDATE') {
181+
// Is this supposed to be this.props.param.candidate_we_vote_id
177182
params.candidate_we_vote_id = ownerWeVoteId;
178183
return (
179184
<Candidate candidate_we_vote_id
180-
/* ...this.props */
181-
classes={this.props.classes}
182185
match={this.props.match}
183186
/>
184187
);
@@ -189,7 +192,6 @@ export default class TwitterHandleLanding extends Component {
189192
} else {
190193
return (
191194
<OrganizationVoterGuide
192-
// {...this.props}
193195
activeRoute={this.props.activeRoute}
194196
match={this.props.match}
195197
params={params}
@@ -200,7 +202,6 @@ export default class TwitterHandleLanding extends Component {
200202
// console.log('TwitterHandleLanding TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE calling UnknownTwitterAccount');
201203
return (
202204
<UnknownTwitterAccount
203-
// {...this.state}
204205
twiterHandle={this.state.twitterHandle}
205206
twitterName={this.state.twitterName}
206207
/>
@@ -258,7 +259,6 @@ export default class TwitterHandleLanding extends Component {
258259
}
259260
TwitterHandleLanding.propTypes = {
260261
activeRoute: PropTypes.string,
261-
classes: PropTypes.object,
262262
match: PropTypes.object,
263263
params: PropTypes.object,
264264
};

src/js/pages/VoterGuide/OrganizationVoterGuide.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ export default class OrganizationVoterGuide extends Component {
472472
OrganizationVoterGuide.propTypes = {
473473
activeRoute: PropTypes.string,
474474
match: PropTypes.object.isRequired,
475-
params: PropTypes.object,
476475
};
477476

478477
const WrapperFlex = styled('div')`

src/js/pages/VoterGuide/VerifyThisIsMe.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ class VerifyThisIsMe extends Component {
8787

8888
onTwitterStoreChange () {
8989
const {
90-
kind_of_owner: kindOfOwner, owner_we_vote_id: ownerWeVoteId, twitter_handle: twitterHandle,
91-
twitter_description: twitterDescription, twitter_followers_count: twitterFollowersCount,
92-
twitter_name: twitterName, twitter_photo_url: twitterPhotoUrl, twitter_user_website: twitterUserWebsite,
90+
kind_of_owner: kindOfOwner,
91+
owner_we_vote_id: ownerWeVoteId,
92+
twitter_handle: twitterHandle,
93+
twitter_description: twitterDescription,
94+
twitter_followers_count: twitterFollowersCount,
95+
twitter_name: twitterName,
96+
twitter_photo_url: twitterPhotoUrl,
97+
twitter_user_website: twitterUserWebsite,
9398
status,
9499
} = TwitterStore.get();
95100

@@ -287,7 +292,12 @@ class VerifyThisIsMe extends Component {
287292
<PageContentContainer>
288293
<Helmet title={`Claim @${twitterHandle} - We Vote`} />
289294
<TwitterAccountCard
290-
// {...this.state}
295+
twitterDescription={twitterDescription}
296+
twitterHandle={twitterHandle}
297+
twitterFollowersCount={twitterFollowersCount}
298+
twitterPhotoUrl={twitterPhotoUrl}
299+
twitterName={twitterName}
300+
twitterUserWebsite={twitterUserWebsite}
291301
/>
292302
<div>
293303
<br />

0 commit comments

Comments
 (0)