clash-verge/src/pages/setting.tsx

84 lines
2.1 KiB
TypeScript
Raw Normal View History

2021-12-09 18:28:57 +03:00
import { useRecoilState } from "recoil";
2021-12-11 20:13:08 +03:00
import {
Box,
List,
ListItem,
ListItemText,
ListSubheader,
Typography,
TextField,
styled,
Switch,
Select,
MenuItem,
} from "@mui/material";
2021-12-09 18:28:57 +03:00
import { atomPaletteMode } from "../states/setting";
import PaletteSwitch from "../components/palette-switch";
2021-12-11 20:13:08 +03:00
const MiniListItem = styled(ListItem)(({ theme }) => ({
paddingTop: 5,
paddingBottom: 5,
}));
2021-12-08 18:36:34 +03:00
const SettingPage = () => {
2021-12-09 18:28:57 +03:00
const [mode, setMode] = useRecoilState(atomPaletteMode);
return (
2021-12-11 20:13:08 +03:00
<Box sx={{ width: 0.9, maxWidth: "850px", mx: "auto", mb: 2 }}>
<Typography variant="h4" component="h1" sx={{ py: 2 }}>
Setting
</Typography>
<List sx={{ borderRadius: 1, boxShadow: 2 }}>
<ListSubheader></ListSubheader>
<MiniListItem>
<ListItemText primary="外观主题" />
<PaletteSwitch
edge="end"
checked={mode !== "light"}
onChange={(_e, c) => setMode(c ? "dark" : "light")}
/>
</MiniListItem>
<MiniListItem>
<ListItemText primary="开机自启" />
<Switch edge="end" />
</MiniListItem>
<MiniListItem>
<ListItemText primary="设置系统代理" />
<Switch edge="end" />
</MiniListItem>
<MiniListItem>
<ListItemText primary="局域网连接" />
<Switch edge="end" />
</MiniListItem>
<MiniListItem>
<ListItemText primary="IPv6" />
<Switch edge="end" />
</MiniListItem>
<MiniListItem>
<ListItemText primary="日志等级" />
<Select size="small" sx={{ width: 120 }}>
<MenuItem value="debug">Debug</MenuItem>
<MenuItem value="info">Info</MenuItem>
<MenuItem value="warning">Warning</MenuItem>
<MenuItem value="error">Error</MenuItem>
</Select>
</MiniListItem>
<MiniListItem>
<ListItemText primary="混合代理端口" />
<TextField size="small" defaultValue={7890} sx={{ width: 120 }} />
</MiniListItem>
</List>
2021-12-09 18:28:57 +03:00
</Box>
);
2021-12-08 18:36:34 +03:00
};
export default SettingPage;