From 6ae695c9c751968c0e0ecc316f0e04688fe090ac Mon Sep 17 00:00:00 2001 From: mcarre20 Date: Mon, 6 Nov 2023 16:18:28 -0500 Subject: [PATCH] view button survey if survey is completed --- .../front/src/pages/Admin/home/HomeProfile.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/front/src/pages/Admin/home/HomeProfile.js b/frontend/front/src/pages/Admin/home/HomeProfile.js index 57d9588c..0bcb5e56 100644 --- a/frontend/front/src/pages/Admin/home/HomeProfile.js +++ b/frontend/front/src/pages/Admin/home/HomeProfile.js @@ -1,4 +1,4 @@ -import { Alert, Box, Button, TextField, Typography } from "@mui/material"; +import { Alert, Box, Button, Link, TextField, Typography } from "@mui/material"; import React, { useEffect, useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { useNavigate, useParams } from "react-router-dom"; @@ -59,6 +59,10 @@ const HomeProfile = () => { const modalCloseHandler = () => { setModalIsOpen(false); }; + + const viewSurveyhandler = () => { + navigate(`/admin/survey/visit/${homeData.survey_visit_ids[0]}`); + }; const deleteHandler = () => { setModalIsOpen(false); deleteHome(homeData) @@ -275,13 +279,17 @@ const HomeProfile = () => { )} {/* BUTTONS */} - {/* - - */} + {homeData.completed && ( + + )} {editButton} {saveButton} {deleteButton}