mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Toast notifications.
This commit is contained in:
parent
2837251db7
commit
aec012fb79
6 changed files with 69 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ import Code from 'assets/code.svg';
|
|||
import Link from 'assets/link.svg';
|
||||
import styles from './WebsiteSettings.module.css';
|
||||
import useFetch from '../../hooks/useFetch';
|
||||
import Toast from '../common/Toast';
|
||||
|
||||
export default function WebsiteSettings() {
|
||||
const [editWebsite, setEditWebsite] = useState();
|
||||
|
|
@ -25,6 +26,7 @@ export default function WebsiteSettings() {
|
|||
const [showCode, setShowCode] = useState();
|
||||
const [showUrl, setShowUrl] = useState();
|
||||
const [saved, setSaved] = useState(0);
|
||||
const [message, setMessage] = useState();
|
||||
const { data } = useFetch(`/api/websites`, {}, { update: [saved] });
|
||||
|
||||
const Buttons = row => (
|
||||
|
|
@ -66,6 +68,7 @@ export default function WebsiteSettings() {
|
|||
|
||||
function handleSave() {
|
||||
setSaved(state => state + 1);
|
||||
setMessage('Saved successfully.');
|
||||
handleClose();
|
||||
}
|
||||
|
||||
|
|
@ -127,6 +130,7 @@ export default function WebsiteSettings() {
|
|||
<ShareUrlForm values={showUrl} onClose={handleClose} />
|
||||
</Modal>
|
||||
)}
|
||||
{message && <Toast message={message} onClose={() => setMessage(null)} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue