Skip to content

Commit

Permalink
[web] Use colors from themes.css in dropdown
Browse files Browse the repository at this point in the history
Summary:
Some feedback in D8136 was to use colors from `themes.css` instead of inlining them in `SWMansionIcon`.

Depends on D8337

Test Plan: Confirmed that both enabled and disabled dropdowns still look the same

Reviewers: atul, ashoat

Reviewed By: atul

Subscribers: tomek, ted

Differential Revision: https://phab.comm.dev/D8338
  • Loading branch information
RohanK6 committed Jun 28, 2023
1 parent fb164b4 commit 2bb6d80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions web/components/dropdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
.dropdownIcon {
margin-left: auto;
font-size: var(--m-font-16);
color: var(--dropdown-chevron-color);
}

.dropdownList {
Expand Down
8 changes: 6 additions & 2 deletions web/components/dropdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function Dropdown(props: DropdownProps): React.Node {
[css.dropdownDisabled]: !!disabled,
});

const dropdownIconClassNames = classNames({
[css.dropdownIcon]: true,
[css.dropdownDisabled]: !!disabled,
});

const toggleMenu = React.useCallback(() => {
if (disabled) {
return;
Expand Down Expand Up @@ -89,10 +94,9 @@ function Dropdown(props: DropdownProps): React.Node {
<div className={css.dropdownContainer} onClick={toggleMenu}>
<div className={dropdownMenuClassNames}>
<p className={dropdownTextClassNames}>{activeDisplayedOption}</p>
<div className={css.dropdownIcon}>
<div className={dropdownIconClassNames}>
<SWMansionIcon
icon={isOpen ? 'chevron-up' : 'chevron-down'}
color={disabled ? 'gray' : 'white'}
size={18}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
--dropdown-option-bg: var(--shades-black-80);
--dropdown-option-hover-bg: var(--shades-black-70);
--dropdown-selected-option-check-color: var(--violet-dark-100);
--dropdown-chevron-color: var(--shades-white-100);
--dropdown-disabled-color: var(--shades-black-60);
--change-member-role-modal-description-text: var(--shades-white-60);
--change-member-role-modal-generic-text: var(--shades-white-100);
Expand Down

0 comments on commit 2bb6d80

Please sign in to comment.