Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core Branding] Fix Compose Bar Text Alignment #13645

Merged
merged 14 commits into from
Jan 13, 2023
Merged
32 changes: 17 additions & 15 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,20 +600,22 @@ class ReportActionCompose extends React.Component {
</Tooltip>
)}
<Tooltip text={this.props.translate('reportActionCompose.addAction')}>
<TouchableOpacity
ref={el => this.actionButton = el}
onPress={(e) => {
e.preventDefault();

// Drop focus to avoid blue focus ring.
this.actionButton.blur();
this.setMenuVisibility(true);
}}
style={styles.chatItemAttachButton}
disabled={isBlockedFromConcierge || this.props.disabled}
>
<Icon src={Expensicons.Plus} />
</TouchableOpacity>
<View style={styles.chatItemAttachBorder}>
<TouchableOpacity
ref={el => this.actionButton = el}
onPress={(e) => {
e.preventDefault();

// Drop focus to avoid blue focus ring.
this.actionButton.blur();
this.setMenuVisibility(true);
}}
style={styles.chatItemAttachButton}
disabled={isBlockedFromConcierge || this.props.disabled}
>
<Icon src={Expensicons.Plus} />
</TouchableOpacity>
</View>
</Tooltip>
</View>
<PopoverMenu
Expand All @@ -637,7 +639,7 @@ class ReportActionCompose extends React.Component {
</>
)}
</AttachmentPicker>
<View style={styles.textInputComposeSpacing}>
<View style={[styles.textInputComposeSpacing]}>
<DragAndDrop
dropZoneId={CONST.REPORT.DROP_NATIVE_ID}
activeDropZoneId={CONST.REPORT.ACTIVE_DROP_NATIVE_ID}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const ReportActionItemSingle = (props) => {
return (
<View style={props.wrapperStyles}>
<Pressable
style={[styles.alignSelfStart, styles.mr2]}
style={[styles.alignSelfStart]}
onPressIn={ControlSelection.block}
onPressOut={ControlSelection.unblock}
onPress={() => showUserDetails(props.action.actorEmail)}
Expand Down
39 changes: 23 additions & 16 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,11 @@ const styles = {
},

chatItemComposeSecondaryRowOffset: {
marginLeft: 48,
marginLeft: variables.chatInputSpacing,
},

offlineIndicator: {
marginLeft: 48,
marginLeft: variables.chatInputSpacing,
},

offlineIndicatorMobile: {
Expand All @@ -710,6 +710,7 @@ const styles = {
// Actions
actionAvatar: {
borderRadius: 20,
marginRight: variables.avatarChatSpacing,
},

componentHeightLarge: {
Expand Down Expand Up @@ -1306,7 +1307,7 @@ const styles = {
flexShrink: 1,
flexBasis: 0,
position: 'relative',
marginLeft: 48,
marginLeft: variables.chatInputSpacing,
},

chatItemRight: {
Expand Down Expand Up @@ -1420,7 +1421,7 @@ const styles = {
// On Android, multiline TextInput with height: 'auto' will show extra padding unless they are configured with
// paddingVertical: 0, alignSelf: 'center', and textAlignVertical: 'center'

paddingHorizontal: 8,
paddingHorizontal: variables.avatarChatSpacing,
paddingTop: 0,
paddingBottom: 0,
alignSelf: 'center',
Expand Down Expand Up @@ -1451,7 +1452,7 @@ const styles = {
backgroundColor: themeColors.transparent,
height: 32,
padding: 6,
margin: 4,
margin: 3,
justifyContent: 'center',
},

Expand Down Expand Up @@ -1525,8 +1526,7 @@ const styles = {
alignSelf: 'flex-end',
borderRadius: variables.buttonBorderRadius,
height: 32,
marginVertical: 4,
marginLeft: 3,
marginVertical: 3,
paddingHorizontal: 6,
justifyContent: 'center',
},
Expand All @@ -1540,24 +1540,31 @@ const styles = {
},

chatItemAttachButton: {
alignItems: 'center',
alignSelf: 'flex-end',
borderRightColor: themeColors.border,
borderRightWidth: 1,
borderRadius: variables.componentBorderRadiusRounded,
backgroundColor: themeColors.transparent,
height: 32,
width: 32,
marginBottom: 4,
marginTop: 4,
marginLeft: 4,
padding: 6,
marginLeft: 3,
marginRight: 3,
justifyContent: 'center',
},

chatItemAttachBorder: {
borderRightColor: themeColors.border,
borderRightWidth: 1,
marginBottom: 3,
marginTop: 3,

},

composerSizeButton: {
alignItems: 'center',
alignSelf: 'flex-end',
height: 26,
marginBottom: 6,
marginTop: 6,
marginRight: 4,
justifyContent: 'center',
width: 32,
},
Expand Down Expand Up @@ -1739,13 +1746,13 @@ const styles = {
},

emptyAvatar: {
marginRight: variables.componentSizeNormal - 24,
marginRight: variables.avatarChatSpacing,
height: variables.avatarSizeNormal,
width: variables.avatarSizeNormal,
},

emptyAvatarSmall: {
marginRight: variables.componentSizeNormal - 28,
marginRight: variables.avatarChatSpacing - 4,
height: variables.avatarSizeSmall,
width: variables.avatarSizeSmall,
},
Expand Down
4 changes: 3 additions & 1 deletion src/styles/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
contentHeaderHeight: getValueUsingPixelRatio(65, 100),
componentSizeSmall: getValueUsingPixelRatio(28, 32),
componentSizeNormal: 40,
inputComponentSizeNormal: 42,
inputComponentSizeNormal: 40,
componentSizeLarge: 52,
componentBorderRadius: 8,
componentBorderRadiusSmall: 4,
Expand Down Expand Up @@ -84,4 +84,6 @@ export default {
sliderBarHeight: 8,
sliderKnobSize: 26,
checkboxLabelActiveOpacity: 0.7,
avatarChatSpacing: 12,
chatInputSpacing: 52, // 40 + avatarChatSpacing
};