Skip to content

The open alternative to Salesforce, designed for AI.

Improve phone input UI (#8266)

Hitarth Sheth4db0d0f8c131
diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/PhonesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/PhonesFieldInput.tsx
index 54fb7ab8ded..97154d93e16 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/PhonesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/PhonesFieldInput.tsx
@@ -22,6 +22,7 @@ const StyledCustomPhoneInput = styled(ReactPhoneNumberInput)`
background: none;
border: none;
color: ${({ theme }) => theme.font.color.primary};
+ margin-left: ${({ theme }) => theme.spacing(2)};
&::placeholder,
&::-webkit-input-placeholder {
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
index 614758963e9..2a550c6d924 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
@@ -1,12 +1,11 @@
-import { useTheme } from '@emotion/react';
-import styled from '@emotion/styled';
-import { useEffect, useState } from 'react';
-import { IconChevronDown, IconWorld } from 'twenty-ui';
-
import { useCountries } from '@/ui/input/components/internal/hooks/useCountries';
import { Country } from '@/ui/input/components/internal/types/Country';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
+import { useTheme } from '@emotion/react';
+import styled from '@emotion/styled';
+import { useEffect, useState } from 'react';
+import { IconChevronDown, IconWorld } from 'twenty-ui';
import { isDefined } from '~/utils/isDefined';
import { CountryPickerHotkeyScope } from '../types/CountryPickerHotkeyScope';
@@ -31,9 +30,7 @@ const StyledDropdownButtonContainer = styled.div<StyledDropdownButtonProps>`
height: 32px;
padding-left: ${({ theme }) => theme.spacing(2)};
- padding-right: ${({ theme }) => theme.spacing(2)};
-
- padding-right: ${({ theme }) => theme.spacing(2)};
+ padding-right: ${({ theme }) => theme.spacing(1)};
user-select: none;
border-right: 1px solid ${({ theme }) => theme.border.color.light};
@@ -47,13 +44,24 @@ const StyledIconContainer = styled.div`
align-items: center;
color: ${({ theme }) => theme.font.color.tertiary};
display: flex;
- gap: ${({ theme }) => theme.spacing(1)};
+ gap: ${({ theme }) => theme.spacing(0.5)};
justify-content: center;
svg {
align-items: center;
display: flex;
height: 12px;
+ width: 16px;
+ justify-content: center;
+ }
+`;
+
+const StyledCheveronIconContainer = styled.div`
+ svg {
+ align-items: center;
+ display: flex;
+ height: 14px;
+ width: 14px;
justify-content: center;
}
`;
@@ -95,7 +103,9 @@ export const PhoneCountryPickerDropdownButton = ({
<StyledDropdownButtonContainer isUnfolded={isDropdownOpen}>
<StyledIconContainer>
{selectedCountry ? <selectedCountry.Flag /> : <IconWorld />}
- <IconChevronDown size={theme.icon.size.sm} />
+ <StyledCheveronIconContainer>
+ <IconChevronDown size={theme.icon.size.sm} />
+ </StyledCheveronIconContainer>
</StyledIconContainer>
</StyledDropdownButtonContainer>
}
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInput.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInput.tsx
index 034fc4ec05f..98b56e44d6d 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInput.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInput.tsx
@@ -31,14 +31,13 @@ const StyledInput = styled.input<{
const StyledInputContainer = styled.div`
box-sizing: border-box;
- padding: ${({ theme }) => theme.spacing(1)};
position: relative;
width: 100%;
`;
const StyledRightContainer = styled.div`
position: absolute;
- right: ${({ theme }) => theme.spacing(2)};
+ right: ${({ theme }) => theme.spacing(1)};
top: 50%;
transform: translateY(-50%);
`;
diff --git a/packages/twenty-ui/src/input/button/components/LightIconButton.tsx b/packages/twenty-ui/src/input/button/components/LightIconButton.tsx
index 0f5c53c80d5..915ae2b2d90 100644
--- a/packages/twenty-ui/src/input/button/components/LightIconButton.tsx
+++ b/packages/twenty-ui/src/input/button/components/LightIconButton.tsx
@@ -56,7 +56,7 @@ const StyledButton = styled.button<
gap: ${({ theme }) => theme.spacing(1)};
height: ${({ size }) => (size === 'small' ? '24px' : '32px')};
justify-content: center;
- padding: 0;
+ padding: ${({ theme }) => theme.spacing(1)};
transition: background 0.1s ease;
white-space: nowrap;