2024-08-01 01:47:08 +08:00
|
|
|
import { BugReport } from "@mui/icons-material";
|
2024-08-06 12:39:19 +08:00
|
|
|
import { Box, Button, IconButton, TextField, Typography } from "@mui/material";
|
2024-08-05 21:03:36 +08:00
|
|
|
import { useRouter } from "next/router";
|
2024-08-06 12:39:19 +08:00
|
|
|
import { useState } from "react";
|
2024-08-06 21:47:34 +08:00
|
|
|
import { useSettings } from "../contexts/SettingsContext";
|
|
|
|
import { testing } from "../lib/testing";
|
2024-08-01 01:47:08 +08:00
|
|
|
|
|
|
|
export default function Testing() {
|
2024-08-06 21:47:34 +08:00
|
|
|
// contexts
|
2024-08-05 21:03:36 +08:00
|
|
|
const router = useRouter();
|
2024-08-06 21:47:34 +08:00
|
|
|
const { settings, settingsLoading, updateSettings, resetSettings } = useSettings();
|
2024-08-05 21:03:36 +08:00
|
|
|
|
2024-08-06 21:47:34 +08:00
|
|
|
// states
|
2024-08-06 00:14:02 +08:00
|
|
|
const [text, setText] = useState("");
|
2024-08-01 01:47:08 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Box>
|
2024-08-05 21:03:36 +08:00
|
|
|
<IconButton
|
|
|
|
onClick={() => {
|
|
|
|
router.push("/");
|
|
|
|
}}
|
|
|
|
>
|
2024-08-01 01:47:08 +08:00
|
|
|
<BugReport />
|
|
|
|
</IconButton>
|
|
|
|
<Button
|
2024-08-06 21:47:34 +08:00
|
|
|
onClick={() => {
|
|
|
|
resetSettings();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
reset settings
|
|
|
|
</Button>
|
2024-08-07 10:47:14 +08:00
|
|
|
<Button
|
|
|
|
onClick={() => {
|
|
|
|
updateSettings({
|
2024-08-07 12:15:01 +08:00
|
|
|
style: {
|
2024-08-07 10:47:14 +08:00
|
|
|
dark_mode: false as boolean,
|
|
|
|
accent_color: "#8ab4f8" as string,
|
|
|
|
transition_duration: 200 as number,
|
|
|
|
radius: 8 as number,
|
|
|
|
window_height: 60 as number,
|
|
|
|
window_width: 400 as number,
|
|
|
|
font_family: "monospace" as string,
|
|
|
|
font_scaling: 100,
|
|
|
|
},
|
|
|
|
window: {
|
|
|
|
minimize_button: true as boolean,
|
|
|
|
maximize_button: true as boolean,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
update settings
|
|
|
|
</Button>
|
2024-08-06 21:47:34 +08:00
|
|
|
<Button
|
|
|
|
onClick={() => {
|
|
|
|
console.log(settings);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
log settings
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
onClick={() => {
|
|
|
|
console.log(testing());
|
2024-08-01 01:47:08 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-08-06 21:47:34 +08:00
|
|
|
testing
|
2024-08-01 01:47:08 +08:00
|
|
|
</Button>
|
2024-08-06 00:14:02 +08:00
|
|
|
<Typography>{text}</Typography>
|
2024-08-06 12:39:19 +08:00
|
|
|
<TextField rows={10} />
|
2024-08-01 01:47:08 +08:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|