feat: enlarge the size of the next button for uploading files and add locale config to global.ts (#195)

feat: enlarge the size of the next button for uploading files
feat: add locale config to global.ts
This commit is contained in:
balibabu
2024-04-02 10:31:46 +08:00
committed by GitHub
parent 7a36d25687
commit e3c24e653e
8 changed files with 135 additions and 79 deletions

View File

@@ -0,0 +1,44 @@
import { useCallback } from 'react';
import { useDispatch } from 'umi';
export interface ILoginRequestBody {
email: string;
password: string;
}
export interface IRegisterRequestBody extends ILoginRequestBody {
nickname: string;
}
export const useLogin = () => {
const dispatch = useDispatch();
const login = useCallback(
(requestBody: ILoginRequestBody) => {
// TODO: Type needs to be improved
return dispatch<any>({
type: 'loginModel/login',
payload: requestBody,
});
},
[dispatch],
);
return login;
};
export const useRegister = () => {
const dispatch = useDispatch();
const register = useCallback(
(requestBody: IRegisterRequestBody) => {
return dispatch<any>({
type: 'loginModel/register',
payload: requestBody,
});
},
[dispatch],
);
return register;
};