Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.2' into 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Nov 24, 2022
2 parents c8207dd + c9e31b1 commit 40680a1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/bundle/Resources/public/scss/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@
.ibexa-dropdown {
&__selection-info {
border: none;

&:hover {
.ibexa-dropdown__selected-item {
color: $ibexa-color-primary;
}
}
}

&__item-label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@
transform: rotate(90deg);
}

&:hover {
border-color: $ibexa-color-primary;

.c-simple-dropdown__expand-icon {
fill: $ibexa-color-primary;
}
}

&--expanded &__items {
opacity: 1;
height: auto;
Expand All @@ -121,11 +129,17 @@
}
}

&:hover {
border-color: $ibexa-color-primary;
&--switcher {
&:hover {
border-color: transparent;

.c-simple-dropdown__expand-icon {
fill: $ibexa-color-primary;
.c-simple-dropdown__selected {
color: $ibexa-color-primary;

.ibexa-icon {
fill: $ibexa-color-primary;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import PropTypes from 'prop-types';
import { createCssClassNames } from '../helpers/css.class.names';
import Icon from '../icon/icon';

const SimpleDropdown = ({ options, selectedOption, extraClasses, onOptionClick, isDisabled, selectedItemLabel }) => {
const SimpleDropdown = ({ options, selectedOption, extraClasses, onOptionClick, isDisabled, selectedItemLabel, isSwitcher }) => {
const containerRef = useRef();
const [isExpanded, setIsExpanded] = useState(false);
const dropdownClass = createCssClassNames({
'c-simple-dropdown': true,
'c-simple-dropdown--expanded': isExpanded,
'c-simple-dropdown--disabled': isDisabled,
'c-simple-dropdown--switcher': isSwitcher,
[extraClasses]: true,
});
const toggleExpanded = () => {
Expand Down Expand Up @@ -114,12 +115,14 @@ SimpleDropdown.propTypes = {
onOptionClick: PropTypes.func.isRequired,
isDisabled: PropTypes.bool,
selectedItemLabel: PropTypes.string,
isSwitcher: PropTypes.bool,
};

SimpleDropdown.defaultProps = {
isDisabled: false,
extraClasses: '',
selectedItemLabel: '',
isSwitcher: false,
};

export default SimpleDropdown;
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const ViewSwitcherComponent = ({ onViewChange, activeView, isDisabled }) => {
selectedOption={selectedOption}
onOptionClick={switchView}
selectedItemLabel={viewLabel}
isSwitcher={true}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const SortSwitcher = ({ isDisabled }) => {
selectedOption={selectedOption}
onOptionClick={onOptionClick}
isDisabled={isDisabled}
isSwitcher={true}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const ViewSwitcher = ({ isDisabled }) => {
onOptionClick={onOptionClick}
isDisabled={isDisabled}
selectedItemLabel={viewLabel}
isSwitcher={true}
/>
</div>
);
Expand Down

0 comments on commit 40680a1

Please sign in to comment.