diff --git a/src/components/AuthPages/AuthProfile/index.jsx b/src/components/AuthPages/AuthProfile/index.jsx
index 4db9d25..a16098f 100644
--- a/src/components/AuthPages/AuthProfile/index.jsx
+++ b/src/components/AuthPages/AuthProfile/index.jsx
@@ -1,63 +1,63 @@
-import React, { useState } from "react";
+import React from "react";
import { Link } from "react-router-dom";
import authProfilePic from "../../../assets/images/auth-profile-picture.png";
import profileBanner from "../../../assets/images/profile-cover.png";
-import collections from "../../../data/collectionplan_data.json";
-import marketPlace from "../../../data/marketplace_data.json";
-import products from "../../../data/product_data.json";
import Layout from "../../Partials/Layout";
import ActivitiesTab from "./ActivitiesTab";
-import CollectionTab from "./CollectionTab";
-import CreatedTab from "./CreatedTab";
-import HiddenProductsTab from "./HiddenProductsTab";
-import OnSaleTab from "./OnSaleTab";
-import OwnTab from "./OwnTab";
+// import collections from "../../../data/collectionplan_data.json";
+// import marketPlace from "../../../data/marketplace_data.json";
+// import products from "../../../data/product_data.json";
+// import CollectionTab from "./CollectionTab";
+// import CreatedTab from "./CreatedTab";
+// import HiddenProductsTab from "./HiddenProductsTab";
+// import OnSaleTab from "./OnSaleTab";
+// import OwnTab from "./OwnTab";
export default function AuthProfile() {
- const onSaleProducts = marketPlace.data;
- const CreatedSell = marketPlace.data;
- const CreatedBits = products.datas;
+ // const onSaleProducts = marketPlace.data;
+ // const CreatedSell = marketPlace.data;
+ // const CreatedBits = products.datas;
// const mainProducts = products.datas;
- const ownProducts = products.datas;
- const collectionProducts = collections.data;
+ // const ownProducts = products.datas;
+ // const collectionProducts = collections.data;
- const tabs = [
- {
- id: 1,
- name: "onsale",
- content: "On Sale",
- },
- {
- id: 2,
- name: "owned",
- content: "Owned",
- },
- {
- id: 3,
- name: "created",
- content: "Created",
- },
- {
- id: 4,
- name: "hidden",
- content: "Hidden",
- },
- {
- id: 5,
- name: "collection",
- content: "Collection",
- },
- {
- id: 6,
- name: "activity",
- content: "Activity",
- },
- ];
+ // const tabs = [
+ // {
+ // id: 1,
+ // name: "onsale",
+ // content: "On Sale",
+ // },
+ // {
+ // id: 2,
+ // name: "owned",
+ // content: "Owned",
+ // },
+ // {
+ // id: 3,
+ // name: "created",
+ // content: "Created",
+ // },
+ // {
+ // id: 4,
+ // name: "hidden",
+ // content: "Hidden",
+ // },
+ // {
+ // id: 5,
+ // name: "collection",
+ // content: "Collection",
+ // },
+ // {
+ // id: 6,
+ // name: "activity",
+ // content: "Activity",
+ // },
+ // ];
- const [tab, setTab] = useState(tabs[0].name);
- const tabHandler = (value) => {
- setTab(value);
- };
+ // const [tab, setTab] = useState(tabs[0].name);
+ // const tabHandler = (value) => {
+ // setTab(value);
+ // };
return (
<>
diff --git a/src/components/AuthPages/AuthRedirect/AppleRedirect.jsx b/src/components/AuthPages/AuthRedirect/AppleRedirect.jsx
index 826560b..e80ad04 100644
--- a/src/components/AuthPages/AuthRedirect/AppleRedirect.jsx
+++ b/src/components/AuthPages/AuthRedirect/AppleRedirect.jsx
@@ -1,15 +1,15 @@
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
-import usersService from '../../../services/UsersService';
-import {updateUserDetails} from "../../../store/UserDetails";
-import { useDispatch } from "react-redux";
+// import usersService from '../../../services/UsersService';
+// import {updateUserDetails} from "../../../store/UserDetails";
+// import { useDispatch } from "react-redux";
import AuthLayout from "../AuthLayout";
function AppleRedirect() {
const location = useLocation();
const navigate = useNavigate();
- const userApi = new usersService();
- const dispatch = useDispatch()
+ // const userApi = new usersService();
+ // const dispatch = useDispatch()
const queryParams = new URLSearchParams(location?.search);
const codeResponse = queryParams.get("code");
@@ -36,11 +36,11 @@ function AppleRedirect() {
redirect_uri=https%3A//oauth2.example.com/code&
grant_type=authorization_code
*/
- var reqData = {
- auth_type: "APPLE",
- code: codeResponse,
- redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
- };
+ // var reqData = {
+ // auth_type: "APPLE",
+ // code: codeResponse,
+ // redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
+ // };
// userApi
// .authStart(reqData)
// .then((res) => {
@@ -58,7 +58,7 @@ function AppleRedirect() {
// navigate('/login', {state: {error: true}})
// console.log(error);
// });
- },[])
+ },[codeResponse, navigate])
return (
Redirecting ...
diff --git a/src/components/AuthPages/AuthRedirect/FbookRedirect.jsx b/src/components/AuthPages/AuthRedirect/FbookRedirect.jsx
index 117c818..0cc40e9 100644
--- a/src/components/AuthPages/AuthRedirect/FbookRedirect.jsx
+++ b/src/components/AuthPages/AuthRedirect/FbookRedirect.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React, { useMemo, useEffect } from 'react';
import { useDispatch } from "react-redux";
import { useLocation, useNavigate } from 'react-router-dom';
import usersService from '../../../services/UsersService';
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout";
function FbookRedirect() {
const location = useLocation();
const navigate = useNavigate();
- const userApi = new usersService();
+ const userApi = useMemo(()=>{new usersService()},[]);
const dispatch = useDispatch()
const queryParams = new URLSearchParams(location?.search);
@@ -52,7 +52,7 @@ function FbookRedirect() {
userApi
.authStart(reqData)
.then((res) => {
- if (res.status == 200 && res.data.internal_return >= 0 && res.data.member_id && res.data.uid && res.data.session) {
+ if (res.status === 200 && res.data.internal_return >= 0 && res.data.member_id && res.data.uid && res.data.session) {
localStorage.setItem("member_id", `${res.data.member_id}`);
localStorage.setItem("uid", `${res.data.uid}`);
localStorage.setItem("session_token", `${res.data.session}`);
@@ -66,7 +66,7 @@ function FbookRedirect() {
navigate('/login', {state: {error: true}})
console.log(error);
});
- },[])
+ },[codeResponse, userApi, dispatch, navigate])
return (
Redirecting ...
diff --git a/src/components/AuthPages/AuthRedirect/Redirect.jsx b/src/components/AuthPages/AuthRedirect/Redirect.jsx
index 607cd60..23679df 100644
--- a/src/components/AuthPages/AuthRedirect/Redirect.jsx
+++ b/src/components/AuthPages/AuthRedirect/Redirect.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect } from "react";
+import React, { useEffect, useMemo } from "react";
import { useDispatch } from "react-redux";
import { useLocation, useNavigate } from "react-router-dom";
import usersService from "../../../services/UsersService";
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout";
function Redirect() {
const location = useLocation();
const navigate = useNavigate();
- const userApi = new usersService();
+ const userApi = useMemo(()=>{new usersService()},[]);
const dispatch = useDispatch();
const queryParams = new URLSearchParams(location?.search);
@@ -40,7 +40,7 @@ function Redirect() {
.authStart(reqData)
.then((res) => {
if (
- res.status == 200 &&
+ res.status === 200 &&
res.data.internal_return >= 0 &&
res.data.member_id &&
res.data.uid &&
@@ -59,7 +59,7 @@ function Redirect() {
navigate("/login", { state: { error: true } });
console.log(error);
});
- }, []);
+ }, [codeResponse, userApi, dispatch, navigate]);
return (
Redirecting ...
diff --git a/src/components/AuthPages/ForgotPassword/index.jsx b/src/components/AuthPages/ForgotPassword/index.jsx
index ad6ebb5..4978600 100644
--- a/src/components/AuthPages/ForgotPassword/index.jsx
+++ b/src/components/AuthPages/ForgotPassword/index.jsx
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
}
const resetHandler = async () => {
- if (email == "") {
+ if (email === "") {
setMsgError("An email is required");
return setTimeout(() => {
setMsgError(null);
diff --git a/src/components/AuthPages/ForgotPassword/index2.jsx b/src/components/AuthPages/ForgotPassword/index2.jsx
index 9c832a6..3d76c3b 100644
--- a/src/components/AuthPages/ForgotPassword/index2.jsx
+++ b/src/components/AuthPages/ForgotPassword/index2.jsx
@@ -1,6 +1,6 @@
import React, { useState } from "react";
-import { Link, useNavigate } from "react-router-dom";
-import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
+import { useNavigate } from "react-router-dom";
+// import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import AuthLayout from "../AuthLayout2";
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
}
const resetHandler = async () => {
- if (email == "") {
+ if (email === "") {
setMsgError("An email is required");
return setTimeout(() => {
setMsgError(null);