diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx index 3167bf43..b0799641 100644 --- a/apps/frontend/src/components/launches/calendar.tsx +++ b/apps/frontend/src/components/launches/calendar.tsx @@ -144,7 +144,7 @@ export const Calendar = () => { ); }; -const CalendarColumn: FC<{ day: number; hour: string }> = (props) => { +export const CalendarColumn: FC<{ day: number; hour: string }> = (props) => { const { day, hour } = props; const { currentWeek, currentYear } = useCalendar(); @@ -174,22 +174,7 @@ const CalendarColumn: FC<{ day: number; hour: string }> = (props) => { return (
{!entry?.isIntersecting ? ( -
- {!isBeforeNow && ( -
- + -
- )} -
+
) : ( )} @@ -230,7 +215,7 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => { return dayjs .utc(post.publishDate) .local() - .isBetween(getDate, getDate.add(10, 'minute'), 'minute', '[)'); + .isBetween(getDate, getDate.add(59, 'minute'), 'minute', '[)'); }); }, [posts]); @@ -376,65 +361,60 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => { const addProvider = useAddProvider(); return ( -
-
-
- {postList.map((post) => ( -
1 && 'w-[33px] basis-[28px]', - 'h-full text-white relative flex justify-center items-center flex-grow-0 flex-shrink-0' - )} - > -
- -
+
+
+ {postList.map((post) => ( +
+
+
- ))} - {!isBeforeNow && ( -
-
- + -
-
- )} -
+
+ ))}
+ {!isBeforeNow && ( +
+
+
+
+
+ )}
); }; @@ -461,23 +441,24 @@ const CalendarItem: FC<{
p.identifier === post.integration?.providerIdentifier - )?.name - }: ${post.content.slice(0, 100)}`} > - - +
+ + +
+
{post.content}
); }; diff --git a/apps/frontend/src/components/launches/launches.component.tsx b/apps/frontend/src/components/launches/launches.component.tsx index 1cfc44b3..80b33abb 100644 --- a/apps/frontend/src/components/launches/launches.component.tsx +++ b/apps/frontend/src/components/launches/launches.component.tsx @@ -4,7 +4,7 @@ import { AddProviderButton } from '@gitroom/frontend/components/launches/add.pro import { useCallback, useEffect, useMemo, useState } from 'react'; import Image from 'next/image'; import { orderBy } from 'lodash'; -import { Calendar } from '@gitroom/frontend/components/launches/calendar'; +// import { Calendar } from '@gitroom/frontend/components/launches/calendar'; import { CalendarWeekProvider } from '@gitroom/frontend/components/launches/calendar.context'; import { Filters } from '@gitroom/frontend/components/launches/filters'; import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; @@ -19,6 +19,7 @@ import { Integration } from '@prisma/client'; import ImageWithFallback from '@gitroom/react/helpers/image.with.fallback'; import { useToaster } from '@gitroom/react/toaster/toaster'; import { useFireEvents } from '@gitroom/helpers/utils/use.fire.events'; +import { NewCalendarComponent } from '@gitroom/frontend/components/launches/new.calendar.component'; export const LaunchesComponent = () => { const fetch = useFetch(); @@ -116,7 +117,7 @@ export const LaunchesComponent = () => {
-
+

Channels

@@ -212,7 +213,8 @@ export const LaunchesComponent = () => {
- + + {/**/}
diff --git a/apps/frontend/src/components/launches/new.calendar.component.tsx b/apps/frontend/src/components/launches/new.calendar.component.tsx new file mode 100644 index 00000000..c6678c64 --- /dev/null +++ b/apps/frontend/src/components/launches/new.calendar.component.tsx @@ -0,0 +1,56 @@ +'use client'; +import { ChevronLeft, ChevronRight, Plus } from 'lucide-react'; +import { Button } from '@gitroom/react/form/button'; +import { Fragment } from 'react'; +import { CalendarColumn } from '@gitroom/frontend/components/launches/calendar'; +import { DNDProvider } from '@gitroom/frontend/components/launches/helpers/dnd.provider'; + +export const days = [ + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday', +]; +export const hours = Array.from({ length: 24 }, (_, i) => i); + +export const NewCalendarComponent = () => { + return ( + +
+
+
+
+ {days.map((day, index) => ( +
+
{day}
+
+ ))} + {hours.map((hour) => ( + +
+ {hour.toString().padStart(2, '0')}:00 +
+ {days.map((day, indexDay) => ( + +
+ +
+
+ ))} +
+ ))} +
+
+
+
+ ); +}; diff --git a/package-lock.json b/package-lock.json index 02861632..0f7f392a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -79,6 +79,7 @@ "json-to-graphql-query": "^2.2.5", "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", + "lucide-react": "^0.436.0", "md5": "^2.3.0", "mime-types": "^2.1.35", "multer": "^1.4.5-lts.1", @@ -4157,6 +4158,14 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/@copilotkit/react-textarea/node_modules/lucide-react": { + "version": "0.274.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.274.0.tgz", + "integrity": "sha512-qiWcojRXEwDiSimMX1+arnxha+ROJzZjJaVvCC0rsG6a9pUPjZePXSq7em4ZKMp0NDm1hyzPNkM7UaWC3LU2AA==", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@copilotkit/react-textarea/node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -28514,11 +28523,11 @@ } }, "node_modules/lucide-react": { - "version": "0.274.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.274.0.tgz", - "integrity": "sha512-qiWcojRXEwDiSimMX1+arnxha+ROJzZjJaVvCC0rsG6a9pUPjZePXSq7em4ZKMp0NDm1hyzPNkM7UaWC3LU2AA==", + "version": "0.436.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.436.0.tgz", + "integrity": "sha512-N292bIxoqm1aObAg0MzFtvhYwgQE6qnIOWx/GLj5ONgcTPH6N0fD9bVq/GfdeC9ZORBXozt/XeEKDpiB3x3vlQ==", "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" } }, "node_modules/luxon": { diff --git a/package.json b/package.json index d46efcf3..2fb58d91 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "json-to-graphql-query": "^2.2.5", "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", + "lucide-react": "^0.436.0", "md5": "^2.3.0", "mime-types": "^2.1.35", "multer": "^1.4.5-lts.1",