FIXED CALENDAR FULL HEIGHT!!

This commit is contained in:
2024-06-18 20:30:19 -04:00
parent 7373c5e19e
commit 7b257420cf
3 changed files with 98 additions and 83 deletions
+13 -4
View File
@@ -3,7 +3,7 @@ import { VariantProps, cva } from "class-variance-authority";
import React from "react";
const CalenderItemVariants = cva(
"rounded-sm cursor-pointer bg-opacity-15 hover:bg-opacity-70",
"rounded-sm cursor-pointer bg-opacity-15 hover:bg-opacity-40",
{
variants: {
variant: {
@@ -11,12 +11,12 @@ const CalenderItemVariants = cva(
conference: "bg-yellow-300 text-yellow-300",
dividend: "bg-blue-500 text-blue-500",
earnings: "bg-green-500 text-green-500",
event: "bg-violet-500 text-violet-500",
event: "bg-purple-500 text-purple-500",
split: "bg-pink-500 text-pink-500",
},
size: {
sm: "whitespace-nowrap",
lg: "min-h-16",
lg: "bg-opacity-5",
},
},
defaultVariants: {
@@ -54,14 +54,23 @@ const CalendarItem = ({
"w-1 rounded-full bg-opacity-100"
)}
/>
<div
className={cn(size == "lg" && "flex flex-col px-1 gap-2", "w-full")}
>
<div className="flex gap-1 justify-between px-1 w-full">
<p>{title}</p>
<p className={cn(size == "sm" ? "hidden xl:block" : "", "")}>
{time}
</p>
</div>
{description && (
<p className="p-1 font-light leading-snug line-clamp-4 text-justify">
{description}
</p>
)}
</div>
{description && <p className="p-1 font-light">{description}</p>}
</div>
<div></div>
</div>
);
};
+4 -2
View File
@@ -30,7 +30,7 @@ const Day = () => {
variant="earnings"
size="lg"
time="BMO"
description="Nvidia is reporting earnings after a boom in AI. "
description="Nvidia is reporting earnings after a boom in AI. Nvidia has emerged as a major player driving advancements in artificial intelligence. The company's high-performance graphics processing units (GPUs) have become the workhorses powering many of the latest AI models and applications. In 2023, Nvidia doubled down on AI with the launch of its Hopper architecture - a new chip design optimized for transformer-based language models like GPT-3. They also introduced new AI software tools and services through their Nvidia AI platform. This includes pre-trained models, development frameworks, and cloud services for enterprises looking to deploy large language models and computer vision AI. Additionally, Nvidia has been at the forefront of accelerating AI computing through innovations like their Grace CPU designed for AI/ML workloads. As generative AI goes mainstream, Nvidia's chips and software are becoming critical infrastructure enabling everything from content creation to drug discovery using advanced machine learning techniques."
/>
<CalendarItem
title="NVDA Split 10:1"
@@ -43,7 +43,9 @@ const Day = () => {
variant="conference"
size="lg"
time="9 am"
description="Apple is holding a conference call to update shareholders about it's recent AI WWDC event."
description="Apple has been ramping up its artificial intelligence efforts in recent years. At its Worldwide Developers Conference (WWDC) in June 2023, the company unveiled several new AI-powered features across its software platforms. This includes an enhanced Siri assistant with improved language understanding and multitasking capabilities. Apple also introduced Visioneer, a new AI model for advanced computer vision tasks like image analysis and video processing. Additionally, the company has been working on implementing generative AI models into its productivity apps like Pages and Keynote to assist with content creation. While Apple has historically been more cautious about adopting cutting-edge AI compared to rivals, these latest moves signal their intent to double down on machine learning and AI across their product ecosystem.
"
/>
</div>
</div>
+7 -3
View File
@@ -36,7 +36,7 @@ const MonthCalendar = () => {
return (
<Tabs className="w-full h-full overflow-hidden" defaultValue="month">
<Card>
<Card className="flex flex-col">
<CardHeader className="p-2">
<div className="grid grid-cols-3 justify-stretch items-center">
<div className="place-self-start">
@@ -79,7 +79,8 @@ const MonthCalendar = () => {
{/* MONTH VIEW */}
{calendarView == "month" && (
<CardContent className="p-0">
<CardContent className="p-0 h-full flex">
<div className="flex flex-col w-full">
<div className="grid grid-cols-7 h-10">
{sevenDays.map((day) => (
<div
@@ -108,7 +109,9 @@ const MonthCalendar = () => {
"font-bold rounded-full w-6 flex justify-center"
)}
>
{format(item.date, "d", { timeZone: "America/New_York" })}
{format(item.date, "d", {
timeZone: "America/New_York",
})}
</p>
</div>
<div className="grid grid-rows-4 overflow-hidden gap-1 p-1 px-2">
@@ -153,6 +156,7 @@ const MonthCalendar = () => {
</div>
))}
</div>
</div>
</CardContent>
)}