refacto(twenty-front): improve DropdownMenuHeader api (#10961)

This commit is contained in:
Antoine Moreaux
2025-03-18 08:19:22 +01:00
committed by GitHub
parent 03f4f73da4
commit 606098fef6
29 changed files with 194 additions and 148 deletions

View File

@ -26,6 +26,7 @@ import {
OverflowingTextWithTooltip,
useIcons,
} from 'twenty-ui';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
type WorkflowVariablesDropdownFieldItemsProps = {
step: StepOutputSchema;
@ -116,8 +117,12 @@ export const WorkflowVariablesDropdownFieldItems = ({
return (
<>
<DropdownMenuHeader
StartIcon={IconChevronLeft}
onStartIconClick={goBack}
StartComponent={
<DropdownMenuHeaderLeftComponent
onClick={goBack}
Icon={IconChevronLeft}
/>
}
style={{ position: 'fixed' }}
>
<OverflowingTextWithTooltip

View File

@ -15,6 +15,7 @@ import {
OverflowingTextWithTooltip,
useIcons,
} from 'twenty-ui';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
type WorkflowVariablesDropdownObjectItemsProps = {
step: StepOutputSchema;
@ -98,7 +99,14 @@ export const WorkflowVariablesDropdownObjectItems = ({
return (
<>
<DropdownMenuHeader StartIcon={IconChevronLeft} onStartIconClick={goBack}>
<DropdownMenuHeader
StartComponent={
<DropdownMenuHeaderLeftComponent
onClick={goBack}
Icon={IconChevronLeft}
/>
}
>
<OverflowingTextWithTooltip
text={getStepHeaderLabel(step, currentPath)}
/>

View File

@ -12,6 +12,7 @@ import {
OverflowingTextWithTooltip,
useIcons,
} from 'twenty-ui';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
type WorkflowVariablesDropdownWorkflowStepItemsProps = {
dropdownId: string;
@ -37,7 +38,14 @@ export const WorkflowVariablesDropdownWorkflowStepItems = ({
return (
<>
<DropdownMenuHeader StartIcon={IconX} onStartIconClick={closeDropdown}>
<DropdownMenuHeader
StartComponent={
<DropdownMenuHeaderLeftComponent
onClick={closeDropdown}
Icon={IconX}
/>
}
>
<OverflowingTextWithTooltip text={'Select Step'} />
</DropdownMenuHeader>
<DropdownMenuSearchInput