|
1 | | -import * as React from 'react' |
2 | | -import ProfileSearch from '../search/bar' |
3 | | -import * as Kb from '../../common-adapters' |
4 | 1 | import * as Constants from '../../constants/tracker2' |
| 2 | +import * as Kb from '../../common-adapters' |
| 3 | +import * as RPCTypes from '../../constants/types/rpc-gen' |
| 4 | +import * as React from 'react' |
5 | 5 | import * as Styles from '../../styles' |
6 | | -import chunk from 'lodash/chunk' |
7 | | -import upperFirst from 'lodash/upperFirst' |
8 | | -import Bio from '../../tracker2/bio/container' |
9 | | -import Assertion from '../../tracker2/assertion/container' |
10 | 6 | import Actions from './actions/container' |
| 7 | +import Assertion from '../../tracker2/assertion/container' |
| 8 | +import Bio from '../../tracker2/bio/container' |
11 | 9 | import Friend from './friend/container' |
12 | 10 | import Measure from './measure' |
| 11 | +import ProfileSearch from '../search/bar' |
13 | 12 | import Teams from './teams/container' |
| 13 | +import chunk from 'lodash/chunk' |
14 | 14 | import shallowEqual from 'shallowequal' |
15 | | -import * as RPCTypes from '../../constants/types/rpc-gen' |
16 | 15 | import type * as Types from '../../constants/types/tracker2' |
17 | | -import {SiteIcon} from '../generic/shared' |
18 | | -import {HeaderLeftArrow} from '../../common-adapters/header-hoc' |
19 | 16 | import type {RPCError} from '../../util/errors' |
| 17 | +import upperFirst from 'lodash/upperFirst' |
| 18 | +import {HeaderLeftArrow} from '../../common-adapters/header-hoc' |
| 19 | +import {SiteIcon} from '../generic/shared' |
20 | 20 |
|
21 | 21 | export type BackgroundColorType = 'red' | 'green' | 'blue' |
22 | 22 |
|
@@ -246,72 +246,64 @@ export type BioTeamProofsProps = { |
246 | 246 | fullName?: string |
247 | 247 | title: string |
248 | 248 | } |
249 | | -export class BioTeamProofs extends React.PureComponent<BioTeamProofsProps> { |
250 | | - render() { |
251 | | - const addIdentity = this.props.onAddIdentity ? ( |
252 | | - <Kb.ButtonBar style={styles.addIdentityContainer}> |
253 | | - <Kb.Button |
| 249 | +const BioTeamProofs = (props: BioTeamProofsProps) => { |
| 250 | + const addIdentity = props.onAddIdentity ? ( |
| 251 | + <Kb.ButtonBar style={styles.addIdentityContainer}> |
| 252 | + <Kb.Button |
| 253 | + fullWidth={true} |
| 254 | + onClick={props.onAddIdentity} |
| 255 | + style={styles.addIdentityButton} |
| 256 | + mode="Secondary" |
| 257 | + label="Add more identities" |
| 258 | + /> |
| 259 | + </Kb.ButtonBar> |
| 260 | + ) : null |
| 261 | + return Styles.isMobile ? ( |
| 262 | + <Kb.Box2 direction="vertical" fullWidth={true} style={styles.bioAndProofs}> |
| 263 | + {!!props.reason && ( |
| 264 | + <Kb.Text |
| 265 | + type="BodySmallSemibold" |
| 266 | + negative={true} |
| 267 | + center={true} |
| 268 | + style={Styles.collapseStyles([styles.reason, colorTypeToStyle(props.backgroundColorType)])} |
| 269 | + > |
| 270 | + {props.reason} |
| 271 | + </Kb.Text> |
| 272 | + )} |
| 273 | + <Kb.Box2 direction="vertical" fullWidth={true} style={{position: 'relative'}}> |
| 274 | + <Kb.Box2 |
| 275 | + direction="vertical" |
254 | 276 | fullWidth={true} |
255 | | - onClick={this.props.onAddIdentity} |
256 | | - style={styles.addIdentityButton} |
257 | | - mode="Secondary" |
258 | | - label="Add more identities" |
| 277 | + style={Styles.collapseStyles([styles.backgroundColor, colorTypeToStyle(props.backgroundColorType)])} |
259 | 278 | /> |
260 | | - </Kb.ButtonBar> |
261 | | - ) : null |
262 | | - return Styles.isMobile ? ( |
263 | | - <Kb.Box2 direction="vertical" fullWidth={true} style={styles.bioAndProofs}> |
264 | | - {!!this.props.reason && ( |
265 | | - <Kb.Text |
266 | | - type="BodySmallSemibold" |
267 | | - negative={true} |
268 | | - center={true} |
269 | | - style={Styles.collapseStyles([styles.reason, colorTypeToStyle(this.props.backgroundColorType)])} |
270 | | - > |
271 | | - {this.props.reason} |
| 279 | + </Kb.Box2> |
| 280 | + <BioLayout {...props} /> |
| 281 | + <Kb.Box2 direction="vertical" fullWidth={true} style={styles.proofsArea}> |
| 282 | + <Teams username={props.username} /> |
| 283 | + <Proofs {...props} /> |
| 284 | + {addIdentity} |
| 285 | + </Kb.Box2> |
| 286 | + </Kb.Box2> |
| 287 | + ) : ( |
| 288 | + <> |
| 289 | + <Kb.Box2 |
| 290 | + direction="vertical" |
| 291 | + fullWidth={true} |
| 292 | + style={Styles.collapseStyles([styles.backgroundColor, colorTypeToStyle(props.backgroundColorType)])} |
| 293 | + /> |
| 294 | + <Kb.Box2 key="bioTeam" direction="horizontal" fullWidth={true} style={styles.bioAndProofs}> |
| 295 | + <BioLayout {...props} /> |
| 296 | + <Kb.Box2 direction="vertical" style={styles.proofs}> |
| 297 | + <Kb.Text type="BodySmallSemibold" negative={true} center={true} style={styles.reason}> |
| 298 | + {props.reason} |
272 | 299 | </Kb.Text> |
273 | | - )} |
274 | | - <Kb.Box2 direction="vertical" fullWidth={true} style={{position: 'relative'}}> |
275 | | - <Kb.Box2 |
276 | | - direction="vertical" |
277 | | - fullWidth={true} |
278 | | - style={Styles.collapseStyles([ |
279 | | - styles.backgroundColor, |
280 | | - colorTypeToStyle(this.props.backgroundColorType), |
281 | | - ])} |
282 | | - /> |
283 | | - </Kb.Box2> |
284 | | - <BioLayout {...this.props} /> |
285 | | - <Kb.Box2 direction="vertical" fullWidth={true} style={styles.proofsArea}> |
286 | | - <Teams username={this.props.username} /> |
287 | | - <Proofs {...this.props} /> |
| 300 | + <Teams username={props.username} /> |
| 301 | + <Proofs {...props} /> |
288 | 302 | {addIdentity} |
289 | 303 | </Kb.Box2> |
290 | 304 | </Kb.Box2> |
291 | | - ) : ( |
292 | | - <> |
293 | | - <Kb.Box2 |
294 | | - direction="vertical" |
295 | | - fullWidth={true} |
296 | | - style={Styles.collapseStyles([ |
297 | | - styles.backgroundColor, |
298 | | - colorTypeToStyle(this.props.backgroundColorType), |
299 | | - ])} |
300 | | - /> |
301 | | - <Kb.Box2 key="bioTeam" direction="horizontal" fullWidth={true} style={styles.bioAndProofs}> |
302 | | - <BioLayout {...this.props} /> |
303 | | - <Kb.Box2 direction="vertical" style={styles.proofs}> |
304 | | - <Kb.Text type="BodySmallSemibold" negative={true} center={true} style={styles.reason}> |
305 | | - {this.props.reason} |
306 | | - </Kb.Text> |
307 | | - <Teams username={this.props.username} /> |
308 | | - <Proofs {...this.props} /> |
309 | | - {addIdentity} |
310 | | - </Kb.Box2> |
311 | | - </Kb.Box2> |
312 | | - </> |
313 | | - ) |
314 | | - } |
| 305 | + </> |
| 306 | + ) |
315 | 307 | } |
316 | 308 |
|
317 | 309 | type State = { |
@@ -477,9 +469,6 @@ class User extends React.Component<Props, State> { |
477 | 469 | > |
478 | 470 | <Kb.Box2 direction="vertical" style={styles.innerContainer}> |
479 | 471 | {!Styles.isMobile && <Measure onMeasured={this._onMeasured} />} |
480 | | - <Kb.SafeAreaViewTop |
481 | | - style={Styles.collapseStyles([colorTypeToStyle(this.props.backgroundColorType), styles.noGrow])} |
482 | | - /> |
483 | 472 | {!!this.state.width && ( |
484 | 473 | <Kb.SectionList |
485 | 474 | key={this.props.username + this.state.width /* forc render on user change or width change */} |
|
0 commit comments