Skip to content

Commit

Permalink
77. Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumyadas15 committed Mar 16, 2024
1 parent 34ef8d6 commit 00f9c5c
Show file tree
Hide file tree
Showing 10 changed files with 410 additions and 223 deletions.
31 changes: 6 additions & 25 deletions components/modals/createModals/AuditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import Heading from "../../reusable/Heading";
import Input from "../../reusable/Input";
import axios from 'axios';
import toast from "react-hot-toast";
import useSuccessModal from "@/hooks/useSuccessModal";
import useCreateModal from "@/hooks/useLoginModal";
import { useModal } from "@/hooks/useModalStore";
import { ProgressBar } from "../../ProgressBar";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Button } from "@/components/ui/button";
Expand All @@ -25,6 +22,7 @@ import { Calendar } from "@/components/ui/calendar";
import { CalendarIcon } from "lucide-react";
import { cn } from "@/lib/utils";
import { format } from "date-fns"
import DateInput from "@/components/reusable/DateInput";

enum STEPS {
DATE = 0,
Expand Down Expand Up @@ -134,28 +132,11 @@ const AuditModal = ({
exit={{ opacity: 0, x: "100%" }}
transition={{ duration: 0.3, ease: "easeInOut" }}
>
<Popover>
<PopoverTrigger asChild>
<Button
variant={"outline"}
className={cn(
"w-full border-[1px] border-neutral-300 rounded-[5px] justify-start text-left font-normal",
!date && "text-muted-foreground"
)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{date ? format(date, "PPP") : <span>Pick a date</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0 z-[9999] bg-neutral-200 rounded-[10px]" align="start">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
initialFocus
/>
</PopoverContent>
</Popover>
<DateInput
label="Date"
selectedDate={date}
onSelect={setDate}
/>
</motion.div>
</div>
)
Expand Down
55 changes: 11 additions & 44 deletions components/modals/createModals/FeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { format } from 'date-fns';
import { Calendar } from "../../ui/calendar";
import useFeedbackModal from "@/hooks/createModalHooks/useFeedbackModal";
import { ProgressBar } from "../../ProgressBar";
import DateInput from "@/components/reusable/DateInput";

enum STEPS {
TYPE = 0,
Expand Down Expand Up @@ -226,28 +227,11 @@ const FeedbackModal = ({
exit={{ opacity: 0, x: "100%" }}
transition={{ duration: 0.3, ease: "easeInOut" }}
>
<Popover>
<PopoverTrigger asChild>
<Button
variant={"outline"}
className={cn(
"w-full border-[1px] border-neutral-300 rounded-[5px] justify-start text-left font-normal",
!date && "text-muted-foreground"
)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{date ? format(date, "PPP") : <span>Start date</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0 z-[9999] bg-neutral-200 rounded-[10px]" align="start">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
initialFocus
/>
</PopoverContent>
</Popover>
<DateInput
label="Start Date"
selectedDate={date}
onSelect={setDate}
/>
</motion.div>
<motion.div
key="closureDate"
Expand All @@ -256,28 +240,11 @@ const FeedbackModal = ({
exit={{ opacity: 0, x: "100%" }}
transition={{ duration: 0.3, ease: "easeInOut" }}
>
<Popover>
<PopoverTrigger asChild>
<Button
variant={"outline"}
className={cn(
"w-full border-[1px] border-neutral-300 rounded-[5px] justify-start text-left font-normal",
!closureDate && "text-muted-foreground"
)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{closureDate ? format(closureDate, "PPP") : <span>End date</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0 z-[9999] bg-neutral-200 rounded-[10px]" align="start">
<Calendar
mode="single"
selected={closureDate}
onSelect={setClosureDate}
initialFocus
/>
</PopoverContent>
</Popover>
<DateInput
label="Closure Date"
selectedDate={closureDate}
onSelect={setClosureDate}
/>
</motion.div>
</div>
)
Expand Down
Loading

0 comments on commit 00f9c5c

Please sign in to comment.