From c61bb49f58ca7fffa689725faf0c5f3fe9dcf8a3 Mon Sep 17 00:00:00 2001 From: Ajay_S Date: Tue, 3 May 2022 19:58:50 +0530 Subject: [PATCH] added hide timeslot to hide timeslot when backchevron is clicked --- src/components/timeSlot/TimeSlot.tsx | 7 ++++--- src/pages/finalInterview/FinalInterview.tsx | 10 +++++++--- src/pages/technicalInterview/TechnicalInterview.tsx | 9 +++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/timeSlot/TimeSlot.tsx b/src/components/timeSlot/TimeSlot.tsx index 610b6b9..837fe36 100644 --- a/src/components/timeSlot/TimeSlot.tsx +++ b/src/components/timeSlot/TimeSlot.tsx @@ -8,7 +8,8 @@ import { Dates, TimeSlots } from "../../mockData/TimeSlotDetails"; interface OwnProps { month: string; - getDate: (date: string) => void; + getDate: () => void; + HideTimeSlot: () => void; } const TimeSlot: React.FC = (props) => { @@ -49,7 +50,7 @@ const TimeSlot: React.FC = (props) => { return (
- +

Find a Slot

@@ -68,7 +69,7 @@ const TimeSlot: React.FC = (props) => { -
props.getDate("test") : undefined} +
props.getDate() : undefined} className={styles.timeSlotButton + " " + (highlightedDate && highlightedTime !== "" ? styles.buttonActive : "")}> Confirm slot
diff --git a/src/pages/finalInterview/FinalInterview.tsx b/src/pages/finalInterview/FinalInterview.tsx index 561ca23..a9505eb 100644 --- a/src/pages/finalInterview/FinalInterview.tsx +++ b/src/pages/finalInterview/FinalInterview.tsx @@ -17,12 +17,15 @@ const FinalInterview: React.FC = () => { const [days, hours, minutes, seconds] = useCountdown(addDays(new Date(), 3)); - const getDate = (date: string) => { - console.log(date); + const getDate = () => { setTimeSlot(false); setDate(true); } + const HideTimeSlot = () => { + setTimeSlot(false); + } + return ( @@ -77,7 +80,8 @@ const FinalInterview: React.FC = () => { isTimeSlot && + getDate={getDate} + HideTimeSlot={HideTimeSlot} /> } diff --git a/src/pages/technicalInterview/TechnicalInterview.tsx b/src/pages/technicalInterview/TechnicalInterview.tsx index 3e2464a..b125448 100644 --- a/src/pages/technicalInterview/TechnicalInterview.tsx +++ b/src/pages/technicalInterview/TechnicalInterview.tsx @@ -24,11 +24,15 @@ const TechnicalInterview: React.FC = () => { const [days, hours, minutes, seconds] = useCountdown(addDays(new Date(), 3)); - const getDate = (date: string) => { + const getDate = () => { setTimeSlot(false); setDate(true); } + const HideTimeSlot = () => { + setTimeSlot(false); + } + return ( @@ -88,7 +92,8 @@ const TechnicalInterview: React.FC = () => { isTimeSlot && + getDate={getDate} + HideTimeSlot={HideTimeSlot} /> }