mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Added tracking code form.
This commit is contained in:
parent
c4b75e4aec
commit
58a1be7a30
27 changed files with 100 additions and 42 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState } from 'react';
|
||||
import { Formik, Form, Field } from 'formik';
|
||||
import { del } from 'lib/web';
|
||||
import Button from 'components/interface/Button';
|
||||
import Button from 'components/common/Button';
|
||||
import FormLayout, {
|
||||
FormButtons,
|
||||
FormError,
|
||||
|
|
@ -19,7 +19,7 @@ const validate = ({ confirmation }) => {
|
|||
return errors;
|
||||
};
|
||||
|
||||
export default function WebsiteDeleteForm({ initialValues, onSave, onClose }) {
|
||||
export default function WebsiteDeleteForm({ values, onSave, onClose }) {
|
||||
const [message, setMessage] = useState();
|
||||
|
||||
const handleSubmit = async ({ website_id }) => {
|
||||
|
|
@ -35,21 +35,20 @@ export default function WebsiteDeleteForm({ initialValues, onSave, onClose }) {
|
|||
return (
|
||||
<FormLayout>
|
||||
<Formik
|
||||
initialValues={{ confirmation: '', ...initialValues }}
|
||||
initialValues={{ confirmation: '', ...values }}
|
||||
validate={validate}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
{() => (
|
||||
<Form>
|
||||
<div>
|
||||
Are your sure you want to delete <b>{initialValues.name}</b>?
|
||||
Are your sure you want to delete <b>{values.name}</b>?
|
||||
</div>
|
||||
<div>All associated data will be deleted as well.</div>
|
||||
<p>
|
||||
Type <b>DELETE</b> in the box below to confirm.
|
||||
</p>
|
||||
<FormRow>
|
||||
<label htmlFor="confirmation">Confirm</label>
|
||||
<Field name="confirmation" />
|
||||
<FormError name="confirmation" />
|
||||
</FormRow>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue