mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-01 19:59:44 +00:00
feat: use get workspace profile in frontend
This commit is contained in:
@ -13,10 +13,7 @@ const SignIn: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const userStore = useUserStore();
|
||||
const {
|
||||
workspaceProfile: {
|
||||
disallowSignUp,
|
||||
profile: { mode },
|
||||
},
|
||||
workspaceProfile: { enableSignup, mode },
|
||||
} = useAppSelector((state) => state.global);
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
@ -108,7 +105,7 @@ const SignIn: React.FC = () => {
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
{!disallowSignUp && (
|
||||
{enableSignup && (
|
||||
<p className="w-full mt-4 text-sm">
|
||||
<span>{"Don't have an account yet?"}</span>
|
||||
<Link to="/auth/signup" className="cursor-pointer ml-2 text-blue-600 hover:underline">
|
||||
|
@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import * as api from "../helpers/api";
|
||||
import useLoading from "../hooks/useLoading";
|
||||
import { globalService } from "../services";
|
||||
import { workspaceService } from "../services";
|
||||
import useUserStore from "../stores/v1/user";
|
||||
|
||||
const SignUp: React.FC = () => {
|
||||
@ -13,8 +13,8 @@ const SignUp: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const userStore = useUserStore();
|
||||
const {
|
||||
workspaceProfile: { disallowSignUp },
|
||||
} = globalService.getState();
|
||||
workspaceProfile: { enableSignup },
|
||||
} = workspaceService.getState();
|
||||
const [email, setEmail] = useState("");
|
||||
const [nickname, setNickname] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
@ -28,7 +28,7 @@ const SignUp: React.FC = () => {
|
||||
});
|
||||
}
|
||||
|
||||
if (disallowSignUp) {
|
||||
if (!enableSignup) {
|
||||
return navigate("/auth", {
|
||||
replace: true,
|
||||
});
|
||||
|
Reference in New Issue
Block a user