refactor: use redux

This commit is contained in:
boojack
2022-05-21 12:21:06 +08:00
parent 2e9152e223
commit c2e5a1a524
45 changed files with 674 additions and 1101 deletions

View File

@ -1,5 +1,5 @@
import { useContext, useState } from "react";
import appContext from "../stores/appContext";
import { useState } from "react";
import { useAppSelector } from "../store";
import { showDialog } from "./Dialog";
import MyAccountSection from "./Settings/MyAccountSection";
import PreferencesSection from "./Settings/PreferencesSection";
@ -16,8 +16,8 @@ interface State {
const SettingDialog: React.FC<Props> = (props: Props) => {
const {
userState: { user },
} = useContext(appContext);
user: { user },
} = useAppSelector((state) => state);
const { destroy } = props;
const [state, setState] = useState<State>({
selectedSection: "my-account",