}
+ Icon={IconPlus}
onClick={handleOpenPicker}
size="small"
accent="tertiary"
diff --git a/front/src/modules/companies/hooks/useCompanyTableActionBarEntries.tsx b/front/src/modules/companies/hooks/useCompanyTableActionBarEntries.tsx
index 197892c33..cbef0d7b8 100644
--- a/front/src/modules/companies/hooks/useCompanyTableActionBarEntries.tsx
+++ b/front/src/modules/companies/hooks/useCompanyTableActionBarEntries.tsx
@@ -25,19 +25,19 @@ export function useCompanyTableActionBarEntries() {
setActionBarEntries([
}
+ Icon={IconNotes}
onClick={() => handleActivityClick(ActivityType.Note)}
key="note"
/>,
}
+ Icon={IconCheckbox}
onClick={() => handleActivityClick(ActivityType.Task)}
key="task"
/>,
}
+ Icon={IconTrash}
type="danger"
onClick={() => deleteSelectedCompanies()}
key="delete"
diff --git a/front/src/modules/favorites/components/Favorites.tsx b/front/src/modules/favorites/components/Favorites.tsx
index a2da7c1b9..b5ea9d257 100644
--- a/front/src/modules/favorites/components/Favorites.tsx
+++ b/front/src/modules/favorites/components/Favorites.tsx
@@ -28,32 +28,28 @@ export function Favorites() {
(
- }
+ )}
to={`/person/${person.id}`}
/>
- )) ||
+ )) ??
(company && (
(
- }
+ )}
to={`/companies/${company.id}`}
/>
)),
diff --git a/front/src/modules/people/components/PeopleCard.tsx b/front/src/modules/people/components/PeopleCard.tsx
index fbb9e36ca..5ecfee447 100644
--- a/front/src/modules/people/components/PeopleCard.tsx
+++ b/front/src/modules/people/components/PeopleCard.tsx
@@ -161,7 +161,7 @@ export function PeopleCard({
}
+ Icon={IconDotsVertical}
/>
{isOptionsOpen && (
diff --git a/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx b/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx
index 243990417..3c71d576d 100644
--- a/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx
+++ b/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx
@@ -64,19 +64,19 @@ export function usePersonTableActionBarEntries() {
setActionBarEntries([
}
+ Icon={IconNotes}
onClick={() => handleActivityClick(ActivityType.Note)}
key="note"
/>,
}
+ Icon={IconCheckbox}
onClick={() => handleActivityClick(ActivityType.Task)}
key="task"
/>,
}
+ Icon={IconTrash}
type="danger"
onClick={handleDeleteClick}
key="delete"
diff --git a/front/src/modules/pipeline/components/PipelineAddButton.tsx b/front/src/modules/pipeline/components/PipelineAddButton.tsx
index 05b55c31b..70d34fe33 100644
--- a/front/src/modules/pipeline/components/PipelineAddButton.tsx
+++ b/front/src/modules/pipeline/components/PipelineAddButton.tsx
@@ -56,7 +56,7 @@ export function PipelineAddButton() {
dropdownKey="add-pipeline-progress"
buttonComponents={
}
+ Icon={IconPlus}
size="medium"
dataTestId="add-company-progress-button"
accent="default"
diff --git a/front/src/modules/settings/components/SettingsNavbar.tsx b/front/src/modules/settings/components/SettingsNavbar.tsx
index 221658a65..d78c7e173 100644
--- a/front/src/modules/settings/components/SettingsNavbar.tsx
+++ b/front/src/modules/settings/components/SettingsNavbar.tsx
@@ -1,6 +1,5 @@
import { useCallback } from 'react';
import { useMatch, useNavigate, useResolvedPath } from 'react-router-dom';
-import { useTheme } from '@emotion/react';
import { useAuth } from '@/auth/hooks/useAuth';
import { AppPath } from '@/types/AppPath';
@@ -16,7 +15,6 @@ import NavTitle from '@/ui/navbar/components/NavTitle';
import SubMenuNavbar from '@/ui/navbar/components/SubMenuNavbar';
export function SettingsNavbar() {
- const theme = useTheme();
const navigate = useNavigate();
const { signOut } = useAuth();
@@ -32,7 +30,7 @@ export function SettingsNavbar() {
}
+ Icon={IconUserCircle}
active={
!!useMatch({
path: useResolvedPath('/settings/profile').pathname,
@@ -43,7 +41,7 @@ export function SettingsNavbar() {
}
+ Icon={IconColorSwatch}
active={
!!useMatch({
path: useResolvedPath('/settings/profile/experience').pathname,
@@ -55,7 +53,7 @@ export function SettingsNavbar() {
}
+ Icon={IconSettings}
active={
!!useMatch({
path: useResolvedPath('/settings/workspace').pathname,
@@ -66,7 +64,7 @@ export function SettingsNavbar() {
}
+ Icon={IconUsers}
active={
!!useMatch({
path: useResolvedPath('/settings/workspace-members').pathname,
@@ -75,11 +73,7 @@ export function SettingsNavbar() {
}
/>
- }
- />
+
);
}
diff --git a/front/src/modules/spreadsheet-import/components/ContinueButton.tsx b/front/src/modules/spreadsheet-import/components/ContinueButton.tsx
index 1d8930356..8d81951ce 100644
--- a/front/src/modules/spreadsheet-import/components/ContinueButton.tsx
+++ b/front/src/modules/spreadsheet-import/components/ContinueButton.tsx
@@ -29,7 +29,7 @@ export const ContinueButton = ({
}: ContinueButtonProps) => (
}
+ Icon={isLoading ? CircularProgressBar : undefined}
title={title}
onClick={!isLoading ? onContinue : undefined}
/>
diff --git a/front/src/modules/spreadsheet-import/components/ModalCloseButton.tsx b/front/src/modules/spreadsheet-import/components/ModalCloseButton.tsx
index fbfac9770..0361390f9 100644
--- a/front/src/modules/spreadsheet-import/components/ModalCloseButton.tsx
+++ b/front/src/modules/spreadsheet-import/components/ModalCloseButton.tsx
@@ -52,7 +52,7 @@ export const ModalCloseButton = ({ onClose }: ModalCloseButtonProps) => {
return (
- } onClick={handleClose} />
+
);
};
diff --git a/front/src/modules/spreadsheet-import/steps/components/ValidationStep/ValidationStep.tsx b/front/src/modules/spreadsheet-import/steps/components/ValidationStep/ValidationStep.tsx
index 3ffbbb70a..67c688de4 100644
--- a/front/src/modules/spreadsheet-import/steps/components/ValidationStep/ValidationStep.tsx
+++ b/front/src/modules/spreadsheet-import/steps/components/ValidationStep/ValidationStep.tsx
@@ -205,7 +205,7 @@ export const ValidationStep = ({
}
+ Icon={IconTrash}
title="Remove"
accent="danger"
onClick={deleteSelectedRows}
diff --git a/front/src/modules/ui/action-bar/components/ActionBarEntry.tsx b/front/src/modules/ui/action-bar/components/ActionBarEntry.tsx
index f9650f7b5..6236b52cd 100644
--- a/front/src/modules/ui/action-bar/components/ActionBarEntry.tsx
+++ b/front/src/modules/ui/action-bar/components/ActionBarEntry.tsx
@@ -1,8 +1,10 @@
-import { ReactNode } from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
+
type OwnProps = {
- icon: ReactNode;
+ Icon: IconComponent;
label: string;
type?: 'standard' | 'danger';
onClick: () => void;
@@ -39,13 +41,14 @@ const StyledButtonLabel = styled.div`
export function ActionBarEntry({
label,
- icon,
+ Icon,
type = 'standard',
onClick,
}: OwnProps) {
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
{label}
);
diff --git a/front/src/modules/ui/board/hooks/useBoardActionBarEntries.tsx b/front/src/modules/ui/board/hooks/useBoardActionBarEntries.tsx
index b0f27784f..671e0c28a 100644
--- a/front/src/modules/ui/board/hooks/useBoardActionBarEntries.tsx
+++ b/front/src/modules/ui/board/hooks/useBoardActionBarEntries.tsx
@@ -16,7 +16,7 @@ export function useBoardActionBarEntries() {
setActionBarEntries([
}
+ Icon={IconTrash}
type="danger"
onClick={deleteSelectedBoardCards}
key="delete"
diff --git a/front/src/modules/ui/button/components/Button.tsx b/front/src/modules/ui/button/components/Button.tsx
index 622750275..3dc0b498c 100644
--- a/front/src/modules/ui/button/components/Button.tsx
+++ b/front/src/modules/ui/button/components/Button.tsx
@@ -1,7 +1,8 @@
-import React, { useMemo } from 'react';
+import React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { TablerIconsProps } from '@/ui/icon';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { SoonPill } from '@/ui/pill/components/SoonPill';
export type ButtonSize = 'medium' | 'small';
@@ -11,7 +12,7 @@ export type ButtonAccent = 'default' | 'blue' | 'danger';
export type ButtonProps = {
className?: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
title?: string;
fullWidth?: boolean;
variant?: ButtonVariant;
@@ -278,7 +279,7 @@ const StyledButton = styled.button<
export function Button({
className,
- icon: initialIcon,
+ Icon,
title,
fullWidth = false,
variant = 'primary',
@@ -290,15 +291,7 @@ export function Button({
focus = false,
onClick,
}: ButtonProps) {
- const icon = useMemo(() => {
- if (!initialIcon || !React.isValidElement(initialIcon)) {
- return null;
- }
-
- return React.cloneElement(initialIcon as any, {
- size: 14,
- });
- }, [initialIcon]);
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
{title}
{soon && }
diff --git a/front/src/modules/ui/button/components/FloatingButton.tsx b/front/src/modules/ui/button/components/FloatingButton.tsx
index 0d0c3a456..f93ee9565 100644
--- a/front/src/modules/ui/button/components/FloatingButton.tsx
+++ b/front/src/modules/ui/button/components/FloatingButton.tsx
@@ -1,14 +1,15 @@
-import React, { useMemo } from 'react';
+import React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { TablerIconsProps } from '@/ui/icon';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
export type FloatingButtonSize = 'small' | 'medium';
export type FloatingButtonPosition = 'standalone' | 'left' | 'middle' | 'right';
export type FloatingButtonProps = {
className?: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
title?: string;
size?: FloatingButtonSize;
position?: FloatingButtonPosition;
@@ -80,7 +81,7 @@ const StyledButton = styled.button<
export function FloatingButton({
className,
- icon: initialIcon,
+ Icon,
title,
size = 'small',
applyBlur = true,
@@ -88,16 +89,7 @@ export function FloatingButton({
disabled = false,
focus = false,
}: FloatingButtonProps) {
- const icon = useMemo(() => {
- if (!initialIcon || !React.isValidElement(initialIcon)) {
- return null;
- }
-
- return React.cloneElement(initialIcon as any, {
- size: 14,
- });
- }, [initialIcon]);
-
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
{title}
);
diff --git a/front/src/modules/ui/button/components/FloatingIconButton.tsx b/front/src/modules/ui/button/components/FloatingIconButton.tsx
index 74a299f4f..6307cf56d 100644
--- a/front/src/modules/ui/button/components/FloatingIconButton.tsx
+++ b/front/src/modules/ui/button/components/FloatingIconButton.tsx
@@ -1,7 +1,8 @@
-import React, { useMemo } from 'react';
+import React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { TablerIconsProps } from '@/ui/icon';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
export type FloatingIconButtonSize = 'small' | 'medium';
export type FloatingIconButtonPosition =
@@ -12,7 +13,7 @@ export type FloatingIconButtonPosition =
export type FloatingIconButtonProps = {
className?: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
size?: FloatingIconButtonSize;
position?: FloatingIconButtonPosition;
applyShadow?: boolean;
@@ -100,7 +101,7 @@ const StyledButton = styled.button<
export function FloatingIconButton({
className,
- icon: initialIcon,
+ Icon,
size = 'small',
position = 'standalone',
applyShadow = true,
@@ -109,16 +110,7 @@ export function FloatingIconButton({
focus = false,
onClick,
}: FloatingIconButtonProps) {
- const icon = useMemo(() => {
- if (!initialIcon || !React.isValidElement(initialIcon)) {
- return null;
- }
-
- return React.cloneElement(initialIcon as any, {
- size: 16,
- });
- }, [initialIcon]);
-
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
);
}
diff --git a/front/src/modules/ui/button/components/FloatingIconButtonGroup.tsx b/front/src/modules/ui/button/components/FloatingIconButtonGroup.tsx
index e5206543b..32191626c 100644
--- a/front/src/modules/ui/button/components/FloatingIconButtonGroup.tsx
+++ b/front/src/modules/ui/button/components/FloatingIconButtonGroup.tsx
@@ -1,5 +1,4 @@
import type { MouseEvent } from 'react';
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import type { IconComponent } from '@/ui/icon/types/IconComponent';
@@ -34,8 +33,6 @@ export function FloatingIconButtonGroup({
iconButtons,
size,
}: FloatingIconButtonGroupProps) {
- const theme = useTheme();
-
return (
{iconButtons.map(({ Icon, onClick }, index) => {
@@ -50,7 +47,7 @@ export function FloatingIconButtonGroup({
}
+ Icon={Icon}
onClick={onClick}
position={position}
size={size}
diff --git a/front/src/modules/ui/button/components/IconButton.tsx b/front/src/modules/ui/button/components/IconButton.tsx
index 8ad091fc1..b266a7e6d 100644
--- a/front/src/modules/ui/button/components/IconButton.tsx
+++ b/front/src/modules/ui/button/components/IconButton.tsx
@@ -1,7 +1,8 @@
-import React, { useMemo } from 'react';
+import React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { TablerIconsProps } from '@/ui/icon';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
export type IconButtonSize = 'medium' | 'small';
export type IconButtonPosition = 'standalone' | 'left' | 'middle' | 'right';
@@ -10,7 +11,7 @@ export type IconButtonAccent = 'default' | 'blue' | 'danger';
export type IconButtonProps = {
className?: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
variant?: IconButtonVariant;
size?: IconButtonSize;
position?: IconButtonPosition;
@@ -270,7 +271,7 @@ const StyledButton = styled.button<
export function IconButton({
className,
- icon: initialIcon,
+ Icon,
variant = 'primary',
size = 'medium',
accent = 'default',
@@ -280,16 +281,7 @@ export function IconButton({
dataTestId,
onClick,
}: IconButtonProps) {
- const icon = useMemo(() => {
- if (!initialIcon || !React.isValidElement(initialIcon)) {
- return <>>;
- }
-
- return React.cloneElement(initialIcon as any, {
- size: 16,
- });
- }, [initialIcon]);
-
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
);
}
diff --git a/front/src/modules/ui/button/components/IconButtonGroup.tsx b/front/src/modules/ui/button/components/IconButtonGroup.tsx
index 0b31439f3..32f6ad415 100644
--- a/front/src/modules/ui/button/components/IconButtonGroup.tsx
+++ b/front/src/modules/ui/button/components/IconButtonGroup.tsx
@@ -1,11 +1,13 @@
import type { MouseEvent } from 'react';
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import type { IconComponent } from '@/ui/icon/types/IconComponent';
-import { Button } from './Button';
-import { IconButtonPosition, type IconButtonProps } from './IconButton';
+import {
+ IconButton,
+ IconButtonPosition,
+ type IconButtonProps,
+} from './IconButton';
const StyledIconButtonGroupContainer = styled.div`
border-radius: ${({ theme }) => theme.border.radius.md};
@@ -28,8 +30,6 @@ export function IconButtonGroup({
size,
variant,
}: IconButtonGroupProps) {
- const theme = useTheme();
-
return (
{iconButtons.map(({ Icon, onClick }, index) => {
@@ -41,9 +41,9 @@ export function IconButtonGroup({
: 'middle';
return (
- }
+ Icon={Icon}
onClick={onClick}
position={position}
size={size}
diff --git a/front/src/modules/ui/button/components/LightIconButton.tsx b/front/src/modules/ui/button/components/LightIconButton.tsx
index ac277b8bb..88195b247 100644
--- a/front/src/modules/ui/button/components/LightIconButton.tsx
+++ b/front/src/modules/ui/button/components/LightIconButton.tsx
@@ -1,14 +1,15 @@
-import React, { MouseEvent, useMemo } from 'react';
+import React, { MouseEvent } from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { TablerIconsProps } from '@/ui/icon';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
export type LightIconButtonAccent = 'secondary' | 'tertiary';
export type LightIconButtonSize = 'small' | 'medium';
export type LightIconButtonProps = {
className?: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
title?: string;
size?: LightIconButtonSize;
accent?: LightIconButtonAccent;
@@ -79,7 +80,7 @@ const StyledButton = styled.button<
export function LightIconButton({
className,
- icon: initialIcon,
+ Icon,
active = false,
size = 'small',
accent = 'secondary',
@@ -87,16 +88,7 @@ export function LightIconButton({
focus = false,
onClick,
}: LightIconButtonProps) {
- const icon = useMemo(() => {
- if (!initialIcon || !React.isValidElement(initialIcon)) {
- return null;
- }
-
- return React.cloneElement(initialIcon as any, {
- size: 16,
- });
- }, [initialIcon]);
-
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
);
}
diff --git a/front/src/modules/ui/button/components/MainButton.tsx b/front/src/modules/ui/button/components/MainButton.tsx
index a15fb08e5..063d1c9a8 100644
--- a/front/src/modules/ui/button/components/MainButton.tsx
+++ b/front/src/modules/ui/button/components/MainButton.tsx
@@ -1,10 +1,12 @@
import React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
+
type Variant = 'primary' | 'secondary';
type Props = {
- icon?: React.ReactNode;
title: string;
fullWidth?: boolean;
variant?: Variant;
@@ -85,16 +87,21 @@ const StyledButton = styled.button>`
}};
`;
+type MainButtonProps = Props & {
+ Icon?: IconComponent;
+};
+
export function MainButton({
- icon,
+ Icon,
title,
fullWidth = false,
variant = 'primary',
...props
-}: Props) {
+}: MainButtonProps) {
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
{title}
);
diff --git a/front/src/modules/ui/button/components/RoundedIconButton.tsx b/front/src/modules/ui/button/components/RoundedIconButton.tsx
index 6409daa1d..afd5546f2 100644
--- a/front/src/modules/ui/button/components/RoundedIconButton.tsx
+++ b/front/src/modules/ui/button/components/RoundedIconButton.tsx
@@ -1,5 +1,8 @@
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
+
const StyledIconButton = styled.button`
align-items: center;
background: ${({ theme }) => theme.color.blue};
@@ -26,9 +29,16 @@ const StyledIconButton = styled.button`
width: 20px;
`;
-export function RoundedIconButton({
- icon,
- ...props
-}: { icon: React.ReactNode } & React.ButtonHTMLAttributes) {
- return {icon};
+type RoundedIconButtonProps = {
+ Icon: IconComponent;
+} & React.ButtonHTMLAttributes;
+
+export function RoundedIconButton({ Icon, ...props }: RoundedIconButtonProps) {
+ const theme = useTheme();
+
+ return (
+
+ {}
+
+ );
}
diff --git a/front/src/modules/ui/button/components/__stories__/Button.stories.tsx b/front/src/modules/ui/button/components/__stories__/Button.stories.tsx
index 4a3094a20..2828171d4 100644
--- a/front/src/modules/ui/button/components/__stories__/Button.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/Button.stories.tsx
@@ -31,14 +31,14 @@ export const Default: Story = {
fullWidth: false,
soon: false,
position: 'standalone',
- icon: ,
+ Icon: IconSearch,
className: '',
},
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
- args: { title: 'Filter', icon: },
+ args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
variant: { control: false },
@@ -110,7 +110,7 @@ export const Catalog: Story = {
};
export const SoonCatalog: Story = {
- args: { title: 'Filter', icon: , soon: true },
+ args: { title: 'Filter', Icon: IconSearch, soon: true },
argTypes: {
size: { control: false },
variant: { control: false },
@@ -182,7 +182,7 @@ export const SoonCatalog: Story = {
};
export const PositionCatalog: Story = {
- args: { title: 'Filter', icon: },
+ args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
variant: { control: false },
@@ -258,7 +258,7 @@ export const PositionCatalog: Story = {
};
export const FullWidth: Story = {
- args: { title: 'Filter', icon: , fullWidth: true },
+ args: { title: 'Filter', Icon: IconSearch, fullWidth: true },
argTypes: {
size: { control: false },
variant: { control: false },
@@ -269,7 +269,7 @@ export const FullWidth: Story = {
soon: { control: false },
position: { control: false },
className: { control: false },
- icon: { control: false },
+ Icon: { control: false },
},
decorators: [ComponentDecorator],
};
diff --git a/front/src/modules/ui/button/components/__stories__/ButtonGroup.stories.tsx b/front/src/modules/ui/button/components/__stories__/ButtonGroup.stories.tsx
index 7bae23f01..0caa50ed2 100644
--- a/front/src/modules/ui/button/components/__stories__/ButtonGroup.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/ButtonGroup.stories.tsx
@@ -21,9 +21,9 @@ export const Default: Story = {
variant: 'primary',
accent: 'danger',
children: [
- } title="Note" />,
- } title="Task" />,
- } title="Activity" />,
+ ,
+ ,
+ ,
],
},
argTypes: {
@@ -35,9 +35,9 @@ export const Default: Story = {
export const Catalog: Story = {
args: {
children: [
- } title="Note" />,
- } title="Task" />,
- } title="Activity" />,
+ ,
+ ,
+ ,
],
},
argTypes: {
diff --git a/front/src/modules/ui/button/components/__stories__/FloatingButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/FloatingButton.stories.tsx
index e0bc0b34a..993dad454 100644
--- a/front/src/modules/ui/button/components/__stories__/FloatingButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/FloatingButton.stories.tsx
@@ -23,16 +23,16 @@ export const Default: Story = {
applyBlur: true,
applyShadow: true,
position: 'standalone',
- icon: ,
+ Icon: IconSearch,
},
argTypes: {
- icon: { control: false },
+ Icon: { control: false },
},
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
- args: { title: 'Filter', icon: },
+ args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
disabled: { control: false },
diff --git a/front/src/modules/ui/button/components/__stories__/FloatingButtonGroup.stories.tsx b/front/src/modules/ui/button/components/__stories__/FloatingButtonGroup.stories.tsx
index cb2f639a9..6dd6fc7d9 100644
--- a/front/src/modules/ui/button/components/__stories__/FloatingButtonGroup.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/FloatingButtonGroup.stories.tsx
@@ -19,9 +19,9 @@ export const Default: Story = {
args: {
size: 'small',
children: [
- } />,
- } />,
- } />,
+ ,
+ ,
+ ,
],
},
argTypes: {
@@ -33,9 +33,9 @@ export const Default: Story = {
export const Catalog: Story = {
args: {
children: [
- } />,
- } />,
- } />,
+ ,
+ ,
+ ,
],
},
argTypes: {
diff --git a/front/src/modules/ui/button/components/__stories__/FloatingIconButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/FloatingIconButton.stories.tsx
index d22ad7968..a8074b465 100644
--- a/front/src/modules/ui/button/components/__stories__/FloatingIconButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/FloatingIconButton.stories.tsx
@@ -25,16 +25,16 @@ export const Default: Story = {
applyBlur: true,
applyShadow: true,
position: 'standalone',
- icon: ,
+ Icon: IconSearch,
},
argTypes: {
- icon: { control: false },
+ Icon: { control: false },
},
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
- args: { icon: },
+ args: { Icon: IconSearch },
argTypes: {
size: { control: false },
disabled: { control: false },
diff --git a/front/src/modules/ui/button/components/__stories__/IconButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/IconButton.stories.tsx
index 27c9b6db9..b9179af35 100644
--- a/front/src/modules/ui/button/components/__stories__/IconButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/IconButton.stories.tsx
@@ -28,20 +28,20 @@ export const Default: Story = {
disabled: false,
focus: false,
position: 'standalone',
- icon: ,
+ Icon: IconSearch,
},
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
- args: { icon: },
+ args: { Icon: IconSearch },
argTypes: {
size: { control: false },
variant: { control: false },
focus: { control: false },
accent: { control: false },
disabled: { control: false },
- icon: { control: false },
+ Icon: { control: false },
position: { control: false },
},
parameters: {
@@ -104,7 +104,7 @@ export const Catalog: Story = {
};
export const PositionCatalog: Story = {
- args: { icon: },
+ args: { Icon: IconSearch },
argTypes: {
size: { control: false },
variant: { control: false },
@@ -112,7 +112,7 @@ export const PositionCatalog: Story = {
accent: { control: false },
disabled: { control: false },
position: { control: false },
- icon: { control: false },
+ Icon: { control: false },
},
parameters: {
pseudo: { hover: ['.hover'], active: ['.pressed'] },
diff --git a/front/src/modules/ui/button/components/__stories__/LightIconButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/LightIconButton.stories.tsx
index faacf6702..17b7a6761 100644
--- a/front/src/modules/ui/button/components/__stories__/LightIconButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/LightIconButton.stories.tsx
@@ -25,16 +25,16 @@ export const Default: Story = {
disabled: false,
active: false,
focus: false,
- icon: ,
+ Icon: IconSearch,
},
argTypes: {
- icon: { control: false },
+ Icon: { control: false },
},
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
- args: { title: 'Filter', icon: },
+ args: { title: 'Filter', Icon: IconSearch },
argTypes: {
accent: { control: false },
disabled: { control: false },
diff --git a/front/src/modules/ui/button/components/__stories__/MainButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/MainButton.stories.tsx
index b5470a6bd..aef317001 100644
--- a/front/src/modules/ui/button/components/__stories__/MainButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/MainButton.stories.tsx
@@ -13,15 +13,6 @@ const meta: Meta = {
title: 'UI/Button/MainButton',
component: MainButton,
decorators: [ComponentDecorator],
- argTypes: {
- icon: {
- type: 'boolean',
- mapping: {
- true: ,
- false: undefined,
- },
- },
- },
args: { title: 'A primary Button', onClick: clickJestFn },
};
@@ -41,7 +32,7 @@ export const Default: Story = {
};
export const WithIcon: Story = {
- args: { icon: true },
+ args: { Icon: IconBrandGoogle },
};
export const DisabledWithIcon: Story = {
diff --git a/front/src/modules/ui/button/components/__stories__/RoundedIconButton.stories.tsx b/front/src/modules/ui/button/components/__stories__/RoundedIconButton.stories.tsx
index dd2da875c..dbcbb8507 100644
--- a/front/src/modules/ui/button/components/__stories__/RoundedIconButton.stories.tsx
+++ b/front/src/modules/ui/button/components/__stories__/RoundedIconButton.stories.tsx
@@ -19,8 +19,8 @@ type Story = StoryObj;
export const Default: Story = {
decorators: [ComponentDecorator],
- argTypes: { icon: { control: false } },
- args: { onClick: clickJestFn, icon: },
+ argTypes: { Icon: { control: false } },
+ args: { onClick: clickJestFn, Icon: IconArrowRight },
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
diff --git a/front/src/modules/ui/editable-field/components/EditableFieldEditButton.tsx b/front/src/modules/ui/editable-field/components/EditableFieldEditButton.tsx
index 835461285..8a63a2faa 100644
--- a/front/src/modules/ui/editable-field/components/EditableFieldEditButton.tsx
+++ b/front/src/modules/ui/editable-field/components/EditableFieldEditButton.tsx
@@ -14,7 +14,7 @@ export function EditableFieldEditButton() {
}
+ Icon={IconPencil}
data-testid="editable-field-edit-mode-container"
/>
);
diff --git a/front/src/modules/ui/input/autosize-text/components/AutosizeTextInput.tsx b/front/src/modules/ui/input/autosize-text/components/AutosizeTextInput.tsx
index 8a7b04ca7..30fc71c39 100644
--- a/front/src/modules/ui/input/autosize-text/components/AutosizeTextInput.tsx
+++ b/front/src/modules/ui/input/autosize-text/components/AutosizeTextInput.tsx
@@ -198,7 +198,7 @@ export function AutosizeTextInput({
}
+ Icon={IconArrowRight}
disabled={isSendButtonDisabled}
/>
diff --git a/front/src/modules/ui/input/image/components/ImageInput.tsx b/front/src/modules/ui/input/image/components/ImageInput.tsx
index 003c88a45..499ecd66e 100644
--- a/front/src/modules/ui/input/image/components/ImageInput.tsx
+++ b/front/src/modules/ui/input/image/components/ImageInput.tsx
@@ -135,7 +135,7 @@ export function ImageInput({
/>
{isUploading && onAbort ? (
}
+ Icon={IconX}
onClick={onAbort}
variant="secondary"
title="Abort"
@@ -144,7 +144,7 @@ export function ImageInput({
/>
) : (
}
+ Icon={IconUpload}
onClick={onUploadButtonClick}
variant="secondary"
title="Upload"
@@ -153,7 +153,7 @@ export function ImageInput({
/>
)}
}
+ Icon={IconTrash}
onClick={onRemove}
variant="secondary"
title="Remove"
diff --git a/front/src/modules/ui/layout/components/PageAddButton.tsx b/front/src/modules/ui/layout/components/PageAddButton.tsx
index 80e093675..9781b63af 100644
--- a/front/src/modules/ui/layout/components/PageAddButton.tsx
+++ b/front/src/modules/ui/layout/components/PageAddButton.tsx
@@ -8,7 +8,7 @@ type OwnProps = {
export function PageAddButton({ onClick }: OwnProps) {
return (
}
+ Icon={IconPlus}
size="medium"
variant="secondary"
data-testid="add-button"
diff --git a/front/src/modules/ui/layout/components/PageFavoriteButton.tsx b/front/src/modules/ui/layout/components/PageFavoriteButton.tsx
index ac9a4b203..e31414874 100644
--- a/front/src/modules/ui/layout/components/PageFavoriteButton.tsx
+++ b/front/src/modules/ui/layout/components/PageFavoriteButton.tsx
@@ -9,7 +9,7 @@ type OwnProps = {
export function PageFavoriteButton({ isFavorite, onClick }: OwnProps) {
return (
}
+ Icon={IconHeart}
size="medium"
variant="secondary"
data-testid="add-button"
diff --git a/front/src/modules/ui/layout/components/PageHeader.tsx b/front/src/modules/ui/layout/components/PageHeader.tsx
index 93689463d..63bef4e5d 100644
--- a/front/src/modules/ui/layout/components/PageHeader.tsx
+++ b/front/src/modules/ui/layout/components/PageHeader.tsx
@@ -1,12 +1,13 @@
-import { type ComponentProps, type ReactNode, useCallback } from 'react';
+import { type ComponentProps, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
-import { IconButton } from '@/ui/button/components/IconButton';
+import { IconButton, IconButtonSize } from '@/ui/button/components/IconButton';
import { IconChevronLeft } from '@/ui/icon/index';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import NavCollapseButton from '@/ui/navbar/components/NavCollapseButton';
-import { navbarIconSize } from '@/ui/navbar/constants';
import { OverflowingTextWithTooltip } from '@/ui/tooltip/OverflowingTextWithTooltip';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
@@ -63,28 +64,27 @@ const StyledPageActionContainer = styled.div`
gap: ${({ theme }) => theme.spacing(2)};
`;
-type OwnProps = ComponentProps<'div'> & {
+type PageHeaderProps = ComponentProps<'div'> & {
title: string;
hasBackButton?: boolean;
- icon: ReactNode;
+ Icon: IconComponent;
children?: JSX.Element | JSX.Element[];
};
export function PageHeader({
title,
hasBackButton,
- icon,
+ Icon,
children,
...props
-}: OwnProps) {
+}: PageHeaderProps) {
const navigate = useNavigate();
const navigateBack = useCallback(() => navigate(-1), [navigate]);
const isNavbarOpened = useRecoilValue(isNavbarOpenedState);
- const iconSize = useIsMobile()
- ? navbarIconSize.mobile
- : navbarIconSize.desktop;
+ const iconSize: IconButtonSize = useIsMobile() ? 'small' : 'medium';
+ const theme = useTheme();
return (
@@ -97,14 +97,15 @@ export function PageHeader({
{hasBackButton && (
}
+ Icon={IconChevronLeft}
+ size={iconSize}
onClick={navigateBack}
variant="tertiary"
/>
)}
- {icon}
+ {Icon && }
diff --git a/front/src/modules/ui/layout/components/SubMenuTopBarContainer.tsx b/front/src/modules/ui/layout/components/SubMenuTopBarContainer.tsx
index 701b3f4ee..2fae00673 100644
--- a/front/src/modules/ui/layout/components/SubMenuTopBarContainer.tsx
+++ b/front/src/modules/ui/layout/components/SubMenuTopBarContainer.tsx
@@ -1,14 +1,16 @@
+import { JSX } from 'react';
import styled from '@emotion/styled';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { PageHeader } from './PageHeader';
import { RightDrawerContainer } from './RightDrawerContainer';
-type OwnProps = {
+type SubMenuTopBarContainerProps = {
children: JSX.Element | JSX.Element[];
title: string;
- icon: React.ReactNode;
+ Icon: IconComponent;
};
const StyledContainer = styled.div<{ isMobile: boolean }>`
@@ -18,12 +20,16 @@ const StyledContainer = styled.div<{ isMobile: boolean }>`
width: 100%;
`;
-export function SubMenuTopBarContainer({ children, title, icon }: OwnProps) {
+export function SubMenuTopBarContainer({
+ children,
+ title,
+ Icon,
+}: SubMenuTopBarContainerProps) {
const isMobile = useIsMobile();
return (
- {isMobile && }
+ {isMobile && }
{children}
);
diff --git a/front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx b/front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx
index 225063248..7529e389d 100644
--- a/front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx
+++ b/front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx
@@ -37,7 +37,7 @@ export function ShowPageAddButton({
dropdownKey="add-show-page"
buttonComponents={
}
+ Icon={IconPlus}
size="medium"
dataTestId="add-showpage-button"
accent="default"
diff --git a/front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx b/front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
index d32b451e8..815d38fee 100644
--- a/front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
+++ b/front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
@@ -1,4 +1,3 @@
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { Notes } from '@/activities/notes/components/Notes';
@@ -53,31 +52,29 @@ export function ShowPageRightContainer({
notes,
emails,
}: OwnProps) {
- const theme = useTheme();
-
const TASK_TABS = [
{
id: 'timeline',
title: 'Timeline',
- icon: ,
+ Icon: IconTimelineEvent,
hide: !timeline,
},
{
id: 'tasks',
title: 'Tasks',
- icon: ,
+ Icon: IconCheckbox,
hide: !tasks,
},
{
id: 'notes',
title: 'Notes',
- icon: ,
+ Icon: IconNotes,
hide: !notes,
},
{
id: 'emails',
title: 'Emails',
- icon: ,
+ Icon: IconMail,
hide: !emails,
disabled: true,
},
diff --git a/front/src/modules/ui/menu-item/components/MenuItemCommand.tsx b/front/src/modules/ui/menu-item/components/MenuItemCommand.tsx
index ce925b9a5..1373c6404 100644
--- a/front/src/modules/ui/menu-item/components/MenuItemCommand.tsx
+++ b/front/src/modules/ui/menu-item/components/MenuItemCommand.tsx
@@ -40,7 +40,7 @@ export type MenuItemProps = {
LeftIcon?: IconComponent;
text: string;
command: string;
- className: string;
+ className?: string;
onClick?: () => void;
};
diff --git a/front/src/modules/ui/navbar/components/NavCollapseButton.tsx b/front/src/modules/ui/navbar/components/NavCollapseButton.tsx
index 07dfa0596..ecf8c1202 100644
--- a/front/src/modules/ui/navbar/components/NavCollapseButton.tsx
+++ b/front/src/modules/ui/navbar/components/NavCollapseButton.tsx
@@ -1,6 +1,7 @@
import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
+import { IconButton } from '@/ui/button/components/IconButton';
import {
IconLayoutSidebarLeftCollapse,
IconLayoutSidebarRightCollapse,
@@ -8,8 +9,6 @@ import {
import { isNavbarOpenedState } from '@/ui/layout/states/isNavbarOpenedState';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
-import { navbarIconSize } from '../constants';
-
const StyledCollapseButton = styled.button<{
hide: boolean;
}>`
@@ -57,9 +56,7 @@ export default function NavCollapseButton({
const [isNavbarOpened, setIsNavbarOpened] =
useRecoilState(isNavbarOpenedState);
- const iconSize = useIsMobile()
- ? navbarIconSize.mobile
- : navbarIconSize.desktop;
+ const iconSize = useIsMobile() ? 'small' : 'medium';
return (
<>
@@ -68,14 +65,22 @@ export default function NavCollapseButton({
hide={hide}
onClick={() => setIsNavbarOpened(!isNavbarOpened)}
>
-
+
) : (
setIsNavbarOpened(!isNavbarOpened)}
>
-
+
)}
>
diff --git a/front/src/modules/ui/navbar/components/NavItem.tsx b/front/src/modules/ui/navbar/components/NavItem.tsx
index d87abff4b..7c1706965 100644
--- a/front/src/modules/ui/navbar/components/NavItem.tsx
+++ b/front/src/modules/ui/navbar/components/NavItem.tsx
@@ -1,19 +1,20 @@
-import { ReactNode } from 'react';
import { useNavigate } from 'react-router-dom';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/theme';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { isNavbarOpenedState } from '../../layout/states/isNavbarOpenedState';
-type OwnProps = {
+type NavItemProps = {
label: string;
to?: string;
onClick?: () => void;
+ Icon: IconComponent;
active?: boolean;
- icon: ReactNode;
danger?: boolean;
soon?: boolean;
};
@@ -81,7 +82,16 @@ const StyledSoonPill = styled.div`
padding-right: ${({ theme }) => theme.spacing(2)};
`;
-function NavItem({ label, icon, to, onClick, active, danger, soon }: OwnProps) {
+function NavItem({
+ label,
+ Icon,
+ to,
+ onClick,
+ active,
+ danger,
+ soon,
+}: NavItemProps) {
+ const theme = useTheme();
const navigate = useNavigate();
const [, setIsNavbarOpened] = useRecoilState(isNavbarOpenedState);
@@ -107,7 +117,7 @@ function NavItem({ label, icon, to, onClick, active, danger, soon }: OwnProps) {
danger={danger}
soon={soon}
>
- {icon}
+ {Icon && }
{label}
{soon && Soon}
diff --git a/front/src/modules/ui/navbar/components/SupportChat.tsx b/front/src/modules/ui/navbar/components/SupportChat.tsx
index 4e7053b59..db08d6c80 100644
--- a/front/src/modules/ui/navbar/components/SupportChat.tsx
+++ b/front/src/modules/ui/navbar/components/SupportChat.tsx
@@ -1,5 +1,4 @@
import { useCallback, useEffect, useState } from 'react';
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
@@ -30,7 +29,6 @@ function insertScript({
}
export default function SupportChat() {
- const theme = useTheme();
const currentUser = useRecoilValue(currentUserState);
const supportChat = useRecoilValue(supportChatState);
const [isFrontChatLoaded, setIsFrontChatLoaded] = useState(false);
@@ -85,7 +83,7 @@ export default function SupportChat() {
variant={'tertiary'}
size={'small'}
title="Support"
- icon={}
+ Icon={IconHelpCircle}
onClick={() => window.FrontChat?.('show')}
/>
diff --git a/front/src/modules/ui/navbar/constants/index.ts b/front/src/modules/ui/navbar/constants/index.ts
index eb7ae04d2..664eac8de 100644
--- a/front/src/modules/ui/navbar/constants/index.ts
+++ b/front/src/modules/ui/navbar/constants/index.ts
@@ -8,9 +8,4 @@ export const leftSubMenuNavbarWidth = {
desktop: '520px',
};
-export const navbarIconSize = {
- mobile: 18,
- desktop: 16,
-};
-
export const githubLink = 'https://github.com/twentyhq/twenty';
diff --git a/front/src/modules/ui/right-drawer/components/RightDrawerTopBarCloseButton.tsx b/front/src/modules/ui/right-drawer/components/RightDrawerTopBarCloseButton.tsx
index 5d5e06a24..5b3c025c1 100644
--- a/front/src/modules/ui/right-drawer/components/RightDrawerTopBarCloseButton.tsx
+++ b/front/src/modules/ui/right-drawer/components/RightDrawerTopBarCloseButton.tsx
@@ -12,7 +12,7 @@ export function RightDrawerTopBarCloseButton() {
return (
}
+ Icon={IconChevronsRight}
onClick={handleButtonClick}
size="medium"
accent="tertiary"
diff --git a/front/src/modules/ui/right-drawer/components/RightDrawerTopBarExpandButton.tsx b/front/src/modules/ui/right-drawer/components/RightDrawerTopBarExpandButton.tsx
index 52de52bd8..5ed680382 100644
--- a/front/src/modules/ui/right-drawer/components/RightDrawerTopBarExpandButton.tsx
+++ b/front/src/modules/ui/right-drawer/components/RightDrawerTopBarExpandButton.tsx
@@ -21,12 +21,10 @@ export function RightDrawerTopBarExpandButton() {
- ) : (
-
- )
+ Icon={
+ isRightDrawerExpanded
+ ? IconLayoutSidebarRightCollapse
+ : IconLayoutSidebarRightExpand
}
onClick={handleButtonClick}
/>
diff --git a/front/src/modules/ui/tab/components/Tab.tsx b/front/src/modules/ui/tab/components/Tab.tsx
index 44e9c19c5..97e42de88 100644
--- a/front/src/modules/ui/tab/components/Tab.tsx
+++ b/front/src/modules/ui/tab/components/Tab.tsx
@@ -1,10 +1,13 @@
import * as React from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-type OwnProps = {
+import { IconComponent } from '@/ui/icon/types/IconComponent';
+
+type TabProps = {
id: string;
title: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
active?: boolean;
className?: string;
onClick?: () => void;
@@ -47,12 +50,13 @@ const StyledHover = styled.span`
export function Tab({
id,
title,
- icon,
+ Icon,
active = false,
onClick,
className,
disabled,
-}: OwnProps) {
+}: TabProps) {
+ const theme = useTheme();
return (
- {icon}
+ {Icon && }
{title}
diff --git a/front/src/modules/ui/tab/components/TabList.tsx b/front/src/modules/ui/tab/components/TabList.tsx
index 0da1a98f9..0db6338b7 100644
--- a/front/src/modules/ui/tab/components/TabList.tsx
+++ b/front/src/modules/ui/tab/components/TabList.tsx
@@ -1,5 +1,6 @@
import * as React from 'react';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
import { activeTabIdScopedState } from '../states/activeTabIdScopedState';
@@ -8,18 +9,18 @@ import { Tab } from './Tab';
type SingleTabProps = {
title: string;
- icon?: React.ReactNode;
+ Icon?: IconComponent;
id: string;
hide?: boolean;
disabled?: boolean;
};
-type OwnProps = {
+type TabListProps = {
tabs: SingleTabProps[];
context: React.Context;
};
-export function TabList({ tabs, context }: OwnProps) {
+export function TabList({ tabs, context }: TabListProps) {
const initialActiveTabId = tabs[0].id;
const [activeTabId, setActiveTabId] = useRecoilScopedState(
@@ -40,7 +41,7 @@ export function TabList({ tabs, context }: OwnProps) {
id={tab.id}
key={tab.id}
title={tab.title}
- icon={tab.icon}
+ Icon={tab.Icon}
active={tab.id === activeTabId}
onClick={() => {
setActiveTabId(tab.id);
diff --git a/front/src/modules/ui/tab/components/__stories__/Tab.stories.tsx b/front/src/modules/ui/tab/components/__stories__/Tab.stories.tsx
index b4cc59212..e40998fbd 100644
--- a/front/src/modules/ui/tab/components/__stories__/Tab.stories.tsx
+++ b/front/src/modules/ui/tab/components/__stories__/Tab.stories.tsx
@@ -23,7 +23,7 @@ export const Default: Story = {
};
export const Catalog: Story = {
- args: { title: 'Tab title', icon: },
+ args: { title: 'Tab title', Icon: IconCheckbox },
argTypes: {
active: { control: false },
disabled: { control: false },
diff --git a/front/src/modules/ui/tab/components/__stories__/Tablist.stories.tsx b/front/src/modules/ui/tab/components/__stories__/Tablist.stories.tsx
index 0ef6a3431..ffadb1c24 100644
--- a/front/src/modules/ui/tab/components/__stories__/Tablist.stories.tsx
+++ b/front/src/modules/ui/tab/components/__stories__/Tablist.stories.tsx
@@ -12,26 +12,26 @@ const tabs = [
{
id: '1',
title: 'Tab1',
- icon: ,
+ Icon: IconCheckbox,
hide: true,
},
{
id: '2',
title: 'Tab2',
- icon: ,
+ Icon: IconCheckbox,
hide: false,
},
{
id: '3',
title: 'Tab3',
- icon: ,
+ Icon: IconCheckbox,
hide: false,
disabled: true,
},
{
id: '4',
title: 'Tab4',
- icon: ,
+ Icon: IconCheckbox,
hide: false,
disabled: false,
},
diff --git a/front/src/modules/ui/table/components/EntityTableHeader.tsx b/front/src/modules/ui/table/components/EntityTableHeader.tsx
index 889559990..5b9fb69b6 100644
--- a/front/src/modules/ui/table/components/EntityTableHeader.tsx
+++ b/front/src/modules/ui/table/components/EntityTableHeader.tsx
@@ -189,7 +189,7 @@ export function EntityTableHeader() {
}
+ Icon={IconPlus}
onClick={toggleColumnMenu}
position="middle"
/>
diff --git a/front/src/modules/ui/table/editable-cell/components/EditableCell.tsx b/front/src/modules/ui/table/editable-cell/components/EditableCell.tsx
index bff8bbc94..1114ef393 100644
--- a/front/src/modules/ui/table/editable-cell/components/EditableCell.tsx
+++ b/front/src/modules/ui/table/editable-cell/components/EditableCell.tsx
@@ -117,7 +117,7 @@ export function EditableCell({
}
+ Icon={IconPencil}
/>
)}
diff --git a/front/src/modules/ui/view-bar/components/DropdownButton.tsx b/front/src/modules/ui/view-bar/components/DropdownButton.tsx
index 7ee9734d9..102df877f 100644
--- a/front/src/modules/ui/view-bar/components/DropdownButton.tsx
+++ b/front/src/modules/ui/view-bar/components/DropdownButton.tsx
@@ -1,18 +1,20 @@
import { ReactNode } from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { Key } from 'ts-key-enum';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
import { DropdownMenuContainer } from './DropdownMenuContainer';
-type OwnProps = {
+type DropdownButtonProps = {
anchor?: 'left' | 'right';
label: ReactNode;
isActive: boolean;
children?: ReactNode;
isUnfolded?: boolean;
- icon?: ReactNode;
+ Icon?: IconComponent;
onIsUnfoldedChange?: (newIsUnfolded: boolean) => void;
resetState?: () => void;
hotkeyScope: string;
@@ -64,11 +66,11 @@ function DropdownButton({
children,
isUnfolded = false,
onIsUnfoldedChange,
+ Icon,
hotkeyScope,
- icon,
color,
menuWidth,
-}: OwnProps) {
+}: DropdownButtonProps) {
useScopedHotkeys(
[Key.Enter, Key.Escape],
() => {
@@ -86,6 +88,8 @@ function DropdownButton({
onIsUnfoldedChange?.(false);
};
+ const theme = useTheme();
+
return (
- {icon && {icon}}
+ {Icon && (
+
+ {}
+
+ )}
{label}
{isUnfolded && (
diff --git a/front/src/modules/ui/view-bar/components/FilterDropdownButton.tsx b/front/src/modules/ui/view-bar/components/FilterDropdownButton.tsx
index b6803bbff..b187d74f6 100644
--- a/front/src/modules/ui/view-bar/components/FilterDropdownButton.tsx
+++ b/front/src/modules/ui/view-bar/components/FilterDropdownButton.tsx
@@ -1,5 +1,6 @@
import { Context } from 'react';
+import { IconComponent } from '@/ui/icon/types/IconComponent';
import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
import { availableFiltersScopedState } from '../states/availableFiltersScopedState';
@@ -8,21 +9,23 @@ import { FiltersHotkeyScope } from '../types/FiltersHotkeyScope';
import { MultipleFiltersDropdownButton } from './MultipleFiltersDropdownButton';
import { SingleEntityFilterDropdownButton } from './SingleEntityFilterDropdownButton';
+type FilterDropdownButtonProps = {
+ context: Context;
+ hotkeyScope: FiltersHotkeyScope;
+ isPrimaryButton?: boolean;
+ Icon?: IconComponent;
+ color?: string;
+ label?: string;
+};
+
export function FilterDropdownButton({
context,
hotkeyScope,
isPrimaryButton = false,
color,
- icon,
+ Icon,
label,
-}: {
- context: Context;
- hotkeyScope: FiltersHotkeyScope;
- isPrimaryButton?: boolean;
- icon?: React.ReactNode;
- color?: string;
- label?: string;
-}) {
+}: FilterDropdownButtonProps) {
const [availableFilters] = useRecoilScopedState(
availableFiltersScopedState,
context,
@@ -40,7 +43,7 @@ export function FilterDropdownButton({
;
+ hotkeyScope: FiltersHotkeyScope;
+ isPrimaryButton?: boolean;
+ Icon?: IconComponent;
+ color?: string;
+ label?: string;
+};
+
export function MultipleFiltersDropdownButton({
context,
hotkeyScope,
isPrimaryButton = false,
color,
- icon,
+ Icon,
label,
-}: {
- context: Context;
- hotkeyScope: FiltersHotkeyScope;
- isPrimaryButton?: boolean;
- icon?: React.ReactNode;
- color?: string;
- label?: string;
-}) {
+}: MultipleFiltersDropdownButtonProps) {
const [isUnfolded, setIsUnfolded] = useState(false);
const [
@@ -108,7 +111,7 @@ export function MultipleFiltersDropdownButton({
label={label ?? 'Filter'}
isActive={isFilterSelected}
isUnfolded={isUnfolded}
- icon={icon}
+ Icon={Icon}
onIsUnfoldedChange={handleIsUnfoldedChange}
hotkeyScope={hotkeyScope}
color={color}
diff --git a/front/src/modules/ui/view-bar/components/SortOrFilterChip.tsx b/front/src/modules/ui/view-bar/components/SortOrFilterChip.tsx
index 80e2e4e85..7e6e400da 100644
--- a/front/src/modules/ui/view-bar/components/SortOrFilterChip.tsx
+++ b/front/src/modules/ui/view-bar/components/SortOrFilterChip.tsx
@@ -67,7 +67,7 @@ function SortOrFilterChip({
{Icon && (
-
+
)}
{labelKey && {labelKey}}
diff --git a/front/src/modules/ui/view-bar/components/UpdateViewButtonGroup.tsx b/front/src/modules/ui/view-bar/components/UpdateViewButtonGroup.tsx
index 145c9770a..64546ab5c 100644
--- a/front/src/modules/ui/view-bar/components/UpdateViewButtonGroup.tsx
+++ b/front/src/modules/ui/view-bar/components/UpdateViewButtonGroup.tsx
@@ -108,7 +108,7 @@ export const UpdateViewButtonGroup = ({
/>
}
+ Icon={IconChevronDown}
onClick={handleArrowDownButtonClick}
/>
diff --git a/front/src/modules/ui/view-bar/components/ViewBarDetails.tsx b/front/src/modules/ui/view-bar/components/ViewBarDetails.tsx
index 67b6edcfd..9c2b7dbed 100644
--- a/front/src/modules/ui/view-bar/components/ViewBarDetails.tsx
+++ b/front/src/modules/ui/view-bar/components/ViewBarDetails.tsx
@@ -202,7 +202,7 @@ function ViewBarDetails({
context={context}
hotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
color={theme.font.color.tertiary}
- icon={}
+ Icon={IconPlus}
label="Add filter"
/>
diff --git a/front/src/modules/users/components/Avatar.tsx b/front/src/modules/users/components/Avatar.tsx
index 67775680d..e1c01e312 100644
--- a/front/src/modules/users/components/Avatar.tsx
+++ b/front/src/modules/users/components/Avatar.tsx
@@ -12,7 +12,7 @@ export type AvatarSize = 'xl' | 'lg' | 'md' | 'sm' | 'xs';
export type AvatarProps = {
avatarUrl: string | null | undefined;
- size: AvatarSize;
+ size?: AvatarSize;
placeholder: string;
colorId?: string;
type?: AvatarType;
@@ -83,7 +83,7 @@ const StyledAvatar = styled.div`
export function Avatar({
avatarUrl,
- size,
+ size = 'md',
placeholder,
colorId = placeholder,
type = 'squared',
diff --git a/front/src/modules/workspace/components/WorkspaceInviteLink.tsx b/front/src/modules/workspace/components/WorkspaceInviteLink.tsx
index 3908f5dff..023d5dd4c 100644
--- a/front/src/modules/workspace/components/WorkspaceInviteLink.tsx
+++ b/front/src/modules/workspace/components/WorkspaceInviteLink.tsx
@@ -32,7 +32,7 @@ export function WorkspaceInviteLink({ inviteLink }: OwnProps) {
}
+ Icon={IconLink}
variant="primary"
accent="blue"
title="Copy link"
diff --git a/front/src/pages/companies/Companies.tsx b/front/src/pages/companies/Companies.tsx
index 96f031824..a5fb4989b 100644
--- a/front/src/pages/companies/Companies.tsx
+++ b/front/src/pages/companies/Companies.tsx
@@ -1,5 +1,4 @@
import { getOperationName } from '@apollo/client/utilities';
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { v4 } from 'uuid';
@@ -70,15 +69,10 @@ export function Companies() {
});
}
- const theme = useTheme();
-
return (
- }
- >
+
diff --git a/front/src/pages/companies/CompaniesMockMode.tsx b/front/src/pages/companies/CompaniesMockMode.tsx
index bf7178b2a..ff3e7f1e2 100644
--- a/front/src/pages/companies/CompaniesMockMode.tsx
+++ b/front/src/pages/companies/CompaniesMockMode.tsx
@@ -1,4 +1,3 @@
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { CompanyTableMockMode } from '@/companies/table/components/CompanyTableMockMode';
@@ -15,14 +14,9 @@ const StyledTableContainer = styled.div`
`;
export function CompaniesMockMode() {
- const theme = useTheme();
-
return (
- }
- />
+
diff --git a/front/src/pages/companies/CompanyShow.tsx b/front/src/pages/companies/CompanyShow.tsx
index 91fcd5624..1d5fe310f 100644
--- a/front/src/pages/companies/CompanyShow.tsx
+++ b/front/src/pages/companies/CompanyShow.tsx
@@ -1,6 +1,5 @@
import { useEffect } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
-import { useTheme } from '@emotion/react';
import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity';
import { CompanyTeam } from '@/companies/components/CompanyTeam';
@@ -37,7 +36,6 @@ export function CompanyShow() {
const companyId = useParams().companyId ?? '';
const { insertCompanyFavorite, deleteCompanyFavorite } = useFavorites();
const navigate = useNavigate();
- const theme = useTheme();
const { data, loading } = useCompanyQuery(companyId);
const company = data?.findUniqueCompany;
@@ -63,7 +61,7 @@ export function CompanyShow() {
}
+ Icon={IconBuildingSkyscraper}
>
- }
- >
+
diff --git a/front/src/pages/people/People.tsx b/front/src/pages/people/People.tsx
index f186ab7c2..95cd4931a 100644
--- a/front/src/pages/people/People.tsx
+++ b/front/src/pages/people/People.tsx
@@ -1,4 +1,3 @@
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { v4 } from 'uuid';
@@ -62,15 +61,10 @@ export function People() {
});
}
- const theme = useTheme();
-
return (
- }
- >
+
diff --git a/front/src/pages/people/PersonShow.tsx b/front/src/pages/people/PersonShow.tsx
index eea829d8a..3c8cd126a 100644
--- a/front/src/pages/people/PersonShow.tsx
+++ b/front/src/pages/people/PersonShow.tsx
@@ -1,7 +1,6 @@
import { useEffect } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { getOperationName } from '@apollo/client/utilities';
-import { useTheme } from '@emotion/react';
import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity';
import { useFavorites } from '@/favorites/hooks/useFavorites';
@@ -41,8 +40,6 @@ export function PersonShow() {
const { insertPersonFavorite, deletePersonFavorite } = useFavorites();
const navigate = useNavigate();
- const theme = useTheme();
-
const { data, loading } = usePersonQuery(personId);
const person = data?.findUniquePerson;
@@ -80,11 +77,7 @@ export function PersonShow() {
return (
- }
- hasBackButton
- >
+
} title="Settings">
+
diff --git a/front/src/pages/settings/SettingsProfile.tsx b/front/src/pages/settings/SettingsProfile.tsx
index 16deb72ca..56f770a7f 100644
--- a/front/src/pages/settings/SettingsProfile.tsx
+++ b/front/src/pages/settings/SettingsProfile.tsx
@@ -23,7 +23,7 @@ const StyledContainer = styled.div`
export function SettingsProfile() {
return (
- } title="Settings">
+
<>
diff --git a/front/src/pages/settings/SettingsWorkspace.tsx b/front/src/pages/settings/SettingsWorkspace.tsx
index c86b8d130..7bce4c985 100644
--- a/front/src/pages/settings/SettingsWorkspace.tsx
+++ b/front/src/pages/settings/SettingsWorkspace.tsx
@@ -18,7 +18,7 @@ const StyledContainer = styled.div`
export function SettingsWorkspace() {
return (
- } title="Settings">
+
diff --git a/front/src/pages/settings/SettingsWorkspaceMembers.tsx b/front/src/pages/settings/SettingsWorkspaceMembers.tsx
index c5ba14ea9..f5ecfc86b 100644
--- a/front/src/pages/settings/SettingsWorkspaceMembers.tsx
+++ b/front/src/pages/settings/SettingsWorkspaceMembers.tsx
@@ -1,10 +1,9 @@
import { useState } from 'react';
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
-import { Button } from '@/ui/button/components/Button';
+import { IconButton } from '@/ui/button/components/IconButton';
import { IconSettings, IconTrash } from '@/ui/icon';
import { SubMenuTopBarContainer } from '@/ui/layout/components/SubMenuTopBarContainer';
import { ConfirmationModal } from '@/ui/modal/components/ConfirmationModal';
@@ -39,7 +38,6 @@ export function SettingsWorkspaceMembers() {
const [currentUser] = useRecoilState(currentUserState);
const workspace = currentUser?.workspaceMember?.workspace;
- const theme = useTheme();
const { data } = useGetWorkspaceMembersQuery();
@@ -85,7 +83,7 @@ export function SettingsWorkspaceMembers() {
};
return (
- } title="Settings">
+
{workspace?.inviteHash && (
@@ -111,14 +109,14 @@ export function SettingsWorkspaceMembers() {
accessory={
currentUser?.id !== member.user.id && (
-
)
diff --git a/front/src/pages/tasks/Tasks.tsx b/front/src/pages/tasks/Tasks.tsx
index 7cf8b7aa1..40dadfaea 100644
--- a/front/src/pages/tasks/Tasks.tsx
+++ b/front/src/pages/tasks/Tasks.tsx
@@ -1,4 +1,3 @@
-import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
@@ -32,28 +31,24 @@ const StyledTabListContainer = styled.div`
`;
export function Tasks() {
- const theme = useTheme();
const openCreateActivity = useOpenCreateActivityDrawer();
const TASK_TABS = [
{
id: 'to-do',
title: 'To do',
- icon: ,
+ Icon: IconCheck,
},
{
id: 'done',
title: 'Done',
- icon: ,
+ Icon: IconArchive,
},
];
return (
- }
- >
+
openCreateActivity(ActivityType.Task)}
diff --git a/front/src/sync-hooks/PageChangeEffect.tsx b/front/src/sync-hooks/PageChangeEffect.tsx
index f131bbb3c..bcf4f444c 100644
--- a/front/src/sync-hooks/PageChangeEffect.tsx
+++ b/front/src/sync-hooks/PageChangeEffect.tsx
@@ -189,7 +189,7 @@ export function PageChangeEffect() {
to: '',
label: 'Create Task',
type: CommandType.Create,
- icon: ,
+ Icon: IconCheckbox,
onCommandClick: () =>
openCreateActivity(
ActivityType.Task,
@@ -200,7 +200,7 @@ export function PageChangeEffect() {
to: '',
label: 'Create Note',
type: CommandType.Create,
- icon: ,
+ Icon: IconNotes,
onCommandClick: () =>
openCreateActivity(
ActivityType.Note,
@@ -223,7 +223,7 @@ export function PageChangeEffect() {
to: '',
label: 'Create Task',
type: CommandType.Create,
- icon: ,
+ Icon: IconCheckbox,
onCommandClick: () =>
openCreateActivity(
ActivityType.Task,
@@ -234,7 +234,7 @@ export function PageChangeEffect() {
to: '',
label: 'Create Note',
type: CommandType.Create,
- icon: ,
+ Icon: IconNotes,
onCommandClick: () =>
openCreateActivity(
ActivityType.Note,
@@ -250,7 +250,7 @@ export function PageChangeEffect() {
to: '',
label: 'Create Task',
type: CommandType.Create,
- icon: ,
+ Icon: IconCheckbox,
onCommandClick: () => openCreateActivity(ActivityType.Task),
},
]);