diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx
index 5cbbdf7f..e7f171e2 100644
--- a/apps/frontend/src/components/launches/calendar.tsx
+++ b/apps/frontend/src/components/launches/calendar.tsx
@@ -298,6 +298,22 @@ export const CalendarColumn: FC<{
});
}, [posts, display, getDate]);
+ const [showAll, setShowAll] = useState(false);
+ const showAllFunc = useCallback(() => {
+ setShowAll(true);
+ }, []);
+
+ const showLessFunc = useCallback(() => {
+ setShowAll(false);
+ }, []);
+
+ const list = useMemo(() => {
+ if (showAll) {
+ return postList;
+ }
+ return postList.slice(0, 3);
+ }, [postList, showAll]);
+
const canBeTrending = useMemo(() => {
return !!trendings.find((trend) => {
return dayjs
@@ -404,42 +420,56 @@ export const CalendarColumn: FC<{
);
const editPost = useCallback(
- (post: Post & { integration: Integration }, isDuplicate?: boolean) => async () => {
- if (user?.orgId === post.submittedForOrganizationId) {
- return previewPublication(post);
- }
- const data = await (await fetch(`/posts/${post.id}`)).json();
- const date = !isDuplicate ? null : (await (await fetch('/posts/find-slot')).json()).date;
- const publishDate = dayjs.utc(date || data.posts[0].publishDate).local();
+ (post: Post & { integration: Integration }, isDuplicate?: boolean) =>
+ async () => {
+ if (user?.orgId === post.submittedForOrganizationId) {
+ return previewPublication(post);
+ }
+ const data = await (await fetch(`/posts/${post.id}`)).json();
+ const date = !isDuplicate
+ ? null
+ : (await (await fetch('/posts/find-slot')).json()).date;
+ const publishDate = dayjs
+ .utc(date || data.posts[0].publishDate)
+ .local();
- const ExistingData = !isDuplicate ? ExistingDataContextProvider : Fragment;
+ const ExistingData = !isDuplicate
+ ? ExistingDataContextProvider
+ : Fragment;
- modal.openModal({
- closeOnClickOutside: false,
- closeOnEscape: false,
- withCloseButton: false,
- classNames: {
- modal: 'w-[100%] max-w-[1400px] bg-transparent text-textColor',
- },
- children: (
-