Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Converted popup into modal.

Mike Cao5a5127c9212f
diff --git a/components/pages/reports/funnel/FunnelParameters.js b/components/pages/reports/funnel/FunnelParameters.js
index f43728c77..bced9a1ae 100644
--- a/components/pages/reports/funnel/FunnelParameters.js
+++ b/components/pages/reports/funnel/FunnelParameters.js
@@ -6,8 +6,8 @@ import {
FormButtons,
FormInput,
FormRow,
- PopupTrigger,
- Popup,
+ ModalTrigger,
+ Modal,
SubmitButton,
Text,
TextField,
@@ -85,29 +85,34 @@ function AddURLButton({ onAdd }) {
const handleChange = e => {
setUrl(e.target.value);
};
+ const handleClose = close => {
+ setUrl('');
+ close();
+ };
return (
- <PopupTrigger>
+ <ModalTrigger>
<Icon>
<Icons.Plus />
</Icon>
- <Popup className={styles.popup} position="right" alignment="start">
+ <Modal>
{close => {
return (
<Form>
<FormRow label={formatMessage(labels.url)}>
<TextField name="url" value={url} onChange={handleChange} autoComplete="off" />
</FormRow>
- <FormButtons>
+ <FormButtons align="center" flex>
<Button variant="primary" onClick={() => handleAdd(close)}>
{formatMessage(labels.add)}
</Button>
+ <Button onClick={() => handleClose(close)}>{formatMessage(labels.cancel)}</Button>
</FormButtons>
</Form>
);
}}
- </Popup>
- </PopupTrigger>
+ </Modal>
+ </ModalTrigger>
);
}
diff --git a/components/pages/reports/funnel/FunnelParameters.module.css b/components/pages/reports/funnel/FunnelParameters.module.css
index d60048a7d..25ef02417 100644
--- a/components/pages/reports/funnel/FunnelParameters.module.css
+++ b/components/pages/reports/funnel/FunnelParameters.module.css
@@ -1,12 +1,3 @@
-.popup {
- background: var(--base50);
- padding: 20px;
- margin-left: 10px;
- border: 1px solid var(--base400);
- border-radius: var(--border-radius);
- width: 400px;
-}
-
.urls {
display: flex;
flex-direction: column;