Commit 75a4d66ee9432d5360d8b7876d2c1563208cf25c

Authored by Vu Bui
1 parent 65001c6af5
Exists in master

update

Showing 1 changed file with 37 additions and 2 deletions Side-by-side Diff

... ... @@ -6,6 +6,8 @@ import BookingWizardStep from '../../components/BookingWizardStep'
6 6 import LoginStep from '../../components/Steps/Login';
7 7 import Services from '../../components/Steps/Services'
8 8 import PickTime from '../../components/Steps/PickTime'
  9 +import PickDoctor from '../../components/Steps/PickDoctor';
  10 +import Profile from '../../components/Steps/Profile';
9 11 import './styles.scss'
10 12 import { useCommonState, useCommonDispatch } from '../../store/common'
11 13  
... ... @@ -15,7 +17,7 @@ function BookingWizard(props) {
15 17 const commonStore = useCommonState()
16 18 const dispatch = useCommonDispatch()
17 19 const [cookies, setCookie, removeCookie] = useCookies('patient-dashboard')
18   - let { userProfile, accessToken } = cookies
  20 + let { accessToken } = cookies
19 21  
20 22 useEffect(() => {
21 23 console.log("check access token", accessToken)
... ... @@ -25,10 +27,17 @@ function BookingWizard(props) {
25 27 } else {
26 28 dispatch({ type: 'BW_ACTIVE_STEP', payload: localStorage.getItem('activeStep') })
27 29 }
28   -
29 30 }
30 31 }, [])
31 32  
  33 + useEffect(() => {
  34 + if(accessToken ===null ) {
  35 + localStorage.removeItem('bwSteps') // remove steps
  36 + localStorage.removeItem('bwDataBooking') // remove data booking
  37 + localStorage.setItem('activeStep','step-login') // remove active step
  38 + }
  39 + },[accessToken])
  40 +
32 41 useEffect(() => {
33 42 if (commonStore.activeStep !== null) {
34 43 setStep(commonStore.activeStep)
... ... @@ -95,6 +104,32 @@ function BookingWizard(props) {
95 104 </div>
96 105 </div>
97 106 </>
  107 + case 'step-pick-doctor':
  108 + return <>
  109 + <div className="bw-booking-modal-header">
  110 + <div className="bw-row">
  111 + <div className="bw-col-left">
  112 + <i className="bw-icon-health-doctor"></i>
  113 + <span>Confirm your doctor</span>
  114 + </div>
  115 + <div className="bw-col-right">
  116 + <button typ="button" className="bw-btn bw-btn-primary">
  117 + <i className="bw-icon-calling"></i>
  118 + Get Help
  119 + </button>
  120 + </div>
  121 + </div>
  122 + </div>
  123 + <div className="bw-booking-modal-content">
  124 + <div className="bw-booking-modal-inner">
  125 + <PickDoctor/>
  126 + </div>
  127 + </div>
  128 + </>
  129 + case 'step-profile':
  130 + return <>
  131 + <Profile />
  132 + </>
98 133 default:
99 134 break;
100 135 }