Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(suite): update the country select component on trade dashboard #13403

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

adamhavel
Copy link
Contributor

Description

Updated the country select component on trade dashboard so that is more obvious it can be used to type in the country. Fixed some visual issues. Could not fix the issue where the selected country can be deleted with backspace, should be supported by the underlying react-select component (via props isClearable and backspaceRemovesValue) but custom components probably prevent it to work properly.

Screenshots:

Before:

Screenshot 2024-07-17 at 20 37 56

After:

Screenshot 2024-07-17 at 20 37 07

@@ -179,13 +179,24 @@ const Wrapper = styled.div<WrapperProps>`
display: flex;
align-items: center;
justify-content: ${({ $isClean }) => ($isClean ? 'flex-end' : 'flex-start')};
width: 100%;
width: ${({ $isSearchable }) => !$isSearchable && '100%'};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will result into invalid css in case that isSearchable is false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, thanks. Had thought Styled would handle this and not render the property at all. I will fix it:)

margin: 0;

&:hover {
cursor: ${({ $isSearchable }) => $isSearchable && 'text'};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor

@jvaclavik jvaclavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just few issues and ready to 🚢

@@ -170,7 +170,7 @@ const Wrapper = styled.div<WrapperProps>`
flex-wrap: nowrap;
min-width: ${({ $minValueWidth }) => $minValueWidth};
justify-content: ${({ $isClean }) => ($isClean ? 'flex-end' : 'flex-start')};
padding: 0;
padding: 0 25px 0 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to use predefined spacings if possible.

Could you use it this way? 🙏
padding: 0 ${spacingsPx.xl} 0 0;

@@ -36,6 +36,7 @@ const Label = styled.div`
padding-top: 1px;
color: ${({ theme }) => theme.TYPE_LIGHT_GREY};
font-weight: ${variables.FONT_WEIGHT.MEDIUM};
margin-right: 10px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use spacings here🙏

margin-right: ${spacingsPx.xs}

@@ -170,7 +170,7 @@ const Wrapper = styled.div<WrapperProps>`
flex-wrap: nowrap;
min-width: ${({ $minValueWidth }) => $minValueWidth};
justify-content: ${({ $isClean }) => ($isClean ? 'flex-end' : 'flex-start')};
padding: 0;
padding: 0 25px 0 0;
Copy link
Contributor

@peter-sanderson peter-sanderson Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to user constants for spacing everywhere: ${spacings.xl} is 24px can we use this here?

If not and 25 is just needed in this case, no no big deal leaving it here.

}
}

.${reactSelectClassNamePrefix}__single-value + .${reactSelectClassNamePrefix}__input-container {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jvaclavik This component is full of the Dark Arts 🔮. WEN floating UI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sooner, the better. Wen you have free week? 😀

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me? You have the biggest team now... :D

@adamhavel adamhavel force-pushed the fix/unable-to-type-country-in-the-dropdown-menu branch 2 times, most recently from e69468e to 7ad0bcf Compare July 19, 2024 09:27
@adamhavel adamhavel force-pushed the fix/unable-to-type-country-in-the-dropdown-menu branch from 7ad0bcf to 8f3688f Compare July 19, 2024 10:01
@adamhavel adamhavel merged commit c17a3c1 into develop Jul 19, 2024
24 checks passed
@adamhavel adamhavel deleted the fix/unable-to-type-country-in-the-dropdown-menu branch July 19, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empower/Trade - unable to type country in the dropdown menu
4 participants