Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Feb 12, 2021
1 parent 4335731 commit 3e371b6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/components/OptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import optionPropTypes from './optionPropTypes';

const propTypes = {
// Style for hovered state
optionHoveredStyle: PropTypes.arrayOf(PropTypes.object),
// eslint-disable-next-line react/forbid-prop-types
optionHoveredStyle: PropTypes.object,

// Extra styles for the section list container
contentContainerStyles: PropTypes.arrayOf(PropTypes.object),
Expand Down Expand Up @@ -66,7 +67,7 @@ const propTypes = {
};

const defaultProps = {
optionHoveredStyle: [],
optionHoveredStyle: undefined,
contentContainerStyles: [],
sections: [],
focusedIndex: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class OptionsSelector extends Component {
</View>
<OptionsList
ref={el => this.list = el}
optionHoveredStyle={[styles.modalLinkHover]}
optionHoveredStyle={styles.hoveredComponentBG}
onSelectRow={this.props.onSelectRow}
sections={this.props.sections}
focusedIndex={this.state.focusedIndex}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/home/sidebar/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import Hoverable from '../../../components/Hoverable';

const propTypes = {
// Style for hovered state
hoverStyle: PropTypes.arrayOf(PropTypes.object),
// eslint-disable-next-line react/forbid-prop-types
hoverStyle: PropTypes.object,

// Option to allow the user to choose from can be type 'report' or 'user'
option: optionPropTypes.isRequired,
Expand All @@ -42,7 +43,7 @@ const propTypes = {
};

const defaultProps = {
hoverStyle: [],
hoverStyle: styles.sidebarLinkHover,
hideAdditionalOptionStates: false,
showSelectedState: false,
isSelected: false,
Expand All @@ -64,7 +65,6 @@ const OptionRow = ({
: styles.sidebarLinkText;
const textUnreadStyle = (option.isUnread || forceTextUnreadStyle)
? [textStyle, styles.sidebarLinkTextUnread] : [textStyle];
const hoveredStyle = hoverStyle ? [styles.sidebarLinkHover, ...hoverStyle] : [styles.sidebarLinkHover];
return (
<Hoverable>
{hovered => (
Expand All @@ -76,7 +76,7 @@ const OptionRow = ({
styles.sidebarLink,
styles.sidebarLinkInner,
optionIsFocused ? styles.sidebarLinkActive : null,
hovered && !optionIsFocused ? hoveredStyle : null,
hovered && !optionIsFocused ? hoverStyle : null,
]}
>
<TouchableOpacity
Expand Down
8 changes: 4 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ const styles = {
color: themeColors.textReversed,
},

hoveredComponentBG: {
backgroundColor: themeColors.componentBGHover,
},

touchableButtonImage: {
alignItems: 'center',
height: variables.componentSizeNormal,
Expand Down Expand Up @@ -778,10 +782,6 @@ const styles = {
flex: 1,
},

modalLinkHover: {
backgroundColor: themeColors.componentBGHover,
},

borderBottom: {
borderBottomWidth: 1,
borderColor: themeColors.border,
Expand Down

0 comments on commit 3e371b6

Please sign in to comment.