Skip to content

Commit

Permalink
Improve MultiSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
mvaivre committed Jan 24, 2025
1 parent 4157426 commit 9dca070
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions apps/desktop-wallet/src/components/Inputs/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled, { useTheme } from 'styled-components'

import Button from '@/components/Button'
import CheckMark from '@/components/CheckMark'
import { inputDefaultStyle, InputLabel } from '@/components/Inputs'
import { inputDefaultStyle, SelectLabel } from '@/components/Inputs'
import InputArea from '@/components/Inputs/InputArea'
import { OptionItem, OptionSelect } from '@/components/Inputs/Select'
import Popup from '@/components/Popup'
Expand Down Expand Up @@ -45,7 +45,7 @@ function MultiSelect<T>({ selectedOptions, label, renderSelectedValue, className
onMouseDown={openOptionsModal}
onKeyDown={(e) => onEnterOrSpace(e, openOptionsModal)}
>
<InputLabel isElevated={selectedOptions.length > 0}>{label}</InputLabel>
<SelectLabel>{label}</SelectLabel>
<SelectedValue>
<Truncate>{renderSelectedValue()}</Truncate>
</SelectedValue>
Expand Down Expand Up @@ -136,7 +136,8 @@ export function MultiSelectOptionsModal<T>({
export default MultiSelect

const MultiSelectInputArea = styled(InputArea)`
${inputDefaultStyle(true, true, true, 'big')};
${inputDefaultStyle(true, true, false)};
gap: 10px;
`

const SelectedValue = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop-wallet/src/components/Inputs/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ const SelectContainer = styled.div<InputProps>`

padding-right: 35px;
font-weight: var(--fontWeight-medium);
gap: 20px;
gap: 10px;

cursor: ${({ showPointer }) => showPointer && 'pointer'};

Expand Down
4 changes: 2 additions & 2 deletions apps/desktop-wallet/src/components/Inputs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const inputStyling = {

export const inputDefaultStyle = (
hasIcon?: boolean,
hasValue?: boolean,
topPadding?: boolean,
hasLabel?: boolean,
heightSize?: InputHeight,
largeText?: boolean
Expand All @@ -67,7 +67,7 @@ export const inputDefaultStyle = (

transition: all 0.1s;

${hasValue &&
${topPadding &&
hasLabel &&
css`
padding-top: 13px;
Expand Down
1 change: 1 addition & 0 deletions apps/desktop-wallet/src/components/NavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const ButtonStyled = styled(Button)<{ isActive: boolean }>`
opacity: ${({ isActive }) => (isActive ? 1 : 0.4)};
font-weight: ${({ isActive }) => (isActive ? 'var(--fontWeight-semiBold)' : 'var(--fontWeight-medium)')};
border-radius: var(--radius-medium);
font-size: 14px;

@media (max-width: ${sidebarExpandThresholdPx}px) {
gap: 0;
Expand Down

0 comments on commit 9dca070

Please sign in to comment.