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(); |
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, {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 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 {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 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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider} from 'react-redux'; | |
import { store } from './Store/'; | |
import App from './App'; | |
import reportWebVitals from './reportWebVitals'; | |
ReactDOM.render( | |
<React.StrictMode> | |
<Provider store={store}> |
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 { combineReducers } from "redux"; | |
import { configureStore } from "@reduxjs/toolkit"; | |
import UserSlice from './UserSlice'; | |
const rootReducer = combineReducers({ | |
user: UserSlice | |
}); | |
export const store = configureStore({ | |
reducer: rootReducer, |
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
/* eslint-disabled */ | |
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit"; | |
export const getSettings = store => { | |
return store.getState(); | |
}; | |
export const signupUser = createAsyncThunk( | |
'user/signup', | |
async ({ email, password }, thunkAPI) => { | |
try { |
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) => { |
NewerOlder