🎉 Persistent config 🎉

After sweat and tears... It's there!
This commit is contained in:
Aj - Thomas
2022-05-12 21:38:21 +02:00
parent 91f636ca97
commit 3ce9c98e03
13 changed files with 178 additions and 62 deletions

View File

@@ -2,10 +2,12 @@ import { Menu, Modal, Text } from '@mantine/core';
import { showNotification } from '@mantine/notifications';
import { useState } from 'react';
import { Check, Edit, Trash } from 'tabler-icons-react';
import { useConfig } from '../../tools/state';
import { AddAppShelfItemForm } from './AddAppShelfItem';
export default function AppShelfMenu(props: any) {
const { service, removeitem: removeItem } = props;
const { service } = props;
const { config, setConfig } = useConfig();
const [opened, setOpened] = useState(false);
return (
<>
@@ -40,7 +42,10 @@ export default function AppShelfMenu(props: any) {
<Menu.Item
color="red"
onClick={(e: any) => {
removeItem(service.name);
setConfig({
...config,
services: config.services.filter((s) => s.name !== service.name),
});
showNotification({
autoClose: 5000,
title: (