mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
new tauri packages, and a little more frontend
This commit is contained in:
1 parent
14be87d4b3
commit
329d800586
3 files changed
+679
-15
No files matched your search
Generated
+659
-3
File diff suppressed because it is too large.
Load diff
@@ -11,3 +11,7 @@ serde = { version = "1", features = ["derive"] }
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
rusqlite = { version = "0.38.0", features = ["bundled", "unlock_notify"] }
|
rusqlite = { version = "0.38.0", features = ["bundled", "unlock_notify"] }
|
||||||
thiserror = "2.0.18"
|
thiserror = "2.0.18"
|
||||||
|
zip = "8.1.0"
|
||||||
|
sha1 = "0.10.6"
|
||||||
|
walkdir = "2.5.0"
|
||||||
|
reqwest = "0.13.2"
|
||||||
+16
-12
@@ -2,7 +2,7 @@ import "./App.css";
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { Button, Field, Input, Stack } from "@chakra-ui/react";
|
import { Button, Group, Input, Stack } from "@chakra-ui/react";
|
||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
|
|
||||||
import { Provider } from "./components/ui/provider";
|
import { Provider } from "./components/ui/provider";
|
||||||
@@ -18,28 +18,32 @@ function App() {
|
|||||||
}, [name]);
|
}, [name]);
|
||||||
|
|
||||||
async function greet() {
|
async function greet() {
|
||||||
invoke("add_entry", { name });
|
await invoke("add_entry", { name });
|
||||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||||
|
|
||||||
|
setName("");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<Provider>
|
||||||
<Stack maxW={"1000px"} margin={"0.5em auto"}>
|
<Stack maxW={"1000px"} margin={"0.5em auto"}>
|
||||||
<Field.Root
|
<form
|
||||||
orientation={"horizontal"}
|
|
||||||
onSubmit={(e) => {
|
onSubmit={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
greet();
|
greet();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Input
|
<Group attached w="full">
|
||||||
id="greet-input"
|
<Input
|
||||||
onChange={(e) => setName(e.currentTarget.value)}
|
id="greet-input"
|
||||||
autoComplete="off"
|
value={name}
|
||||||
placeholder="Enter a name..."
|
onChange={(e) => setName(e.currentTarget.value)}
|
||||||
/>
|
autoComplete="off"
|
||||||
<Button>Search</Button>
|
placeholder="Enter a name..."
|
||||||
</Field.Root>
|
/>
|
||||||
|
<Button type="submit">Search</Button>
|
||||||
|
</Group>
|
||||||
|
</form>
|
||||||
<p>{greetMsg}</p>
|
<p>{greetMsg}</p>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|||||||
Reference in new issue
Block a user