Skip to content

Commit

Permalink
chore: text overflow word-wrap & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchengjie committed May 20, 2024
1 parent b4fddae commit 08e0d6a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/components/log/log-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Item = styled(Box)(({ theme: { palette, typography } }) => ({
},
"& .data": {
color: palette.text.primary,
overflowWrap: "anywhere",
},
}));

Expand Down
2 changes: 1 addition & 1 deletion src/components/setting/mods/hotkey-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const HotkeyViewer = forwardRef<DialogRef>((props, ref) => {
return (
<BaseDialog
open={open}
title={t("Hotkey Viewer")}
title={t("Hotkey Setting")}
contentSx={{ width: 450, maxHeight: 330 }}
okBtn={t("Save")}
cancelBtn={t("Cancel")}
Expand Down
20 changes: 15 additions & 5 deletions src/components/setting/mods/sysproxy-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {

<ListItem sx={{ padding: "5px 2px", alignItems: "start" }}>
<ListItemText primary={t("Proxy Bypass")} sx={{ padding: "3px 0" }} />
</ListItem>
<ListItem sx={{ padding: "5px 2px" }}>
<TextField
disabled={!enabled}
size="small"
autoComplete="off"
multiline
rows={3}
sx={{ width: 280 }}
rows={4}
sx={{ width: "100%" }}
value={value.bypass}
placeholder={sysproxy?.bypass || `-`}
onChange={(e) =>
Expand Down Expand Up @@ -155,9 +157,17 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {

<FlexBox>
<Typography className="label">{t("Bypass")}</Typography>
<Typography className="value" style={{ overflowWrap: "anywhere" }}>
{sysproxy?.bypass || "-"}
</Typography>
</FlexBox>
<FlexBox>
<TextField
disabled={true}
size="small"
autoComplete="off"
multiline
rows={4}
sx={{ width: "100%" }}
value={sysproxy?.bypass || "-"}
/>
</FlexBox>
</Box>
</BaseDialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/setting/mods/theme-viewer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
import { forwardRef, useImperativeHandle, useState } from "react";
import { useLockFn } from "ahooks";
import { useTranslation } from "react-i18next";
import {
Expand Down
1 change: 0 additions & 1 deletion src/components/setting/setting-system.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { GuardState } from "./mods/guard-state";
import { ServiceViewer } from "./mods/service-viewer";
import { SysproxyViewer } from "./mods/sysproxy-viewer";
import { TunViewer } from "./mods/tun-viewer";
import getSystem from "@/utils/get-system";

interface Props {
onError?: (err: Error) => void;
Expand Down
10 changes: 1 addition & 9 deletions src/pages/logs.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { useMemo, useState } from "react";
import { useRecoilState } from "recoil";
import {
Box,
Button,
IconButton,
MenuItem,
Select,
SelectProps,
styled,
} from "@mui/material";
import { Box, Button, IconButton, MenuItem } from "@mui/material";
import { Virtuoso } from "react-virtuoso";
import { useTranslation } from "react-i18next";
import {
Expand Down

0 comments on commit 08e0d6a

Please sign in to comment.