Skip to content

Commit

Permalink
fix(tooltip-icon-button): Added tooltip prop for FAB
Browse files Browse the repository at this point in the history
  • Loading branch information
mananjadhav committed Aug 16, 2021
1 parent 5e01516 commit 78fbef9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/FAB/fabPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const fabPropTypes = {

// Current state (active or not active) of the component
isActive: PropTypes.bool.isRequired,

// tooltip for the button
tooltip: PropTypes.string.isRequired,
};

export default fabPropTypes;
4 changes: 2 additions & 2 deletions src/components/FAB/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import FAB from './FAB';
import fabPropTypes from './fabPropTypes';

// KeyboardAvoidingView only need in IOS so that's the reason make platform specific FAB component.
function Fab({onPress, isActive}) {
function Fab({onPress, isActive, tooltip}) {
return (
<KeyboardAvoidingView behavior="position">
<FAB onPress={onPress} isActive={isActive} />
<FAB onPress={onPress} isActive={isActive} tooltip={tooltip} />
</KeyboardAvoidingView>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ class SidebarScreen extends Component {
onAvatarClick={this.navigateToSettings}
isSmallScreenWidth={this.props.isSmallScreenWidth}
/>

<FAB
tooltip={this.props.translate('sidebarScreen.fabAction')}
accessibilityLabel={this.props.translate('sidebarScreen.fabNewChat')}
accessibilityRole="button"
isActive={this.state.isCreateMenuActive}
Expand Down

0 comments on commit 78fbef9

Please sign in to comment.