feat: add alignRight prop to IntegrationFilter and update HomePageClient
- Introduced alignRight prop in IntegrationFilter for dropdown alignment control. - Updated HomePageClient to pass alignRight as true, ensuring consistent dropdown positioning.
This commit is contained in:
@@ -73,6 +73,7 @@ function HomePageContent({ productivityMetrics, deadlineMetrics, tagMetrics }: {
|
||||
onSourcesChange={setSelectedSources}
|
||||
hiddenSources={hiddenSources}
|
||||
onHiddenSourcesChange={setHiddenSources}
|
||||
alignRight={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ interface IntegrationFilterProps {
|
||||
onSourcesChange?: (sources: string[]) => void;
|
||||
hiddenSources?: string[];
|
||||
onHiddenSourcesChange?: (sources: string[]) => void;
|
||||
|
||||
// Alignement du dropdown
|
||||
alignRight?: boolean;
|
||||
}
|
||||
|
||||
interface SourceOption {
|
||||
@@ -32,7 +35,8 @@ export function IntegrationFilter({
|
||||
selectedSources,
|
||||
onSourcesChange,
|
||||
hiddenSources,
|
||||
onHiddenSourcesChange
|
||||
onHiddenSourcesChange,
|
||||
alignRight = false
|
||||
}: IntegrationFilterProps) {
|
||||
const { regularTasks, pinnedTasks } = useTasksContext();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
@@ -263,8 +267,8 @@ export function IntegrationFilter({
|
||||
trigger={`🔗 ${getMainButtonText()}`}
|
||||
variant={getMainButtonVariant()}
|
||||
content={dropdownContent}
|
||||
placement="bottom-start"
|
||||
className="min-w-[240px]"
|
||||
placement={alignRight ? "bottom-end" : "bottom-start"}
|
||||
className={`min-w-[240px] ${alignRight ? "transform -translate-x-full" : ""}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user