From 4480f2d62865a585f8bbf0cd7122a25d0413bf2b Mon Sep 17 00:00:00 2001
From: rohan09-raj <rajrohan1914@gmail.com>
Date: Sun, 21 Aug 2022 01:46:36 +0530
Subject: fixed update components

---
 .../src/pages/Update/Demographic/Demographic.jsx   | 24 +++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

(limited to 'client/src/pages/Update/Demographic/Demographic.jsx')

diff --git a/client/src/pages/Update/Demographic/Demographic.jsx b/client/src/pages/Update/Demographic/Demographic.jsx
index 61fe972..0f89fe2 100644
--- a/client/src/pages/Update/Demographic/Demographic.jsx
+++ b/client/src/pages/Update/Demographic/Demographic.jsx
@@ -13,6 +13,7 @@ import UpdateSelect from '../UpdateSelect/UpdateSelect'
 import { useTranslation } from 'react-i18next'
 import { userContext } from '../../../context/User'
 import { ToastContainer, toast } from 'react-toastify'
+import BackButton from '../../../components/BackButton/BackButton'
 import 'react-toastify/dist/ReactToastify.css'
 
 const Demographic = () => {
@@ -87,13 +88,26 @@ const Demographic = () => {
   const conditionalButton = () => {
     switch (page) {
       case 0:
-        return <SubmitButton onClick={handleSubmit}>Next</SubmitButton>
+        return (
+          <>
+            <SubmitButton onClick={handleSubmit} />
+            <BackButton onClick={() => setPage(page - 1)} />
+          </>
+        )
       case 1:
-        return <SubmitButton onClick={handleSubmit}>Next</SubmitButton>
+        return (
+          <>
+            <SubmitButton onClick={handleSubmit} />
+            <BackButton onClick={() => setPage(page - 1)} />
+          </>
+        )
       case 2:
-        return <SubmitButton onClick={handleSubmit}>Next</SubmitButton>
-      default:
-        return <SubmitButton onClick={handleSubmit}>Next</SubmitButton>
+        return (
+          <>
+            <SubmitButton onClick={handleSubmit} />
+            <BackButton onClick={() => setPage(page - 1)} />
+          </>
+        )
     }
   }
   return (
-- 
cgit 

