This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Controller } from 'react-hook-form'; | |
import TextField from '@mui/material/TextField'; | |
function defaultTextField({ | |
fieldName, | |
fieldType, | |
control, | |
register, | |
label, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createContext, useState} from 'react'; | |
export const FormContext = createContext(); | |
export const FormContextProvider = ({children}) => { | |
const [email, setEmail] = useState(); | |
const [password, setPassword] = useState(); | |
const [step1, setStep1Finished ] = useState(false); | |
const [finished, setFinished] = useState(false); | |
const formContextValues = { | |
email, setEmail, | |
password, setPassword, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import { nanoid } from 'nanoid'; | |
const idLength = 8; | |
const router = express.Router(); | |
/*** | |
* List all pusers | |
*/ | |
router.get("/", (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Fragment, useEffect, useState, useContext} from 'react'; | |
import { useNavigate } from 'react-router-dom'; | |
import { FormContext } from './FormContext'; | |
import { useSelector, useDispatch } from 'react-redux'; | |
import { loginUser, clearFetchStatus } from '../../Store/UserSlice'; | |
import StepperBody from '../StepperBody'; | |
import toast from 'react-hot-toast'; | |
const steps = ['Your email', 'Your Password']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useContext } from 'react'; | |
import { useForm } from 'react-hook-form'; | |
import { yupResolver } from '@hookform/resolvers/yup'; | |
import * as yup from "yup"; | |
import { Box, Typography } from '@mui/material'; | |
import { Email } from '../../../inputs'; | |
const formSchema = yup.object({ | |
email: yup.string().email('Must be a valid email').required('Email is required'), | |
}).required(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useContext } from 'react'; | |
import { useForm } from 'react-hook-form'; | |
import { yupResolver } from '@hookform/resolvers/yup'; | |
import * as yup from "yup"; | |
import { Box, Typography } from '@mui/material'; | |
import { Password } from '../../../inputs'; | |
const formSchema = yup.object({ | |
password: yup.string().required('Password is required').min(8).max(16), | |
}).required(); |
OlderNewer