From ffd2c78b86111a5d1f7914e7dab4ffc946cb5287 Mon Sep 17 00:00:00 2001
From: rohan09-raj <rajrohan1914@gmail.com>
Date: Tue, 23 Aug 2022 14:39:22 +0530
Subject: check status feature

---
 client/src/pages/Update/UpdateSelect/UpdateSelect.jsx | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

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

diff --git a/client/src/pages/Update/UpdateSelect/UpdateSelect.jsx b/client/src/pages/Update/UpdateSelect/UpdateSelect.jsx
index 3c2edb3..3b6a717 100644
--- a/client/src/pages/Update/UpdateSelect/UpdateSelect.jsx
+++ b/client/src/pages/Update/UpdateSelect/UpdateSelect.jsx
@@ -1,13 +1,16 @@
 import { t } from 'i18next'
 import React from 'react'
-import { Link } from 'react-router-dom'
+import { Link, useNavigate } from 'react-router-dom'
 import Card from '../../../components/Card/Card'
 import Header from '../../../components/Header/Header'
 import SubmitButton from '../../../components/SubmitButton/SubmitButton'
+import { userContext } from '../../../context/User'
 
 import styles from './UpdateSelect.module.css'
 
 const UpdateSelect = () => {
+  const { userData, oriUserData } = userContext()
+  const navigate = useNavigate()
   return (
     <>
       <Header subheading={t('UPDATE')} />
@@ -24,9 +27,15 @@ const UpdateSelect = () => {
             image={`${process.env.PUBLIC_URL}/assets/images/biometrics.svg`}
           />
         </Link>
-        <Link to="/update/agreement">
-          <SubmitButton />
-        </Link>
+        <SubmitButton
+          onClick={() => {
+            if (userData === oriUserData) {
+              navigate('/no-update')
+            } else {
+              navigate('/update/agreement')
+            }
+          }}
+        />
       </div>
     </>
   )
-- 
cgit 

