Add address composite form field (#9022)

- Create FormCountrySelectInput using the existing FormSelectFieldInput
- Create AddressFormFieldInput component
- Fix FormSelectFieldInput dropdown + add leftIcon

<img width="554" alt="Capture d’écran 2024-12-11 à 15 56 32"
src="https://github.com/user-attachments/assets/c3019f29-af76-44e1-96bd-a0c6283674e1"
/>
This commit is contained in:
Thomas Trompette
2024-12-11 17:57:42 +01:00
committed by GitHub
parent 2c4a77a7b7
commit 4d9facb9bd
14 changed files with 312 additions and 65 deletions

View File

@ -1,10 +1,11 @@
import { Tag, ThemeColor } from 'twenty-ui';
import { IconComponent, Tag, ThemeColor } from 'twenty-ui';
type SelectDisplayProps = {
color: ThemeColor;
color: ThemeColor | 'transparent';
label: string;
Icon?: IconComponent;
};
export const SelectDisplay = ({ color, label }: SelectDisplayProps) => {
return <Tag preventShrink color={color} text={label} />;
export const SelectDisplay = ({ color, label, Icon }: SelectDisplayProps) => {
return <Tag preventShrink color={color} text={label} Icon={Icon} />;
};

View File

@ -260,6 +260,7 @@ export const AddressInput = ({
onFocus={getFocusHandler('addressPostcode')}
/>
<CountrySelect
label="COUNTRY"
onChange={getChangeHandler('addressCountry')}
selectedCountryName={internalValue.addressCountry ?? ''}
/>