refactor: move @/ui/display/icon to twenty-ui (#4820)

Split from https://github.com/twentyhq/twenty/pull/4518

Part of https://github.com/twentyhq/twenty/issues/4766
This commit is contained in:
Thaïs
2024-04-12 15:30:48 +02:00
committed by GitHub
parent 280229bad6
commit 9f83cc1426
142 changed files with 289 additions and 289 deletions

View File

@ -176,7 +176,7 @@ A Chip-like element to display information about an entity.
<TabItem value="usage" label="Usage" default>
<SandpackEditor
availableComponentPaths={['@/ui/display/chip/components/EntityChip', '@/ui/display/icon/types/IconComponent']}
availableComponentPaths={['@/ui/display/chip/components/EntityChip', 'twenty-ui']}
componentCode={entityChipCode}
/>
</TabItem >

View File

@ -32,7 +32,7 @@ yarn add @tabler/icons-react
You can import each icon as a component. Here's an example:
<SandpackEditor
availableComponentPaths={['@/ui/display/icon/components/IconAddressBook']}
availableComponentPaths={['twenty-ui']}
componentCode={tablerIconExampleCode}
/>
@ -93,7 +93,7 @@ Displays an address book icon.
<TabItem value="usage" label="Usage" default>
<SandpackEditor
availableComponentPaths={['@/ui/display/icon/components/IconAddressBook']}
availableComponentPaths={['twenty-ui']}
componentCode={iconAddressBookCode}
/>

View File

@ -16,7 +16,7 @@ Allows users to pick a value from a list of predefined options.
<TabItem value="usage" label="Usage" default>
<SandpackEditor
availableComponentPaths={['@/ui/input/components/Select', '@/ui/display/icon/types/IconComponent']}
availableComponentPaths={['@/ui/input/components/Select', 'twenty-ui']}
componentCode={selectCode}
/>

View File

@ -1,6 +1,7 @@
import { BrowserRouter as Router } from "react-router-dom";
import { EntityChip } from "@/ui/display/chip/components/EntityChip";
import { IconComponent } from "@/ui/display/icon/types/IconComponent";
import { BrowserRouter as Router } from 'react-router-dom';
import { IconTwentyStar } from 'twenty-ui';
import { EntityChip } from '@/ui/display/chip/components/EntityChip';
export const MyComponent = () => {
return (
@ -12,7 +13,7 @@ export const MyComponent = () => {
pictureUrl=""
avatarType="rounded"
variant="regular"
LeftIcon={IconComponent}
LeftIcon={IconTwentyStar}
/>
</Router>
);

View File

@ -1,4 +1,4 @@
import { IconAddressBook } from "@/ui/display/icon/components/IconAddressBook";
import { IconAddressBook } from 'twenty-ui';
export const MyComponent = () => {
return <IconAddressBook size={24} stroke={2} />;

View File

@ -1,6 +1,7 @@
import { RecoilRoot } from "recoil";
import { Select } from "@/ui/input/components/Select";
import { IconComponent } from "@/ui/display/icon/types/IconComponent";
import { RecoilRoot } from 'recoil';
import { IconTwentyStar } from 'twenty-ui';
import { Select } from '@/ui/input/components/Select';
export const MyComponent = () => {
const handleSelectChange = (selectedValue) => {
@ -16,8 +17,8 @@ export const MyComponent = () => {
label="Select an option"
onChange={handleSelectChange}
options={[
{ value: "option1", label: "Option A", Icon: IconComponent },
{ value: "option2", label: "Option B", Icon: IconComponent },
{ value: 'option1', label: 'Option A', Icon: IconTwentyStar },
{ value: 'option2', label: 'Option B', Icon: IconTwentyStar },
]}
value="option1"
/>