diff --git a/gui/index.html b/gui/index.html index 194012b..dcc8e25 100644 --- a/gui/index.html +++ b/gui/index.html @@ -1,14 +1,23 @@ - - - - - Tauri + React + TS - - -
- - - + + + + + Tauri + React + TS + + + +
+ + + + +
+ + + + \ No newline at end of file diff --git a/gui/src-tauri/Cargo.toml b/gui/src-tauri/Cargo.toml index 029e010..55bfee5 100644 --- a/gui/src-tauri/Cargo.toml +++ b/gui/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" tauri-build = { version = "1.2", features = [] } [dependencies] -tauri = { version = "1.2", features = ["shell-open", "shell-sidecar"] } +tauri = { version = "1.2", features = ["shell-open", "shell-sidecar", "window-all"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.json index 16fb8b0..6598587 100644 --- a/gui/src-tauri/tauri.conf.json +++ b/gui/src-tauri/tauri.conf.json @@ -26,6 +26,16 @@ ], "all": false, "open": true + }, + "window": { + "all": true + }, + "fs": { + "scope": [ + "$APPCONFIG", + "$APPDATA", + "$APPCACHE" + ] } }, "bundle": { @@ -55,7 +65,8 @@ "resizable": true, "title": "s3si.ts", "width": 800, - "height": 600 + "height": 600, + "visible": false } ] } diff --git a/gui/src/App.tsx b/gui/src/App.tsx index f6983f5..53ab39f 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -1,11 +1,13 @@ -import { - -} from "@tauri-apps/api/window"; +import { getCurrent } from "@tauri-apps/api/window"; import { Routes, Route } from "react-router-dom"; import { Layout } from "components/Layout"; import { Home } from "pages/Home"; +import { useEffect } from "react"; function App() { + useEffect(() => { + getCurrent().show() + }, []) return ( }> diff --git a/gui/src/main.tsx b/gui/src/main.tsx index ca1c41e..9937e2f 100644 --- a/gui/src/main.tsx +++ b/gui/src/main.tsx @@ -2,7 +2,6 @@ import React from "react"; import ReactDOM from "react-dom/client"; import { BrowserRouter } from "react-router-dom"; import App from "./App"; -import "./main.css"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( @@ -11,3 +10,4 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( ); + diff --git a/gui/src/pages/Home.tsx b/gui/src/pages/Home.tsx index b788ce9..20dcdc5 100644 --- a/gui/src/pages/Home.tsx +++ b/gui/src/pages/Home.tsx @@ -1,8 +1,17 @@ +import { WebviewWindow } from '@tauri-apps/api/window' import { Loading } from 'components/Loading' import React from 'react' export const Home: React.FC = ({ }) => { + const onClick = () => { + const webview = new WebviewWindow('theUniqueLabel', { + url: 'https://accounts.nintendo.com/', + resizable: false, + focus: true, + }) + }; return <> Hello world! + -} \ No newline at end of file +}