mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-26 23:30:09 +08:00
refactor: frontend (#5068)
* refactor: setting components * refactor: frontend * fix: settings router
This commit is contained in:
@@ -20,8 +20,13 @@ interface ItemProps {
|
||||
onClick?: () => void | Promise<any>;
|
||||
}
|
||||
|
||||
export const SettingItem: React.FC<ItemProps> = (props) => {
|
||||
const { label, extra, children, secondary, onClick } = props;
|
||||
export const SettingItem: React.FC<ItemProps> = ({
|
||||
label,
|
||||
extra,
|
||||
children,
|
||||
secondary,
|
||||
onClick,
|
||||
}) => {
|
||||
const clickable = !!onClick;
|
||||
|
||||
const primary = (
|
||||
@@ -65,7 +70,7 @@ export const SettingItem: React.FC<ItemProps> = (props) => {
|
||||
export const SettingList: React.FC<{
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
}> = (props) => (
|
||||
}> = ({ title, children }) => (
|
||||
<List>
|
||||
<ListSubheader
|
||||
sx={[
|
||||
@@ -78,9 +83,9 @@ export const SettingList: React.FC<{
|
||||
]}
|
||||
disableSticky
|
||||
>
|
||||
{props.title}
|
||||
{title}
|
||||
</ListSubheader>
|
||||
|
||||
{props.children}
|
||||
{children}
|
||||
</List>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user