Repository navigation
feat(ui): Change assignee selector to use DropdownAutocomplete - #8941
Conversation
e8a3633 to
c211a29
Compare
| ) | ||
| {menuHeader && <LabelWithPadding>{menuHeader}</LabelWithPadding>} | ||
|
|
||
| <StyledItemList maxHeight={maxHeight}> |
There was a problem hiding this comment.
This makes sure that the Input, Header, and Footer are not scrolled away.
| // sensible default. | ||
| const StyledBaseAvatar = styled('span')` | ||
| flex-shrink: 0; | ||
| background-color: ${p => p.theme.whiteDark}; |
There was a problem hiding this comment.
This is so that there is a "placeholder" that's light grayish while we load an image avatar.
| let alignRight = alignMenu === 'right'; | ||
|
|
||
| return css` | ||
| top: 32px; |
There was a problem hiding this comment.
This is C&P'ed from existing component :o
There was a problem hiding this comment.
holy moly that's a lot of stuff lol. maybe we can just transform one of our carat svgs?
There was a problem hiding this comment.
Let's revisit this if we end up using this caret elsewhere
|
@ckj thoughts on the design changes here? (mostly height + dividers) |
|
@billyvg love it. looks better than before |
f0d7ab0 to
1a609b4
Compare
Chrissy
left a comment
There was a problem hiding this comment.
Looks really good! I made a handful of idealistic suggestions but for the most part this awesome.
|
|
||
| /* stylelint-disable-next-line no-duplicate-selectors */ | ||
| ${StyledMenu} { | ||
| right: -14px; |
There was a problem hiding this comment.
This centers the menu under the dropdown caret, open to suggestions
| margin: 0; | ||
| const IconUser = styled(props => ( | ||
| <div {...props}> | ||
| <span className="icon-user" /> |
There was a problem hiding this comment.
sigh one step at a time i suppose
| border-bottom: 1px solid rgba(52, 60, 69, 0.06); | ||
| `; | ||
|
|
||
| const InviteMemberLink = styled(Link)` |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| const StyledChevron = styled(InlineSvg)` | ||
| margin-left: ${space(1)}; | ||
| font-size: 12px; |
There was a problem hiding this comment.
better to use width or height here as opposed to font size.
| /** | ||
| * Max height of dropdown menu | ||
| */ | ||
| maxHeight: PropTypes.number, |
| * This is when we want to blend the bottom border of the actor button with the dropdown menu | ||
| * so that it looks a bit more seamless. | ||
| */ | ||
| zIndex: PropTypes.number, |
There was a problem hiding this comment.
couldn't this just be done at the parent level like:
const StyledDropdownAutocomplete = styled(DropdownAutocomplete)`
z-index: 9999999
`;
| /** | ||
| * Padding value for search input (requires the `padding` shortcut value) | ||
| */ | ||
| searchPadding: PropTypes.string, |
There was a problem hiding this comment.
these two props worry me. Can you explain why we need them? IMO if it just looks weird or too different we should:
A. Make it look better / moar the same everywhere
B. Pass a styled child component
C. Figure out some kind of semantically named state to pass in that controls the way it looks.
Ideally we can avoid passing around individual css lines as props because it enables nearly infinite component states and makes maintenance really challenging.
There was a problem hiding this comment.
I agree. Option A would be ideal but I think it's a bit too idealistic. Option B makes it difficult to re-use the good set of default components we have (and makes it a bit too easy to break design consistency). I think individual css rules as a prop is a good balance between full CSS control (e.g. searchStyle) and customizability.
I do like option C though, maybe *Size?
| let alignRight = alignMenu === 'right'; | ||
|
|
||
| return css` | ||
| top: 32px; |
There was a problem hiding this comment.
holy moly that's a lot of stuff lol. maybe we can just transform one of our carat svgs?
| )} | ||
| {!loading && ( | ||
| <DropdownAutoComplete | ||
| maxHeight={400} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
Thanks @Chrissy, added "Do not merge" until I have a chance to go through feedback. |
545b371 to
7546892
Compare
…have a list of dropdown menus like in assignee selector, the actor will be above the open menu
dda2222 to
5c9a920
Compare
This also allows for keyboard navigation of the assignee selector.
Old:

New:

Uses the same component as e.g.:
