Skip to content

Commit 65a0f1c

Browse files
committed
Create width type
1 parent 8d28200 commit 65a0f1c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormFieldInputRowContainer.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const StyledFormFieldInputRowContainer = styled.div<{
99
display: flex;
1010
flex-direction: row;
1111
position: relative;
12+
1213
${({ multiline }) =>
1314
multiline
1415
? css`

packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ import { isDefined } from 'twenty-shared/utils';
2525
import { useIsMobile } from 'twenty-ui/utilities';
2626
import { useDropdown } from '../hooks/useDropdown';
2727

28+
type Width = `${string}px` | `${number}%` | 'auto' | number;
2829
const StyledDropdownFallbackAnchor = styled.div`
2930
left: 0;
3031
position: fixed;
3132
top: 0;
3233
`;
3334

3435
const StyledClickableComponent = styled.div<{
35-
width?: `${string}px` | `${number}%` | 'auto' | number;
36+
width?: Width;
3637
}>`
3738
height: fit-content;
3839
width: ${({ width }) => width ?? 'auto'};
@@ -41,6 +42,7 @@ const StyledClickableComponent = styled.div<{
4142
export type DropdownProps = {
4243
className?: string;
4344
clickableComponent?: ReactNode;
45+
clickableComponentWidth?: Width;
4446
dropdownComponents: ReactNode;
4547
hotkey?: {
4648
key: Keys;
@@ -49,14 +51,13 @@ export type DropdownProps = {
4951
dropdownHotkeyScope: HotkeyScope;
5052
dropdownId: string;
5153
dropdownPlacement?: Placement;
52-
dropdownWidth?: `${string}px` | `${number}%` | 'auto' | number;
54+
dropdownWidth?: Width;
5355
dropdownOffset?: DropdownOffset;
5456
dropdownStrategy?: 'fixed' | 'absolute';
5557
onClickOutside?: () => void;
5658
onClose?: () => void;
5759
onOpen?: () => void;
5860
avoidPortal?: boolean;
59-
clickableComponentWidth?: `${string}px` | `${number}%` | 'auto' | number;
6061
};
6162

6263
export const Dropdown = ({

0 commit comments

Comments
 (0)