#
vincentlu
2025-02-11 2d1b39fae6abed7cda7bd5722fcea23fefdb6e12
rsf-admin/src/page/settings/BaseSettings.jsx
@@ -17,6 +17,7 @@
    MenuItem,
    FormHelperText,
    CircularProgress,
    LinearProgress,
} from '@mui/material';
import { updateUserInfo } from '@/api/auth';
import avatar from '/avatar.jpg'
@@ -24,9 +25,21 @@
const BaseSettings = (props) => {
    const translate = useTranslate();
    const notify = useNotify();
    const { children, value, userInfo } = props;
    const { children, userInfo } = props;
    const { control, handleSubmit, watch, setValue, getValues, formState: { isDirty } } = useForm();
    const {
        control,
        handleSubmit,
        watch,
        setValue,
        getValues,
        reset,
        formState: {
            errors,
            isDirty,
        }
    } = useForm();
    const [loading, setLoading] = useState(false);
    useEffect(() => {
@@ -67,14 +80,23 @@
    }
    return (
        <Box
            hidden={value !== 0}
            sx={{
                p: 3,
                flex: 1,
                overflow: 'auto',
            }}
        >
        <Box sx={{
            position: 'relative',
            p: 3,
            flex: 1,
            overflow: 'auto',
        }}>
            {!userInfo && (
                <LinearProgress
                    sx={{
                        height: "2px",
                        position: 'absolute',
                        top: 0,
                        left: 0,
                        right: 0,
                    }}
                />
            )}
            {/* https://github.com/themeselection/materio-mui-nextjs-admin-template-free/blob/main/javascript-version/src/views/account-settings/account/AccountDetails.jsx */}
            <form onSubmit={handleSubmit(onSubmit)} noValidate>
                <Stack