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 cors from 'cors'; | |
import morgan from "morgan"; | |
import { Low, JSONFile } from 'lowdb'; | |
import userRouter from './users.js'; | |
import { nanoid } from 'nanoid'; | |
const adapter = new JSONFile("db.json"); | |
const db = new Low(adapter); | |
db.data = ({ users: [ |
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
{ | |
"name": "server", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "nodemon index --ignore db.json" | |
}, | |
"author": "", | |
"license": "ISC", |
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
function Step2({ | |
FormContext | |
}) { | |
/** | |
* Context Store | |
*/ | |
const { | |
step2Answered, | |
setStep2Answered, |
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 Box from '@mui/material/Box'; | |
import InputLabel from '@mui/material/InputLabel'; | |
import MenuItem from '@mui/material/MenuItem'; | |
import FormControl from '@mui/material/FormControl'; | |
import Select from '@mui/material/Select'; | |
import Typography from '@mui/material/Typography'; |
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 { FormContextProvider } from './FormContext'; | |
import Stepper from './Stepper'; | |
/** | |
* Form Context Store | |
*/ | |
function SelectStepper() { | |
return ( | |
<FormContextProvider> |
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 [step1Answered, setStep1Answered] = useState(false); | |
const [step2Answered, setStep2Answered] = useState(false); | |
const [step3Answered, setStep3Answered] = useState(false); | |
const [finished, setFinished] = useState(false); | |
const [stepData, setStepData] = useState({ | |
step1: { |
NewerOlder