Compare commits

...

12 Commits

Author SHA1 Message Date
victorAnumudu 795e834e47 added google login interface 2023-05-25 20:00:13 +01:00
ameye 47bfc65f09 Merge branch 'enable-and-active-jobs' of WrenchBoard/Users-Wrench into master 2023-05-25 11:19:05 +00:00
Ebube 87c0922974 . 2023-05-25 12:17:52 +01:00
Ebube c46e94cd88 updated endpoint 2023-05-25 10:06:56 +01:00
Ebube 4f0d079bfe Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into enable-and-active-jobs 2023-05-25 08:49:01 +01:00
Ebube 88d2f7313c . 2023-05-25 08:48:41 +01:00
ameye 6f9c244966 Merge branch 'login-bug' of WrenchBoard/Users-Wrench into master 2023-05-24 21:41:38 +00:00
victorAnumudu 65b58a6e6f set login error to false once continue btn is clicked 2023-05-24 22:39:12 +01:00
victorAnumudu fec4644300 login type bug fixed 2023-05-24 22:34:47 +01:00
victorAnumudu 8b99ec1ab8 login type bug fixed 2023-05-24 22:29:04 +01:00
CHIEFSOFT\ameye 69fb6ba913 fix wallets 2023-05-24 17:23:16 -04:00
ameye 73a14ba0ec Merge branch 'manage-family-page' of WrenchBoard/Users-Wrench into master 2023-05-24 19:34:03 +00:00
13 changed files with 102 additions and 101 deletions
+2
View File
@@ -34,5 +34,7 @@ REACT_APP_ITEM_PER_PAGE=5
# Empty Listings
REACT_APP_ZERO_STATE=0
REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
#apigate.orion.g1.wrenchboard.com:76.209.103.227
+2
View File
@@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
#apigate.orion.g1.wrenchboard.com:76.209.103.227
REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
+2
View File
@@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5
#apigate.orion.g1.wrenchboard.com:76.209.103.227
#apigate.orion.g1.wrenchboard.com:76.209.103.227
REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
+1 -1
View File
@@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
export default function LoginLayout({ slogan, children }) {
return (
<div className={`layout-wrapper login`}>
<div className={`main-wrapper login-wrapper w-full h-screen overflow-y-auto sm:p-20 p-10`}>
<div className={`main-wrapper login-wrapper w-full h-screen overflow-y-auto p-2 sm:p-20`}>
<div className="w-full h-full">
<div className="flex-1 flex justify-center items-center">
{children && children}
+65 -40
View File
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import linkedInLogo from "../../../assets/images/Linkedin.png";
import appleLogo from "../../../assets/images/apple-black.svg";
@@ -8,8 +8,8 @@ import WrenchBoard from "../../../assets/images/wrenchboard.png";
import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import AuthLayout from "../AuthLayout";
//import { GoogleOAuthProvider } from '@react-oauth/google';
// import { googleLogout, useGoogleLogin } from '@react-oauth/google';
// import { GoogleOAuthProvider } from '@react-oauth/google';
import { googleLogout, useGoogleLogin } from '@react-oauth/google';
import { useDispatch } from "react-redux";
import { updateUserDetails } from "../../../store/UserDetails";
@@ -17,7 +17,7 @@ import { updateUserDetails } from "../../../store/UserDetails";
export default function Login() {
const dispatch = useDispatch();
let [loginCom, setLoginCom] = useState({ user: true, family: false });
let [loginType, setLoginType] = useState({ full: true, family: false });
const [checked, setValue] = useState(false);
const [loginLoading, setLoginLoading] = useState(false);
@@ -32,11 +32,11 @@ export default function Login() {
};
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
const handleLoginCom = ({ target: { name } }) => {
if (name == "user") {
setLoginCom({ [name]: true, family: false });
} else {
setLoginCom({ [name]: false, family: true });
const handleLoginType = ({ target: { name } }) => {
if (name == "full") {
setLoginType({ [name]: true, family: false });
} else if(name='family') {
setLoginType({ [name]: false, family: true });
}
};
@@ -56,8 +56,9 @@ export default function Login() {
// FUNCTION TO HANDLE USER LOGIN
const doLogin = ({ target: { name } }) => {
setMsgError("");
setLoginError(false)
setLoginLoading(true);
let postData = {}; // Post Data for API
let postData; // Post Data for API
if (!email || !password) {
setLoginLoading(false);
setMsgError("Please fill all the fields");
@@ -67,14 +68,15 @@ export default function Login() {
return;
}
if (name == "userlogin") { // Post Data Info for normal Login
if (name == "loginfull") { // Post Data Info for normal Login
postData = {
username: email,
password: password,
sessionid: "STARTING",
login_mode: 1100,
action: 11025,
};
} else if (name == "familylogin") { // Post Data Info for family Login
} else if (name == "loginfamily") { // Post Data Info for family Login
postData = {
username: email,
pin: password,
@@ -82,8 +84,14 @@ export default function Login() {
login_mode: 1105,
action: 11025,
};
}else{
setLoginLoading(false);
setMsgError("Invalid Login Type. Consider refreshing the page");
setTimeout(() => {
setMsgError("");
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
return;
}
userApi.logInUser(postData).then((res) => {
if (res.status != 200 || res.data.internal_return < 0) {
// setMsgError("Wrong, email/password");
@@ -112,6 +120,23 @@ export default function Login() {
});
};
const googleLogin = useGoogleLogin({
onSuccess: async (tokenResponse) => {
console.log(tokenResponse);
// const userInfo = await axios.get(
// 'https://www.googleapis.com/oauth2/v3/userinfo',
// { headers: { Authorization: `Bearer ${tokenResponse.access_token}` } },
// );
// console.log(userInfo);
},
onError: errorResponse => console.log(errorResponse),
});
useEffect(()=>{
setMail('')
setPassword('')
},[loginType.full, loginType.family])
return (
<>
<AuthLayout slogan="Welcome to WrenchBoard">
@@ -145,20 +170,20 @@ export default function Login() {
{/* switch login component */}
<div className="flex justify-start items-end">
<button
name="user"
name="full"
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-r-0 border-[#4687ba] ${
loginCom.user && "border-r-2 h-[45px]"
loginType.full && "border-r-2 h-[45px]"
}`}
onClick={handleLoginCom}
onClick={handleLoginType}
>
Sign in
</button>
<button
name="family"
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-l-0 border-[#4687ba] ${
loginCom.family && "border-l-2 h-[45px]"
loginType.family && "border-l-2 h-[45px]"
}`}
onClick={handleLoginCom}
onClick={handleLoginType}
>
Family
</button>
@@ -168,13 +193,13 @@ export default function Login() {
{/* for login component */}
{
loginCom.user ? (
loginType.full ? (
//user login compoenent
<div className="p-2 input-area border-2 border-[#4687ba]">
<div className="input-item mb-5">
<InputCom
labelClass="tracking-wider"
fieldClass="px-6"
fieldClass="sm:px-6 px-2"
value={email}
inputHandler={handleEmail}
placeholder="support@mermsemr.com"
@@ -188,7 +213,7 @@ export default function Login() {
<div className="input-item mb-5">
<InputCom
labelClass="tracking-wider"
fieldClass="px-6"
fieldClass="sm:px-6 px-2"
value={password}
inputHandler={handlePassword}
placeholder="● ● ● ● ● ●"
@@ -219,7 +244,7 @@ export default function Login() {
<div className="signin-area mb-3.5">
<div className="flex justify-center">
<button
name="userlogin"
name="loginfull"
onClick={doLogin}
type="button"
disabled={loginLoading}
@@ -228,12 +253,12 @@ export default function Login() {
{loginLoading ? (
<div className="signup btn-loader"></div>
) : (
<span>Continue</span>
<>Continue</>
)}
</button>
</div>
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
<BrandBtn link="#" imgSrc={googleLogo} brand="Google" />
<BrandBtn link="#" imgSrc={googleLogo} brand="Google" onClick={googleLogin} />
<BrandBtn link="#" imgSrc={appleLogo} brand="Apple" />
</div>
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
@@ -302,7 +327,7 @@ export default function Login() {
<div className="signin-area mb-1.5">
<div className="flex justify-center">
<button
name="familylogin"
name="loginfamily"
onClick={doLogin}
disabled={loginLoading}
type="button"
@@ -311,7 +336,7 @@ export default function Login() {
{loginLoading ? (
<div className="signup btn-loader"></div>
) : (
<span>Continue</span>
<>Continue</>
)}
</button>
</div>
@@ -334,10 +359,10 @@ export default function Login() {
);
}
const BrandBtn = ({ link, imgSrc, brand }) => {
const doGoogle = async () => {
alert("start google");
};
const BrandBtn = ({ link, imgSrc, brand, onClick }) => {
// const doGoogle = async () => {
// alert("start google");
// };
// onSuccess: (codeResponse) => setUser(codeResponse),
@@ -346,26 +371,26 @@ const BrandBtn = ({ link, imgSrc, brand }) => {
// onError: (error) => console.log('Login Failed:', error)
// });
const doApple = async () => {
alert("start apple");
};
// const doApple = async () => {
// alert("start apple");
// };
const doFacebook = async () => {
alert("start facebook");
};
// const doFacebook = async () => {
// alert("start facebook");
// };
return (
<div className="w-full sm:w-1/2 flex justify-center bottomMargin">
<a
// onClick={doGoogle}
href="#dd"
<button
onClick={onClick}
// href="#dd"
className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer"
>
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
<span className="text-lg text-thin-light-gray font-normal text-[15px]">
Continue with {brand}
</span>
</a>
</button>
</div>
);
};
+1 -1
View File
@@ -47,7 +47,7 @@ export default function FamilyActiveLSlde({ className, trending }) {
<div>
<h1 className="text-26 font-bold text-dark-gray dark:text-white">Current Tasks</h1>
</div>
<div className="slider-btns flex space-x-4">
<div className="slider-btns flex space-x-3">
<button onClick={nextHandler} type="button">
<div className="trending-slider-left-btn relative text-white w-10 h-10 flex justify-center items-center rounded-full overflow-hidden">
<svg
+3 -13
View File
@@ -1,14 +1,6 @@
import React from "react";
import datas from "../../data/product_data.json";
import Layout from "../Partials/Layout";
import CreateNft from "./CreateNft";
import Hero from "./Hero";
import SellHistoryMarketVisitorAnalytic from "./SellHistoryMarketVisitorAnalytic";
import TopSellerTopBuyerSliderSection from "./TopSellerTopBuyerSliderSection";
import TrendingSection from "./TrendingSection";
import UpdateTable from "./UpdateTable";
import HomeTaskDisplay from "./HomeTaskDisplay";
import UsersService from "../../services/UsersService";
import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
import FamilyDash from "./FamilyDash";
@@ -19,12 +11,10 @@ export default function Home(props) {
console.log("PROPS IN HOME->",props);
const trending = datas.datas;
const jobData = datas.datas; // api calls or cache
//getHomeDate
// const trending = datas.datas;
// const jobData = datas.datas; // api calls or cache
const userApi = new usersService();
const homeData = userApi.getHomeDate();
// const homeData = userApi.getHomeDate();
const {userDetails} = useSelector((state) => state?.userDetails)
const commonHeadData =()=>{
-23
View File
@@ -15,10 +15,6 @@ export default function StartJob(props) {
const navigate = useNavigate()
let [request, setRequest] = useState({loading: false, status: false, message: ''})
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
const handleOnclick = () => {
setRequest({loading: true, status: false, message: ''})
@@ -42,25 +38,6 @@ export default function StartJob(props) {
{/*<CommonHead />*/}
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
{/* <div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Additional Terms for Jobs Posting.
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div onClick={() => filterHandler("today")} className="relative">
</div>
</div>
</div> */}
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px]`}
>
+17 -9
View File
@@ -10,7 +10,7 @@ function Balance({wallet, coupon}) {
<div className="content-wrapper">
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/* WALLET SECTION */}
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
<div className='flex items-baseline justify-between'>
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>
@@ -42,9 +42,11 @@ function Balance({wallet, coupon}) {
<div className='w-full my-2 md:my-0 md:w-1/2 flex space-x-2 items-center justify-start md:justify-end'>
{
item.action_type != 'AC_AD_FD_ONLY' ?
<Link to='transfer-fund' className='text-base text-white px-3 py-1 bg-purple rounded-md hover:opacity-80'>Transfer</Link>:''
<Link to='transfer-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
items-center rounded-full relative bg-purple pr-1.5 pl-4'>Transfer</Link>:''
}
<Link to='add-fund' className='text-base text-white px-3 py-1 bg-[orange] rounded-md hover:opacity-80'>Top Up</Link>
<Link to='add-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
items-center rounded-full relative bg-purple pr-1.5 pl-4'>+Add Credit</Link>
</div>
</div>
))
@@ -68,19 +70,25 @@ function Balance({wallet, coupon}) {
{/* END OF WALLET SECTION */}
</div>
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/* COUPON SECTION */}
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Coupons</h2>
{coupon.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<CouponTable coupon={coupon} />
{coupon.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<CouponTable coupon={coupon} />
}
</div>
</div>
{/* END OF COUPON SECTION */}
</div>
</div>
</div>
)
}
+2 -11
View File
@@ -12,7 +12,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
const darkMode = useContext(DarkModeContext);
let { userDetails } = useSelector((state) => state.userDetails);
console.log(userDetails);
console.log('user-details for job',userDetails);
//const jobLists = getJobList(); // pass from upper - we need in a lot of places
let { jobLists } = useSelector((state) => state.jobLists);
const marketData = jobLists?.result_list;
@@ -29,7 +29,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
elm.classList.remove("active");
});
}
});
}, [jobLists]);
return (
<div className="w-full h-full">
{/* logo-area */}
@@ -167,15 +167,6 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
sidebar ? "mb-14" : "rounded-none p-0"
}`}
>
{/* <div className="setting-item">
<div className="top-platform bg-pink dark:bg-dark-white rounded-2xl p-16 2xl:w-[180px] w-full 2xl:mb-10 2xl:border-none border">
<NavLink to="/start-job">
<span className="item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium active flex-1">
Enable Job Post
</span>
</NavLink>
</div>
</div> */}
<div className="items">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
+5 -1
View File
@@ -6,11 +6,15 @@ import App from "./App";
import "./index.css";
import store from "./store/store";
import { GoogleOAuthProvider } from '@react-oauth/google';
const root = document.getElementById("root");
ReactDOM.createRoot(root).render(
<BrowserRouter>
<Provider store={store}>
<App />
<GoogleOAuthProvider clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}>
<App />
</GoogleOAuthProvider>
</Provider>
</BrowserRouter>
);
+1 -1
View File
@@ -77,7 +77,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
// Getting market data
const getMarketActiveJobList = async () => {
try {
const res = await apiCall.getActiveJobList();
const res = await apiCall.getMyJobList();
dispatch(updateJobs(res.data));
} catch (error) {
console.log("Error getting mode");
+1 -1
View File
@@ -97,7 +97,7 @@ class usersService {
*/
getActiveJobList() {
var postData = {
uuid: localStorage.getItem("uid"),
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
page: 0,