Skip to content

Commit

Permalink
💄 将部分div改为Box
Browse files Browse the repository at this point in the history
  • Loading branch information
neila-a committed Oct 29, 2023
1 parent 8993d51 commit 985db84
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "neila-tools",
"version": "1.5.3",
"devVersion": "702",
"devVersion": "704",
"dev": true,
"description": "Platform for Neila's something useless tools.",
"private": true,
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
CSSProperties
} from 'react';
import {
Box,
Popover,
Typography
} from '@mui/material';
Expand Down Expand Up @@ -35,7 +36,7 @@ export default function MouseOverPopover(props: {
};
const open = Boolean(anchorEl);
return (
<div style={props.sx ? props.sx : {}}>
<Box sx={props.sx ? props.sx : {}}>
<div
aria-haspopup="true"
onMouseEnter={handlePopoverOpen}
Expand Down Expand Up @@ -64,6 +65,6 @@ export default function MouseOverPopover(props: {
>
<Typography sx={{ p: 1 }}>{props.text}</Typography>
</Popover>
</div>
</Box>
);
}
7 changes: 4 additions & 3 deletions src/app/index/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
Divider,
ButtonGroup,
Button,
IconButton
IconButton,
Box
} from "@mui/material";
import {
setState
Expand Down Expand Up @@ -54,7 +55,7 @@ export default function Buttons(props: {
[dialogTools, setDialogTools] = useState<string[]>([]),
[dialogListName, setDialogListName] = useState<string>("");
return (
<div style={{
<Box sx={{
position: "absolute",
bottom: "0px",
width: "100%"
Expand Down Expand Up @@ -90,6 +91,6 @@ export default function Buttons(props: {
setList={props.setList}
left={[]}
/>
</div>
</Box>
);
}
5 changes: 3 additions & 2 deletions src/app/index/SingleSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import {
Box,
Button, Paper
} from "@mui/material";
import {
Expand Down Expand Up @@ -34,12 +35,12 @@ export default function SingleSelect(props: {
</>
)
return props.isSidebar ? (
<div style={{
<Box sx={{
width: "100%",
whiteSpace: "nowrap"
}}>
<Inner />
</div>
</Box>
) : (
<Inner />
);
Expand Down
17 changes: 9 additions & 8 deletions src/app/index/SingleTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
useState
} from 'react';
import {
Box,
Card,
CardContent,
Typography
Expand Down Expand Up @@ -129,11 +130,11 @@ export default function SingleTool(props: {
}]);
}
}}>
{viewMode == "grid" ? <div>
{viewMode == "grid" ? <Box>
<div className={Style["singleGridIcon"]}>
<ToolIcon />
</div>
<div>
<Box>
<ToolTypography variant="h5">
<DownButton {...buttonOptions} />
{(tool.isGoto && !tool.to.startsWith("/extendedTools")) ? <ExitToAppIcon /> : <></>}
Expand All @@ -143,26 +144,26 @@ export default function SingleTool(props: {
<ToolTypography {...subStyle} variant="body2">
{tool.desc}
</ToolTypography>
</div>
</div> : <>
</Box>
</Box> : <>
<div className={Style["singleListText"]}>
<div className={Style["singleListIcon"]}>
<ToolIcon />
</div>
<div>
<Box>
<ToolTypography variant="h5">
{(tool.isGoto && !tool.to.startsWith("/extendedTools")) ? <ExitToAppIcon /> : <></>}
{tool.name}
</ToolTypography>
<ToolTypography {...subStyle} variant="body2">
{tool.desc}
</ToolTypography>
</div>
</Box>
</div>
<div>
<Box>
<DownButton {...buttonOptions} />
<UpButton {...buttonOptions} />
</div>
</Box>
</>}
</div>
{props.isFirst && <iframe style={{
Expand Down
10 changes: 7 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ export default function Index(props: {
width: "100%"
}}>
<Center>
<HandymanIcon sx={{
fontSize: "1000%"
}} />
<Box sx={{
cursor: "pointer"
}}>
<HandymanIcon sx={{
fontSize: "1000%"
}} />
</Box>
</Center>
</Box>
<Box>
Expand Down
5 changes: 3 additions & 2 deletions src/app/setting/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";
import I18N from 'react-intl-universal';
import {
Box,
Grid,
SvgIconTypeMap,
Typography
Expand Down Expand Up @@ -141,7 +142,7 @@ export default function About() {
<Grid container spacing={{ xs: 2, md: 3 }} columns={{ xs: 4, sm: 8, md: 12 }}>
{Object.values(abouts).map((item, index) => (
<Grid item xs={2} sm={4} md={4} key={Object.keys(abouts).filter(single => abouts[single] === item)[0]}>
<div style={{
<Box style={{
cursor: "pointer"
}} onClick={event => {
setDialogContext(item.context);
Expand All @@ -153,7 +154,7 @@ export default function About() {
<br />
{item.name}
</Typography>
</div>
</Box>
</Grid>
))}
</Grid>
Expand Down
19 changes: 10 additions & 9 deletions src/app/setting/extendeds/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
Divider,
TextField,
IconButton,
ButtonGroup
ButtonGroup,
Box
} from "@mui/material";
import {
useState
Expand Down Expand Up @@ -105,29 +106,29 @@ export default function ExtendedManager() {
{extendedTools?.map(single => <Paper sx={{
padding: 2
}} key={single.to}>
<div style={{
<Box sx={{
display: "flex",
justifyContent: "space-between"
}}>
<Stack direction="row" divider={<Divider orientation="vertical" flexItem />} spacing={2}>
<Stack direction="row" spacing={1}>
<div>
<Box>
<Image src={single.icon} alt={single.name} height={24} width={24} />
</div>
<div>
</Box>
<Box>
<Typography>
{single.name}
</Typography>
<Typography>
<strong>{I18N.get("ID")}</strong> {single.to}
</Typography>
</div>
</Box>
</Stack>
<div>
<Box>
<strong>{I18N.get('描述')}</strong>
<br />
{single.desc}
</div>
</Box>
</Stack>
<IconButton onClick={event => {
setFile(single.file);
Expand All @@ -138,7 +139,7 @@ export default function ExtendedManager() {
}}>
<EditIcon />
</IconButton>
</div>
</Box>
</Paper>)}
</Stack>
<br />
Expand Down
5 changes: 3 additions & 2 deletions src/app/tools/countletter/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";
import I18N from 'react-intl-universal';
import {
Box,
Button, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup
} from "@mui/material";
import LpLogger from "lp-logger";
Expand All @@ -25,7 +26,7 @@ function CountLetter(): JSX.Element {
[numberType, setNumberType] = useState<numberType>(10);
return (
<>
<div>
<Box>
<Button onClick={() => {
logger.log("已弹出输入框。");
setEnterDialogOpen(true);
Expand All @@ -42,7 +43,7 @@ function CountLetter(): JSX.Element {
<AlertDialog open={alertDialogOpen} title={I18N.get('输出')} description={out} onDone={() => {
setAlertDialogOpen(false);
}} /> {/* 输出对话框容器 */}
</div>
</Box>
<br />
<FormControl>
<FormLabel id="radio-buttons-group-label">数字进制</FormLabel>
Expand Down

1 comment on commit 985db84

@vercel
Copy link

@vercel vercel bot commented on 985db84 Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.