diff --git a/src/views/Auth/Desktop/index.js b/src/views/Auth/Desktop/index.js index 8942c93..402e877 100644 --- a/src/views/Auth/Desktop/index.js +++ b/src/views/Auth/Desktop/index.js @@ -1,90 +1,29 @@ -import React, { useState, useEffect } from "react"; +import { useState, useEffect, useMemo, useCallback } from "react"; import { connect } from "react-redux"; import { publicApi } from "../../../redux/actions"; import { useNavigate } from "react-router-dom"; import SignUp from "../SignUp"; -import Button from "../../../components/Button"; //assets -import logoIcon from "../SignUp/assets/logo.svg"; import bgImage from "./bg.svg"; -import arrowIcon from "../../../assets/icons/dropdown-blue.svg"; -export const Desktop = ({ setHeaderOptions }) => { - const [phase, setPhase] = useState("signup"); +export const Desktop = ({ setHeaderOptions, level, setLevel}) => { const navigate = useNavigate(); useEffect(() => { setHeaderOptions({ show: false }); }, []); - const UserMangement = () => { - return ( -
- - - {window.t("ورود یا ثبت نام")} - -

- {window.t(" کاربر گرامی لطفا یکی از دوگزینه زیر را انتخاب نمائید.")} -
- {window.t("درصورتی که عضو نیستید روی دکمه ثبت نام بزنید")} -

-
-
-
- ); - }; - - const phases = { - manage: , - signup: , - login: , - }; - return (
- - {phases[phase]} + +
diff --git a/src/views/Auth/SignUp/index.js b/src/views/Auth/SignUp/index.js index 91920ef..badd0a6 100644 --- a/src/views/Auth/SignUp/index.js +++ b/src/views/Auth/SignUp/index.js @@ -11,6 +11,8 @@ import { user, publicApi } from "../../../redux/actions"; import _ from "lodash"; //assets import logoIcon from "./assets/logo.svg"; +import arrowIcon from "../../../assets/icons/dropdown-blue.svg"; + function SignUp({ sendOtp, @@ -20,8 +22,9 @@ function SignUp({ headerOptions, setHeaderOptions, loading, + level, + setLevel, }) { - const [level, setLevel] = useState("phonenumber"); const [signUpFields, setSignUpFiels] = useState({}); const [error, setError] = useState(""); const [resend, setResend] = useState(false); @@ -142,6 +145,14 @@ function SignUp({ className="w-screen overflow-x-hidden flex flex-row transform -translate-y-10 relative" style={{ height: "calc(100vh - 160px)" }} > +
diff --git a/src/views/Auth/index.js b/src/views/Auth/index.js index 3c1817c..6a03c68 100644 --- a/src/views/Auth/index.js +++ b/src/views/Auth/index.js @@ -6,20 +6,29 @@ import { connect } from "react-redux"; function Auth(props) { const [page, setPage] = useState(props.page); + const [level, setLevel] = useState("phonenumber"); + useEffect(() => { setPage(() => props.page); }, [props.page]); return props.isMobile ? ( <> {page === "signup" && ( - + )} {page === "profile" && } - ) : + ) : ( + + ); } export default connect((state) => ({ theme: state.publicApi.theme, - isMobile: state.publicApi.isMobile + isMobile: state.publicApi.isMobile, }))(Auth);