mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
Revert "Refactor components to remove forwardRef and simplify props handling"
This reverts commit 1cd013fb94.
This commit is contained in:
@@ -9,16 +9,16 @@ import {
|
||||
useTheme,
|
||||
} from "@mui/material";
|
||||
import { useLockFn } from "ahooks";
|
||||
import { useImperativeHandle, useState } from "react";
|
||||
import { forwardRef, useImperativeHandle, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { BaseDialog } from "@/components/base";
|
||||
import { BaseDialog, DialogRef } from "@/components/base";
|
||||
import { EditorViewer } from "@/components/profile/editor-viewer";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { defaultTheme, defaultDarkTheme } from "@/pages/_theme";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
|
||||
export const ThemeViewer = ({ ref, ...props }) => {
|
||||
export const ThemeViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -144,7 +144,7 @@ export const ThemeViewer = ({ ref, ...props }) => {
|
||||
</List>
|
||||
</BaseDialog>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
const Item = styled(ListItem)(() => ({
|
||||
padding: "5px 2px",
|
||||
|
||||
Reference in New Issue
Block a user