mirror of
https://github.com/umami-software/umami.git
synced 2026-02-22 13:35:35 +01:00
Added DialogButton to handle mobile.
This commit is contained in:
parent
036748cdeb
commit
40492ec7c4
32 changed files with 2146 additions and 1807 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { ActionButton } from '@/components/input/ActionButton';
|
||||
import { Edit } from '@/components/icons';
|
||||
import { Dialog } from '@umami/react-zen';
|
||||
import { CohortEditForm } from '@/app/(main)/websites/[websiteId]/cohorts/CohortEditForm';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import { Filter } from '@/lib/types';
|
||||
import { DialogButton } from '@/components/input/DialogButton';
|
||||
|
||||
export function CohortEditButton({
|
||||
cohortId,
|
||||
|
|
@ -17,22 +16,23 @@ export function CohortEditButton({
|
|||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<ActionButton title={formatMessage(labels.edit)} icon={<Edit />}>
|
||||
<Dialog
|
||||
title={formatMessage(labels.cohort)}
|
||||
style={{ width: 800, minHeight: 300, maxHeight: '90vh' }}
|
||||
>
|
||||
{({ close }) => {
|
||||
return (
|
||||
<CohortEditForm
|
||||
cohortId={cohortId}
|
||||
websiteId={websiteId}
|
||||
filters={filters}
|
||||
onClose={close}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
</Dialog>
|
||||
</ActionButton>
|
||||
<DialogButton
|
||||
icon={<Edit />}
|
||||
variant="quiet"
|
||||
title={formatMessage(labels.cohort)}
|
||||
width="800px"
|
||||
minHeight="300px"
|
||||
>
|
||||
{({ close }) => {
|
||||
return (
|
||||
<CohortEditForm
|
||||
cohortId={cohortId}
|
||||
websiteId={websiteId}
|
||||
filters={filters}
|
||||
onClose={close}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
</DialogButton>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue