-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* calendar component added on leave management * month view width fixed on mobile screens * holiday list updated from timeoffHolidays to admin created holidays --------- Co-authored-by: Shruti Apte <shruti@saeloun.com> Co-authored-by: Apoorv Tiwari <tiwari.apoorv1316@gmail.com>
- Loading branch information
1 parent
ab40c90
commit 816c9cc
Showing
11 changed files
with
304 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import React from "react"; | ||
|
||
import { XIcon } from "miruIcons"; | ||
import { Button, Modal } from "StyledComponents"; | ||
|
||
import CustomYearPicker from "common/CustomYearPicker"; | ||
import { MobileEditHeader } from "common/Mobile/MobileEditHeader"; | ||
import { yearCalendar } from "constants/leaveType"; | ||
import { useUserContext } from "context/UserContext"; | ||
|
||
import CalendarComponent from "./CalendarComponent"; | ||
|
||
const HolidayModal = ({ | ||
tileContent, | ||
toggleCalendarModal, | ||
showCalendar, | ||
currentYear, | ||
setCurrentYear, | ||
}) => { | ||
const { isDesktop } = useUserContext(); | ||
|
||
const CalendarForm = () => ( | ||
<div className="modal__form flex-col bg-white lg:px-4"> | ||
<div className="mt-3 flex w-full items-center justify-between lg:justify-end"> | ||
<div className="flex flex-row items-center"> | ||
<div className="mr-4 flex flex-row items-center text-xs font-medium lg:text-sm"> | ||
<div className="mr-2 h-4 w-4 rounded-2xl bg-miru-chart-pink-600" /> | ||
Holidays | ||
</div> | ||
<div className="flex flex-row items-center text-xs font-medium lg:text-sm"> | ||
<div className="mr-2 h-4 w-4 rounded-2xl bg-miru-gray-800" /> | ||
Optional Holidays | ||
</div> | ||
</div> | ||
<CustomYearPicker | ||
currentYear={currentYear} | ||
setCurrentYear={setCurrentYear} | ||
wrapperClassName="text-miru-han-purple-1000 flex items-center justify-end lg:hidden text-sm" | ||
/> | ||
</div> | ||
{Object.keys(yearCalendar).map((quarters, key) => ( | ||
<div className="flex flex-col gap-4 pt-4 lg:flex-row" key={key}> | ||
{yearCalendar[quarters].quarter.map((month, key) => ( | ||
<CalendarComponent | ||
id={month.id} | ||
key={key} | ||
name={month.name} | ||
tileContent={tileContent} | ||
year={currentYear} | ||
/> | ||
))} | ||
</div> | ||
))} | ||
</div> | ||
); | ||
|
||
if (isDesktop) { | ||
return ( | ||
<Modal | ||
customStyle="min-w-60v lg:p-0 lg:pb-6 hidden lg:block" | ||
isOpen={showCalendar} | ||
onClose={toggleCalendarModal} | ||
> | ||
<div className="modal__position mx-0 h-10 w-full items-center bg-miru-han-purple-1000 px-4 text-white"> | ||
<span className="flex-1 pl-4 text-base"> | ||
Public and optional holidays | ||
</span> | ||
<CustomYearPicker | ||
currentYear={currentYear} | ||
setCurrentYear={setCurrentYear} | ||
/> | ||
<div className="modal__close flex-1 text-right"> | ||
<Button className="modal__button" onClick={toggleCalendarModal}> | ||
<XIcon color="#CDD6DF" size={15} /> | ||
</Button> | ||
</div> | ||
</div> | ||
<CalendarForm /> | ||
</Modal> | ||
); | ||
} | ||
|
||
if (showCalendar) { | ||
return ( | ||
<div className="absolute inset-0 z-50 bg-white"> | ||
<MobileEditHeader | ||
backHref="/leave-management/" | ||
href="" | ||
showEdit={false} | ||
title="Public & Optional Holidays" | ||
/> | ||
<div className="my-12"> | ||
<CalendarForm /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default HolidayModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.