Skip to content

Commit

Permalink
[native] simplify RelationshipListItem jsx
Browse files Browse the repository at this point in the history
Summary: Small refactor diff to simplify the JSX being returned in `RelationshipListItem`

Test Plan: Confirmed that `RelationshipListItem` still looks and behaves the same

Reviewers: atul, inka

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9285
  • Loading branch information
ginsueddy committed Oct 9, 2023
1 parent 0d5f115 commit c610c2e
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions native/profile/relationship-list-item.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,12 @@ class RelationshipListItem extends React.PureComponent<Props> {
}

return (
<View style={this.props.styles.container}>
<View style={[this.props.styles.innerContainer, borderBottom]}>
<UserAvatar size="S" userID={this.props.userInfo.id} />
<SingleLine style={this.props.styles.username}>
{this.props.userInfo.username}
</SingleLine>
{editButton}
</View>
<View style={[this.props.styles.container, borderBottom]}>
<UserAvatar size="S" userID={this.props.userInfo.id} />
<SingleLine style={this.props.styles.username}>
{this.props.userInfo.username}
</SingleLine>
{editButton}
</View>
);
}
Expand Down Expand Up @@ -269,19 +267,13 @@ class RelationshipListItem extends React.PureComponent<Props> {
}

const unboundStyles = {
editButton: {
paddingLeft: 10,
},
container: {
flex: 1,
paddingHorizontal: 12,
backgroundColor: 'panelForeground',
},
innerContainer: {
flexDirection: 'row',
paddingHorizontal: 24,
paddingVertical: 10,
paddingHorizontal: 12,
backgroundColor: 'panelForeground',
borderColor: 'panelForegroundBorder',
flexDirection: 'row',
},
borderBottom: {
borderBottomWidth: 1,
Expand All @@ -299,6 +291,9 @@ const unboundStyles = {
lineHeight: 20,
marginLeft: 8,
},
editButton: {
paddingLeft: 10,
},
blueAction: {
color: 'link',
fontSize: 16,
Expand Down

0 comments on commit c610c2e

Please sign in to comment.