Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions src/components/FloatingActionButton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, {PureComponent} from 'react';
import {Pressable, Animated, Easing} from 'react-native';
import {
Pressable, Animated, Easing, View,
} from 'react-native';
import PropTypes from 'prop-types';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
Expand Down Expand Up @@ -72,22 +74,24 @@ class FloatingActionButton extends PureComponent {

return (
<Tooltip absolute text={this.props.translate('common.new')}>
<AnimatedPressable
ref={el => this.fabPressable = el}
accessibilityLabel={this.props.accessibilityLabel}
accessibilityRole={this.props.accessibilityRole}
onPress={(e) => {
<View style={styles.floatingActionButtonContainer}>
<AnimatedPressable
ref={el => this.fabPressable = el}
accessibilityLabel={this.props.accessibilityLabel}
accessibilityRole={this.props.accessibilityRole}
onPress={(e) => {
// Drop focus to avoid blue focus ring.
this.fabPressable.blur();
this.props.onPress(e);
}}
style={[
styles.floatingActionButton,
StyleUtils.getAnimatedFABStyle(rotate, backgroundColor),
]}
>
<AnimatedIcon src={Expensicons.Plus} fill={fill} />
</AnimatedPressable>
this.fabPressable.blur();
this.props.onPress(e);
}}
style={[
styles.floatingActionButton,
StyleUtils.getAnimatedFABStyle(rotate, backgroundColor),
]}
>
<AnimatedIcon src={Expensicons.Plus} fill={fill} />
</AnimatedPressable>
</View>
</Tooltip>
);
}
Expand Down
11 changes: 7 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,16 +998,19 @@ const styles = {
},
},

floatingActionButton: {
backgroundColor: themeColors.success,
floatingActionButtonContainer: {
position: 'absolute',
height: variables.componentSizeLarge,
width: variables.componentSizeLarge,
right: 20,

// The bottom of the floating action button should align with the bottom of the compose box.
// The value should be equal to the height + marginBottom + marginTop of chatItemComposeSecondaryRow
bottom: 25,
},

floatingActionButton: {
backgroundColor: themeColors.success,
height: variables.componentSizeLarge,
width: variables.componentSizeLarge,
borderRadius: 999,
alignItems: 'center',
justifyContent: 'center',
Expand Down