Refactor icon picker to use shared styled dropdown menu (#1998)
This commit is contained in:
@ -6,6 +6,7 @@ import { LightIconButton } from '@/ui/button/components/LightIconButton';
|
|||||||
import { DropdownMenu } from '@/ui/dropdown/components/DropdownMenu';
|
import { DropdownMenu } from '@/ui/dropdown/components/DropdownMenu';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/dropdown/components/DropdownMenuItemsContainer';
|
||||||
import { DropdownMenuSearchInput } from '@/ui/dropdown/components/DropdownMenuSearchInput';
|
import { DropdownMenuSearchInput } from '@/ui/dropdown/components/DropdownMenuSearchInput';
|
||||||
|
import { StyledDropdownMenu } from '@/ui/dropdown/components/StyledDropdownMenu';
|
||||||
import { StyledDropdownMenuSeparator } from '@/ui/dropdown/components/StyledDropdownMenuSeparator';
|
import { StyledDropdownMenuSeparator } from '@/ui/dropdown/components/StyledDropdownMenuSeparator';
|
||||||
import { useDropdown } from '@/ui/dropdown/hooks/useDropdown';
|
import { useDropdown } from '@/ui/dropdown/hooks/useDropdown';
|
||||||
import { DropdownScope } from '@/ui/dropdown/scopes/DropdownScope';
|
import { DropdownScope } from '@/ui/dropdown/scopes/DropdownScope';
|
||||||
@ -23,10 +24,6 @@ type IconPickerProps = {
|
|||||||
onOpen?: () => void;
|
onOpen?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
|
||||||
width: 176px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledMenuIconItemsContainer = styled.div`
|
const StyledMenuIconItemsContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -89,7 +86,7 @@ export const IconPicker = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
dropdownComponents={
|
dropdownComponents={
|
||||||
<StyledContainer>
|
<StyledDropdownMenu width={168}>
|
||||||
<DropdownMenuSearchInput
|
<DropdownMenuSearchInput
|
||||||
placeholder="Search icon"
|
placeholder="Search icon"
|
||||||
autoFocus
|
autoFocus
|
||||||
@ -116,7 +113,7 @@ export const IconPicker = ({
|
|||||||
</StyledMenuIconItemsContainer>
|
</StyledMenuIconItemsContainer>
|
||||||
)}
|
)}
|
||||||
</DropdownMenuItemsContainer>
|
</DropdownMenuItemsContainer>
|
||||||
</StyledContainer>
|
</StyledDropdownMenu>
|
||||||
}
|
}
|
||||||
onClickOutside={onClickOutside}
|
onClickOutside={onClickOutside}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user