Skip to content

Commit

Permalink
Merge branch 'dev' into fix/msig_protfolio
Browse files Browse the repository at this point in the history
  • Loading branch information
tuul-wq authored Nov 18, 2024
2 parents 556afbc + 21156d4 commit 7bafd52
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/renderer/shared/ui-kit/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type ContextProps = {
theme?: 'light' | 'dark';
invalid?: boolean;
disabled?: boolean;
height?: 'sm' | 'md';
testId?: string;
};

Expand All @@ -34,14 +35,15 @@ const Root = ({
invalid,
disabled,
testId = 'Select',
height = 'sm',
open,
onToggle,
placeholder,
value,
onChange,
children,
}: RootProps) => {
const ctx = useMemo(() => ({ theme, invalid, disabled, testId }), [theme, invalid, disabled, testId]);
const ctx = useMemo(() => ({ theme, height, invalid, disabled, testId }), [theme, height, invalid, disabled, testId]);

return (
<Context.Provider value={ctx}>
Expand All @@ -58,16 +60,18 @@ type TriggerProps = {
};

const Button = ({ placeholder }: TriggerProps) => {
const { theme, invalid, disabled } = useContext(Context);
const { theme, height, invalid, disabled } = useContext(Context);

return (
<RadixSelect.Trigger
className={cnTw(
'relative flex w-full items-center py-[7px] pl-[11px] pr-6',
'relative flex w-full items-center pl-[11px] pr-6',
'rounded border text-footnote outline-offset-1',
'enabled:hover:shadow-card-shadow',
'data-[state=open]:border-active-container-border',
{
'h-8.5': height === 'sm',
'h-10.5': height === 'md',
'border-filter-border bg-input-background text-text-primary': theme === 'light',
'border-border-dark text-white': theme === 'dark',
'bg-input-background-disabled text-text-tertiary': disabled,
Expand Down Expand Up @@ -131,7 +135,7 @@ const Item = ({ value, children }: PropsWithChildren<ItemProps>) => {
<RadixSelect.Item
value={value}
className={cnTw(
'flex w-full cursor-pointer rounded p-2 text-footnote text-text-secondary',
'flex w-full cursor-pointer rounded px-3 py-2 text-footnote text-text-secondary',
'focus:bg-action-background-hover focus:outline-none data-[highlighted]:bg-action-background-hover',
{
'focus:bg-block-background-hover data-[highlighted]:bg-background-item-hover': theme === 'dark',
Expand Down

0 comments on commit 7bafd52

Please sign in to comment.