diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index c6553d4..c4fefac 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -5,6 +5,7 @@ import { Login } from "./Login"; import { ProtectedRoute } from "./ProtectedRoute"; import { Search } from "./Search"; import { Settings } from "./Settings"; +import { ImageViewer } from "./components/ImageViewer"; export const App = () => { createEffect(() => { @@ -19,13 +20,16 @@ export const App = () => { }); return ( - - + <> + + + - - - - - + + + + + + ); }; diff --git a/frontend/src/components/ImageViewer.tsx b/frontend/src/components/ImageViewer.tsx index b7b0a34..8d8dbfc 100644 --- a/frontend/src/components/ImageViewer.tsx +++ b/frontend/src/components/ImageViewer.tsx @@ -1,19 +1,21 @@ import { listen } from "@tauri-apps/api/event"; -import { createEffect, createSignal } from "solid-js"; +import { createEffect } from "solid-js"; import { sendImage } from "../network"; -import { FolderPicker } from "./folder-picker/FolderPicker"; export function ImageViewer() { - const [latestImage, setLatestImage] = createSignal(null); + // const [latestImage, setLatestImage] = createSignal(null); - createEffect(() => { + createEffect(async () => { // Listen for PNG processing events - const unlisten = listen("png-processed", (event) => { + const unlisten = listen("png-processed", async (event) => { console.log("Received processed PNG", event); const base64Data = event.payload as string; - setLatestImage(`data:image/png;base64,${base64Data}`); - sendImage("test-image.png", base64Data); + // setLatestImage(`data:image/png;base64,${base64Data}`); + const result = await sendImage("test-image.png", base64Data); + + window.location.reload(); + console.log("DBG: ", result); }); return () => { @@ -21,20 +23,22 @@ export function ImageViewer() { }; }); - return ( -
- + return null; - {latestImage() && ( -
-

Latest Processed Image:

- Latest processed -
- )} -
- ); + // return ( + //
+ // + + // {latestImage() && ( + //
+ //

Latest Processed Image:

+ // Latest processed + //
+ // )} + //
+ // ); } diff --git a/frontend/src/components/folder-picker/FolderPicker.tsx b/frontend/src/components/folder-picker/FolderPicker.tsx index 04521a3..926bf07 100644 --- a/frontend/src/components/folder-picker/FolderPicker.tsx +++ b/frontend/src/components/folder-picker/FolderPicker.tsx @@ -27,21 +27,26 @@ export function FolderPicker() { }; return ( -
- +
+

+ Select the folder where your screenshots are stored. We'll watch + this folder for any changes and process any new screenshots. +

+
+ - {selectedPath() && ( -
-

Selected folder:

-

{selectedPath()}

-
- )} + {selectedPath() && ( +
+

{selectedPath()}

+
+ )} +
); } diff --git a/frontend/src/components/item-modal/ItemModal.tsx b/frontend/src/components/item-modal/ItemModal.tsx new file mode 100644 index 0000000..18215ed --- /dev/null +++ b/frontend/src/components/item-modal/ItemModal.tsx @@ -0,0 +1,7 @@ +export const ItemModal = () => { + return ( +
+ ItemModal +
+ ); +}; diff --git a/frontend/src/components/shortcuts/ShortcutItem.tsx b/frontend/src/components/shortcuts/ShortcutItem.tsx index 2fc4a30..ce7df54 100644 --- a/frontend/src/components/shortcuts/ShortcutItem.tsx +++ b/frontend/src/components/shortcuts/ShortcutItem.tsx @@ -18,7 +18,7 @@ export const ShortcutItem: Component = (props) => { return ( {(key) => ( - + {formatKey(key)} )} @@ -27,15 +27,15 @@ export const ShortcutItem: Component = (props) => { }; return ( -
+
{props.isEditing ? ( <> -
+
{props.currentKeys.length > 0 ? ( renderKeys(props.currentKeys) ) : ( - + Press keys... )} @@ -45,14 +45,14 @@ export const ShortcutItem: Component = (props) => { type="button" onClick={props.onSave} disabled={props.currentKeys.length < 2} - class="px-3 py-1 text-sm rounded bg-blue-500 text-white hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed" + class="px-3 py-1 text-sm rounded bg-neutral-900 text-white" > Save @@ -66,7 +66,7 @@ export const ShortcutItem: Component = (props) => { diff --git a/frontend/src/components/shortcuts/Shortcuts.tsx b/frontend/src/components/shortcuts/Shortcuts.tsx index 5098b06..7a7f3a3 100644 --- a/frontend/src/components/shortcuts/Shortcuts.tsx +++ b/frontend/src/components/shortcuts/Shortcuts.tsx @@ -58,13 +58,20 @@ export const Shortcuts = () => { }; return ( - +
+

+ Set up a to quickly open Haystack search. This shortcut also + reloads items when updates happen (we should definetely fix + that) +

+ +
); };