mirror of
https://github.com/Vomitblood/stort.git
synced 2025-04-20 21:11:00 +08:00
86 lines
2.1 KiB
TypeScript
86 lines
2.1 KiB
TypeScript
import { BugReport } from "@mui/icons-material";
|
|
import { Box, Button, IconButton, TextField, Typography } from "@mui/material";
|
|
import { useRouter } from "next/router";
|
|
import { useState } from "react";
|
|
import { SettingsItem } from "../components/HeaderBar/Settings/SettingsItem";
|
|
import { useSettings } from "../contexts/SettingsContext";
|
|
import { testing } from "../lib/testing";
|
|
import { invoke } from "@tauri-apps/api/tauri";
|
|
|
|
export default function Testing() {
|
|
// contexts
|
|
const router = useRouter();
|
|
const { settings, settingsLoading, updateSettings, resetSettings } = useSettings();
|
|
|
|
// states
|
|
const [text, setText] = useState("");
|
|
const [color, setColor] = useState("#000000");
|
|
|
|
return (
|
|
<Box>
|
|
<IconButton
|
|
onClick={() => {
|
|
router.push("/");
|
|
}}
|
|
>
|
|
<BugReport />
|
|
</IconButton>
|
|
<button
|
|
onClick={() => {
|
|
resetSettings();
|
|
}}
|
|
>
|
|
reset settings
|
|
</button>
|
|
<button>update settings</button>
|
|
<button
|
|
onClick={() => {
|
|
console.log(settings);
|
|
}}
|
|
>
|
|
log settings
|
|
</button>
|
|
<button
|
|
onClick={() => {
|
|
console.log(testing());
|
|
}}
|
|
>
|
|
testing
|
|
</button>
|
|
<button
|
|
onClick={async () => {
|
|
try {
|
|
const bruh = await invoke("process_wallpaper_image", {
|
|
filePathString: "/home/vomitblood/Downloads/asasdf.gif",
|
|
});
|
|
} catch (error) {
|
|
console.error("deec nuts", error);
|
|
}
|
|
}}
|
|
>
|
|
invoke tauri shit
|
|
</button>
|
|
<Typography>{text}</Typography>
|
|
<SettingsItem
|
|
defaultText="#8ab4f8"
|
|
description="Accent color"
|
|
input={
|
|
<TextField
|
|
name="accent_color"
|
|
onChange={(e) => {
|
|
setColor(e.target.value);
|
|
}}
|
|
sx={{
|
|
width: "100%",
|
|
}}
|
|
size="small"
|
|
type="color"
|
|
value={color}
|
|
variant="standard"
|
|
/>
|
|
}
|
|
/>
|
|
</Box>
|
|
);
|
|
}
|