QnA Ask Question#

frontend to ask question#

Basic for creating ask question, using this step:

  • Add step in askQuestionDialog.js under ToggleQnaBody

  • Add new Question step based on code below

  • Make sure handle checkout and prev correctly

/**
 * This is base to create ask question
 */
import { DialogContent } from "@mui/material";
import {connect} from "react-redux";
import QnaAction from "./qnaAction";

function ReviewCheckout(props){
  
  const handleCheckout = (e)=>{
    e.preventDefault()
    props.handleStepChange(true)
  }

  const handlePrev = (e) => {
    e.preventDefault();
    props.handleStepChange(false);
  }

  
  return (
    <DialogContent className="qnaDialog-body">
      <h1>Hello world</h1>
      
      <QnaAction 
        handlePrev={handlePrev}
        handleNext={handleCheckout}
      />
    </DialogContent>
  )
} 

const mapStateToProps = state => {
  const {question, coach} = state
  return {
    question,
    coach
  }
}

export default connect(
  mapStateToProps,
)(ReviewCheckout)