From 5a6001026860aca724bf5aa871da93a5edabe12c Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Fri, 13 May 2022 23:18:19 +0200 Subject: Actuall add decky-frontend-lib and remove some old code --- src/index.tsx | 71 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 56301a7..f10ca4f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,50 +1,59 @@ import { Button, definePlugin, - PanelSection, - PanelSectionRow, + Menu, + MenuItem, ServerAPI, - TabTitle, + showModal, + staticClasses, } from "decky-frontend-lib"; -import { useState, VFC } from "react"; +import { VFC } from "react"; import { FaShip } from "react-icons/fa"; -interface AddMethodArgs { - left: number; - right: number; -} +// interface AddMethodArgs { +// left: number; +// right: number; +// } -const Content: VFC<{ serverAPI: ServerAPI }> = ({ serverAPI }) => { - const [result, setResult] = useState(); +const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { + // const [result, setResult] = useState(); - const onClick = async () => { - const result = await serverAPI.callPluginMethod( - "add", - { - left: 2, - right: 2, - } - ); - if (result.success) { - setResult(result.result); - } - }; + // const onClick = async () => { + // const result = await serverAPI.callPluginMethod( + // "add", + // { + // left: 2, + // right: 2, + // } + // ); + // if (result.success) { + // setResult(result.result); + // } + // }; return ( - - - -
Server says: {result}
-
-
+
+ +
); }; export default definePlugin((serverApi) => { return { - title: Example Plugin, + title:
Example Plugin
, content: , icon: , }; -- cgit v1.2.3