Jump to content
MakeWebGames

rockwood

Members
  • Posts

    461
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by rockwood

  1. really good approach
  2. how do you make guarantee it will be make enough income for divide. we are noticing only torn game from years. in my view not only 1 ot 2 people can make a good one. in my view for a good platform "team effort makes successful" from first day you can't make profilt from anything. my observation "patience and efforts works only"
  3. what was the cause for error?
  4. i like mafia games
  5. any one using React for development here?
  6. i am not sure what do means by secure here? make sure you are passing correct data type to and it's validated
  7. my point is code should be indent and reasonable instead this and that
  8. import { useState, useEffect, useContext } from "react"; import "../styles/LoginForm.scss"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faUser, faKey, faArrowAltCircleRight } from "@fortawesome/free-solid-svg-icons"; import { useForm } from "react-hook-form"; import Fetch from "../libraries/Fetch"; import Model from "./Model"; import RegistrationForm from "./RegistrationForm"; import ForgetPassword from "./ForgetPassword"; import { useNavigate, Link } from "react-router-dom"; import { AuthContext } from "../libraries/AuthContext"; const Login = () => { const { user, setUser } = useContext(AuthContext); const [showRegistrationModal, setRegistrationModal] = useState(false); const [showForgetModal, setForgetModal] = useState(false); const handleOK = (event) => { console.log(event); }; const { register, setError, formState: { errors }, handleSubmit, clearErrors, } = useForm(); const navigate = useNavigate(); const onSubmit = async (data) => { const result = await Fetch("auth/login", { method: "post", data }); if (result.user) { const userDetails = { userId: result.user.id, accessToken: result.access_token, loggedIn: true, }; setUser(userDetails); navigate("/dashboard"); } else { for (const [fieldName, errors] of Object.entries(result.errors)) { setError(fieldName, { type: "manual", message: errors[0], }); } setTimeout(() => { clearErrors(); }, 5000); } }; return ( <> <div> <span className="top" onClick={() => { setForgetModal(true); setRegistrationModal(false); }}> Recover Account </span> <form className="form-inline" method="post" onSubmit={handleSubmit(onSubmit)}> <div className="form-group"> <div className="input-group"> <span className="form-addon"> <FontAwesomeIcon icon={faUser} color="#63102f" size="xs" /> </span> <input type="email" placeholder="Username" {...register("email", { required: true })} /> </div> </div> <div className="form-group"> <div className="input-group"> <span className="form-addon"> <FontAwesomeIcon icon={faKey} color="#63102f" size="xs" /> </span> <input type="password" placeholder="Password" className="form-control" {...register("password", { required: true })} /> </div> </div> <div className="form-group"> <button type="submit" className="btn btn-primary"> <FontAwesomeIcon icon={faArrowAltCircleRight} color="red" size="xs" /> </button> </div> </form> <span className="bottom" onClick={() => { setRegistrationModal(true) setForgetModal(false); }}> Join Us </span> {errors.email && <p>{errors.email.message}</p>} </div> {showRegistrationModal ? ( <Model title="Singup" onCancel={() => setRegistrationModal(false)}> <RegistrationForm onOK={handleOK} /> </Model> ) : ( showForgetModal && ( <Model title="Forget Password" onCancel={() => setForgetModal(false)}> <ForgetPassword /> </Model> ) )} </> ); }; export default Login;
  9. please avoid this to use and try to use DI (Dependency Injection)
  10. rockwood

    Help required

    awesome if you don't mind, is it having improved code?
  11. https://stackoverflow.com/questions/37739509/paypal-ipn-always-returns-invalid try this way too
  12. rockwood

    Help required

    node will be good but in this type site php is enough
  13. yes i am in there
  14. why are you using Deprecated function on website --> https://www.php.net/manual/en/function.get-magic-quotes-gpc.php
  15. you have done excellent work but i am unable to activate my account at your website email is not coming
  16. really its very bad way for coding
  17. rockwood

    Romewars

    flex and media query works well for responsive with grid way don't worry soon you can see new way here
  18. conversion isn't gr8 idea now time for contribute for community
  19. i have seen every engine and all of em badly coded that why i am coding own engine (Laravel + React) and it will be modern
  20. don't mind we have weak engines (code wise) just we need to create good coded engines
  21. https://discord.gg/XDMeQjuP
  22. i have time for to do some work now days
  23. you need proper validation with try catch stuff
  24. i think, cache clear could be works here
×
×
  • Create New...