mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-15 10:11:22 -06:00
chore: fix prettier ignore, reformat everything
This commit is contained in:
70
src/App.tsx
70
src/App.tsx
@@ -1,6 +1,6 @@
|
||||
type Frame = {
|
||||
id: string;
|
||||
data: { x: string | number; y: number }[];
|
||||
id: string;
|
||||
data: { x: string | number; y: number }[];
|
||||
};
|
||||
|
||||
import { getCurrentWebview } from "@tauri-apps/api/webview";
|
||||
@@ -9,43 +9,43 @@ import Graph from "./components/graph.js";
|
||||
import DropOverlay from "./components/drop-overlay.js";
|
||||
|
||||
function App() {
|
||||
const data: Frame[] = [];
|
||||
const data: Frame[] = [];
|
||||
|
||||
const [paths, setPaths] = useState<string[]>([]);
|
||||
useEffect(() => {
|
||||
const unlistenPromise = getCurrentWebview().onDragDropEvent(
|
||||
async ({ payload }) => {
|
||||
if (payload.type === "enter") {
|
||||
setPaths(payload.paths);
|
||||
console.log("User hovering", payload);
|
||||
} else if (payload.type === "leave" || payload.type === "drop") {
|
||||
setPaths([]);
|
||||
console.log("User left", payload);
|
||||
}
|
||||
}
|
||||
);
|
||||
const [paths, setPaths] = useState<string[]>([]);
|
||||
useEffect(() => {
|
||||
const unlistenPromise = getCurrentWebview().onDragDropEvent(
|
||||
async ({ payload }) => {
|
||||
if (payload.type === "enter") {
|
||||
setPaths(payload.paths);
|
||||
console.log("User hovering", payload);
|
||||
} else if (payload.type === "leave" || payload.type === "drop") {
|
||||
setPaths([]);
|
||||
console.log("User left", payload);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
|
||||
return () => {
|
||||
unlistenPromise.then((unlisten) => {
|
||||
unlisten();
|
||||
console.log("Unlistened");
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
|
||||
return () => {
|
||||
unlistenPromise.then((unlisten) => {
|
||||
unlisten();
|
||||
console.log("Unlistened");
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
|
||||
const graph = <Graph data={data} />;
|
||||
const graph = <Graph data={data} />;
|
||||
|
||||
return (
|
||||
<div
|
||||
id="App"
|
||||
className="min-h-screen min-w-screen overflow-hidden"
|
||||
style={{ "--wails-drop-target": "drop" } as React.CSSProperties}
|
||||
>
|
||||
<DropOverlay paths={paths} />
|
||||
{graph}
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div
|
||||
id="App"
|
||||
className="min-h-screen min-w-screen overflow-hidden"
|
||||
style={{ "--wails-drop-target": "drop" } as React.CSSProperties}
|
||||
>
|
||||
<DropOverlay paths={paths} />
|
||||
{graph}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user