mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Handle website delete. Added response helper functions.
This commit is contained in:
parent
0a411a9ad6
commit
c4b75e4aec
31 changed files with 314 additions and 96 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import { useSpring, animated } from 'react-spring';
|
||||
import classNames from 'classnames';
|
||||
import { ErrorMessage } from 'formik';
|
||||
import styles from './FormLayout.module.css';
|
||||
|
|
@ -11,9 +12,19 @@ export const FormButtons = ({ className, children }) => (
|
|||
<div className={classNames(styles.buttons, className)}>{children}</div>
|
||||
);
|
||||
|
||||
export const FormError = ({ name }) => (
|
||||
<ErrorMessage name={name}>{msg => <div className={styles.error}>{msg}</div>}</ErrorMessage>
|
||||
);
|
||||
export const FormError = ({ name }) => {
|
||||
return <ErrorMessage name={name}>{msg => <ErrorTag msg={msg} />}</ErrorMessage>;
|
||||
};
|
||||
|
||||
const ErrorTag = ({ msg }) => {
|
||||
const props = useSpring({ opacity: 1, from: { opacity: 0 } });
|
||||
|
||||
return (
|
||||
<animated.div className={styles.error} style={props}>
|
||||
{msg}
|
||||
</animated.div>
|
||||
);
|
||||
};
|
||||
|
||||
export const FormRow = ({ children }) => <div className={styles.row}>{children}</div>;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@
|
|||
.buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: var(--gray50);
|
||||
background: var(--color-error);
|
||||
background: var(--red400);
|
||||
font-size: var(--font-size-small);
|
||||
position: absolute;
|
||||
display: flex;
|
||||
|
|
@ -47,7 +48,7 @@
|
|||
margin: auto;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: var(--color-error);
|
||||
background: var(--red400);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue