diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx
index e8eee7d87..2501ffbe8 100644
--- a/components/AppShelf/AddAppShelfItem.tsx
+++ b/components/AppShelf/AddAppShelfItem.tsx
@@ -22,15 +22,6 @@ export default function AddItemShelfItem(props: any) {
const { addService } = useConfig();
const [opened, setOpened] = useState(false);
const theme = useMantineTheme();
- const form = useForm({
- initialValues: {
- type: 'Other',
- name: '',
- icon: '',
- url: '',
- apiKey: undefined as unknown as string,
- },
- });
return (
<>
setOpened(false)}
title="Add a service"
>
-
-
-
-
+
);
}
+
+export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } & any) {
+ const { setOpened } = props;
+ const { addService, config, setConfig } = useConfig();
+ const form = useForm({
+ initialValues: {
+ type: props.type ?? 'Other',
+ name: props.name ?? '',
+ icon: props.icon ?? '',
+ url: props.url ?? '',
+ apiKey: props.apiKey ?? (undefined as unknown as string),
+ },
+ });
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
diff --git a/components/AppShelf/AppShelf.tsx b/components/AppShelf/AppShelf.tsx
index e78404a90..bf47a7c4c 100644
--- a/components/AppShelf/AppShelf.tsx
+++ b/components/AppShelf/AppShelf.tsx
@@ -103,7 +103,7 @@ export function AppShelfItem(props: any) {
opacity: hovering ? 1 : 0,
}}
>
-
+
diff --git a/components/AppShelf/AppShelfMenu.tsx b/components/AppShelf/AppShelfMenu.tsx
index d11b7c2e7..95042ddf1 100644
--- a/components/AppShelf/AppShelfMenu.tsx
+++ b/components/AppShelf/AppShelfMenu.tsx
@@ -1,47 +1,63 @@
-import { Menu, Text } from '@mantine/core';
+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 { AddAppShelfItemForm } from './AddAppShelfItem';
export default function AppShelfMenu(props: any) {
- const { name, removeitem: removeItem } = props;
+ const { service, removeitem: removeItem } = props;
+ const [opened, setOpened] = useState(false);
return (
-
+
+
+
+ >
);
}