Skip to content

Commit 4b5398a

Browse files
committed
add: change styles and max widths
1 parent 1564145 commit 4b5398a

File tree

2 files changed

+47
-36
lines changed

2 files changed

+47
-36
lines changed

components/accordion/calendar-accordion.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

33
import { AnimatePresence, motion } from "framer-motion";
4+
import { Button, buttonVariants } from "../ui/button";
45
import { useLocale, useTranslations } from "next-intl";
56

6-
import { Button } from "../ui/button";
77
import { Calendar as CalendarComponent } from "@/components/ui/calendar";
88
import { CalendarIcon } from "lucide-react";
99
import { PRIMARY_COLOR } from "@/lib/colors";
@@ -53,15 +53,19 @@ const CalendarAccordion = ({
5353
)}
5454
defaultMonth={date}
5555
classNames={{
56-
day_selected: cn(
57-
"",
58-
`bg-${PRIMARY_COLOR[theme]}-500 text-white hover:bg-${PRIMARY_COLOR[theme]}-500 hover:text-${PRIMARY_COLOR[theme]}-50 focus:bg-${PRIMARY_COLOR[theme]}-500 focus:text-${PRIMARY_COLOR[theme]}-50`
59-
),
60-
day_today: cn(
61-
"",
62-
`bg-${PRIMARY_COLOR[theme]}-100 text-${PRIMARY_COLOR[theme]}-900`
56+
months: "w-full",
57+
head_row: "flex justify-between",
58+
row: "w-full mt-2 flex justify-between",
59+
day: cn(
60+
buttonVariants({ variant: "ghost" }),
61+
"h-8 w-8 p-0 text-lg aria-selected:opacity-100"
6362
),
6463
}}
64+
modifiersClassNames={{
65+
today: "text-green-500",
66+
selected:
67+
"bg-green-500 text-white hover:bg-green-500 hover:text-white",
68+
}}
6569
mode='single'
6670
selected={date}
6771
onSelect={(date) => {
Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
1-
"use client"
1+
"use client";
22

3-
import React from 'react'
4-
import { Dialog, DialogTitle, DialogContent, DialogTrigger, DialogHeader } from '../ui/dialog'
5-
import { TaskRecurrenceOptions } from './task-recurrence-options'
6-
import { BLACK_BACKGROUND } from '@/lib/colors'
7-
import { cn } from '@/lib/utils'
8-
import { useTranslations } from 'next-intl'
3+
import {
4+
Dialog,
5+
DialogContent,
6+
DialogHeader,
7+
DialogTitle,
8+
DialogTrigger,
9+
} from "../ui/dialog";
910

10-
const TaskRecurrence = ({ isOpen, setIsOpen, }) => {
11-
const t = useTranslations("taskRecurrence")
11+
import { BLACK_BACKGROUND } from "@/lib/colors";
12+
import React from "react";
13+
import { TaskRecurrenceOptions } from "./task-recurrence-options";
14+
import { cn } from "@/lib/utils";
15+
import { useTranslations } from "next-intl";
1216

13-
return (
14-
<Dialog open={isOpen} onOpenChange={(open) => setIsOpen(open)}>
15-
16-
<DialogContent className={
17-
cn("bg-white dark:bg-gradient-to-br rounded-2xl p-6 max-w-xl shadow-xl space-y-4 max-h-[90vh] overflow-y-auto ", BLACK_BACKGROUND)
18-
}>
19-
<DialogHeader className='text-left'>
20-
<DialogTitle className="text-2xl font-semibold text-green-600 dark:text-white mb-2">{t("title")}</DialogTitle>
21-
<p className="text-gray-700 dark:text-gray-300">{t("subtitle")}</p>
22-
</DialogHeader>
23-
24-
<TaskRecurrenceOptions
25-
setIsOpen={setIsOpen}
26-
/>
17+
const TaskRecurrence = ({ isOpen, setIsOpen }) => {
18+
const t = useTranslations("taskRecurrence");
2719

28-
</DialogContent>
20+
return (
21+
<Dialog open={isOpen} onOpenChange={(open) => setIsOpen(open)}>
22+
<DialogContent
23+
className={cn(
24+
"p-6 w-[90%] max-w-md rounded-md dark:border-slate-700 dark:bg-slate-900 dark:text-white focus:border-gray-300 focus:ring focus:ring-gray-200 focus:ring-opacity-50 bg-white dark:bg-gradient-to-br shadow-xl space-y-4 max-h-[90vh] overflow-y-auto ",
25+
BLACK_BACKGROUND
26+
)}
27+
>
28+
<DialogHeader className='text-left'>
29+
<DialogTitle className='text-2xl font-semibold text-green-600 dark:text-white mb-2'>
30+
{t("title")}
31+
</DialogTitle>
32+
<p className='text-gray-700 dark:text-gray-300'>{t("subtitle")}</p>
33+
</DialogHeader>
2934

30-
</Dialog>
31-
)
32-
}
35+
<TaskRecurrenceOptions setIsOpen={setIsOpen} />
36+
</DialogContent>
37+
</Dialog>
38+
);
39+
};
3340

34-
export default TaskRecurrence
41+
export default TaskRecurrence;

0 commit comments

Comments
 (0)