Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: minor fixes

Nevo Davidf3dd984b92ba
diff --git a/apps/frontend/src/components/launches/add.edit.model.tsx b/apps/frontend/src/components/launches/add.edit.model.tsx
index 2f31271e2..229be6e8f 100644
--- a/apps/frontend/src/components/launches/add.edit.model.tsx
+++ b/apps/frontend/src/components/launches/add.edit.model.tsx
@@ -1,16 +1,7 @@
'use client';
import React, {
- ClipboardEventHandler,
- FC,
- Fragment,
- MouseEventHandler,
- useCallback,
- useEffect,
- useMemo,
- useRef,
- ClipboardEvent,
- useState,
+ ClipboardEventHandler, FC, Fragment, MouseEventHandler, useCallback, useEffect, useMemo, useRef, ClipboardEvent, useState, memo
} from 'react';
import dayjs from 'dayjs';
import { Integrations } from '@gitroom/frontend/components/launches/calendar.context';
@@ -79,7 +70,7 @@ export const AddEditModal: FC<{
id?: string;
image?: Array<{ id: string; path: string }>;
}>;
-}> = (props) => {
+}> = memo((props) => {
const { date, integrations: ints, reopenModal, mutate, onlyValues } = props;
const [customer, setCustomer] = useState('');
const [loading, setLoading] = useState(false);
@@ -834,4 +825,4 @@ export const AddEditModal: FC<{
</div>
</>
);
-};
+});
diff --git a/apps/frontend/src/components/launches/ai.image.tsx b/apps/frontend/src/components/launches/ai.image.tsx
index 024ecffac..d5e3533de 100644
--- a/apps/frontend/src/components/launches/ai.image.tsx
+++ b/apps/frontend/src/components/launches/ai.image.tsx
@@ -91,11 +91,11 @@ ${type}
>
<path
d="M19.5 3H7.5C7.10218 3 6.72064 3.15804 6.43934 3.43934C6.15804 3.72064 6 4.10218 6 4.5V6H4.5C4.10218 6 3.72064 6.15804 3.43934 6.43934C3.15804 6.72064 3 7.10218 3 7.5V19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72064 20.842 4.10218 21 4.5 21H16.5C16.8978 21 17.2794 20.842 17.5607 20.5607C17.842 20.2794 18 19.8978 18 19.5V18H19.5C19.8978 18 20.2794 17.842 20.5607 17.5607C20.842 17.2794 21 16.8978 21 16.5V4.5C21 4.10218 20.842 3.72064 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3ZM7.5 4.5H19.5V11.0044L17.9344 9.43875C17.6531 9.15766 17.2717 8.99976 16.8741 8.99976C16.4764 8.99976 16.095 9.15766 15.8137 9.43875L8.75344 16.5H7.5V4.5ZM16.5 19.5H4.5V7.5H6V16.5C6 16.8978 6.15804 17.2794 6.43934 17.5607C6.72064 17.842 7.10218 18 7.5 18H16.5V19.5ZM19.5 16.5H10.875L16.875 10.5L19.5 13.125V16.5ZM11.25 10.5C11.695 10.5 12.13 10.368 12.5 10.1208C12.87 9.87357 13.1584 9.52217 13.3287 9.11104C13.499 8.6999 13.5436 8.2475 13.4568 7.81105C13.37 7.37459 13.1557 6.97368 12.841 6.65901C12.5263 6.34434 12.1254 6.13005 11.689 6.04323C11.2525 5.95642 10.8001 6.00097 10.389 6.17127C9.97783 6.34157 9.62643 6.62996 9.37919 6.99997C9.13196 7.36998 9 7.80499 9 8.25C9 8.84674 9.23705 9.41903 9.65901 9.84099C10.081 10.2629 10.6533 10.5 11.25 10.5ZM11.25 7.5C11.3983 7.5 11.5433 7.54399 11.6667 7.6264C11.79 7.70881 11.8861 7.82594 11.9429 7.96299C11.9997 8.10003 12.0145 8.25083 11.9856 8.39632C11.9566 8.5418 11.8852 8.67544 11.7803 8.78033C11.6754 8.88522 11.5418 8.95665 11.3963 8.98559C11.2508 9.01453 11.1 8.99968 10.963 8.94291C10.8259 8.88614 10.7088 8.79001 10.6264 8.66668C10.544 8.54334 10.5 8.39834 10.5 8.25C10.5 8.05109 10.579 7.86032 10.7197 7.71967C10.8603 7.57902 11.0511 7.5 11.25 7.5Z"
- fill="white"
+ fill="currentColor"
/>
</svg>
</div>
- <div className="text-[12px] font-[500] !text-white">AI</div>
+ <div className="text-[12px] font-[500] !text-current">AI</div>
</div>
</Button>
{value.length >= 30 && !loading && (
diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx
index e7f171e29..0918d2386 100644
--- a/apps/frontend/src/components/launches/calendar.tsx
+++ b/apps/frontend/src/components/launches/calendar.tsx
@@ -1,12 +1,7 @@
'use client';
import React, {
- FC,
- Fragment,
- useCallback,
- useEffect,
- useMemo,
- useState,
+ FC, Fragment, memo, useCallback, useEffect, useMemo, useState
} from 'react';
import {
CalendarContext,
@@ -264,7 +259,7 @@ export const Calendar = () => {
export const CalendarColumn: FC<{
getDate: dayjs.Dayjs;
randomHour?: boolean;
-}> = (props) => {
+}> = memo((props) => {
const { getDate, randomHour } = props;
const [num, setNum] = useState(0);
@@ -636,7 +631,7 @@ export const CalendarColumn: FC<{
</div>
</div>
);
-};
+});
const CalendarItem: FC<{
date: dayjs.Dayjs;
@@ -647,7 +642,7 @@ const CalendarItem: FC<{
state: State;
display: 'day' | 'week' | 'month';
post: Post & { integration: Integration };
-}> = (props) => {
+}> = memo((props) => {
const { editPost, duplicatePost, post, date, isBeforeNow, state, display } =
props;
@@ -718,69 +713,4 @@ const CalendarItem: FC<{
</div>
</div>
);
-};
-
-export const CommentBox: FC<{ totalComments: number; date: dayjs.Dayjs }> = (
- props
-) => {
- const { totalComments, date } = props;
- const { mutate } = useSWRConfig();
-
- const openCommentsModal = useCallback(() => {
- openModal({
- children: <CommentComponent date={date} />,
- withCloseButton: false,
- onClose() {
- mutate(`/posts`);
- },
- classNames: {
- modal: 'bg-transparent text-textColor',
- },
- size: '80%',
- });
- }, [date]);
-
- return (
- <div
- className={
- totalComments === 0
- ? 'transition-opacity opacity-0 group-hover:opacity-100'
- : ''
- }
- >
- <div
- onClick={openCommentsModal}
- data-tooltip-id="tooltip"
- data-tooltip-content="Add / View comments"
- className={clsx(
- 'group absolute right-0 bottom-0 w-[20px] h-[20px] z-[10] hover:opacity-95 cursor-pointer hover:right-[3px] hover:bottom-[3px] transition-all duration-300 ease-in-out',
- totalComments === 0 ? 'opacity-50' : 'opacity-95'
- )}
- >
- <div
- className={clsx(
- 'relative w-full h-full group-hover:opacity-100',
- totalComments === 0 && 'opacity-0'
- )}
- >
- {totalComments > 0 && (
- <div className="absolute right-0 bottom-[10px] w-[10px] h-[10px] text-[8px] bg-red-500 z-[20] rounded-full flex justify-center items-center text-textColor">
- {totalComments}
- </div>
- )}
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 32 32"
- id="comment"
- >
- <path
- fill="#fff"
- d="M25.784 21.017A10.992 10.992 0 0 0 27 16c0-6.065-4.935-11-11-11S5 9.935 5 16s4.935 11 11 11c1.742 0 3.468-.419 5.018-1.215l4.74 1.185a.996.996 0 0 0 .949-.263 1 1 0 0 0 .263-.95l-1.186-4.74zm-2.033.11.874 3.498-3.498-.875a1.006 1.006 0 0 0-.731.098A8.99 8.99 0 0 1 16 25c-4.963 0-9-4.038-9-9s4.037-9 9-9 9 4.038 9 9a8.997 8.997 0 0 1-1.151 4.395.995.995 0 0 0-.098.732z"
- ></path>
- </svg>
- </div>
- <div className="absolute right-0 bottom-0 w-[0] h-[0] shadow-yellow bg-[rgba(0,0,0,0)]"></div>
- </div>
- </div>
- );
-};
+});
diff --git a/apps/frontend/src/components/launches/new.post.tsx b/apps/frontend/src/components/launches/new.post.tsx
index 51d5a4568..bb87e4149 100644
--- a/apps/frontend/src/components/launches/new.post.tsx
+++ b/apps/frontend/src/components/launches/new.post.tsx
@@ -31,7 +31,7 @@ export const NewPost = () => {
size: '80%',
title: ``,
});
- }, []);
+ }, [integrations]);
return (
<button
diff --git a/apps/frontend/src/components/launches/providers/high.order.provider.tsx b/apps/frontend/src/components/launches/providers/high.order.provider.tsx
index 4f9d2be64..c0ff02b09 100644
--- a/apps/frontend/src/components/launches/providers/high.order.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/high.order.provider.tsx
@@ -1,14 +1,7 @@
'use client';
import React, {
- FC,
- Fragment,
- ReactNode,
- useCallback,
- useEffect,
- useMemo,
- useState,
- ClipboardEvent,
+ FC, Fragment, ReactNode, useCallback, useEffect, useMemo, useState, ClipboardEvent, memo
} from 'react';
import { Button } from '@gitroom/react/form/button';
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
@@ -89,7 +82,7 @@ export const withProvider = function <T extends object>(
) => Promise<string | true>,
maximumCharacters?: number | ((settings: any) => number)
) {
- return (props: {
+ return memo((props: {
identifier: string;
id: string;
value: Array<{
@@ -590,5 +583,5 @@ export const withProvider = function <T extends object>(
</div>
</FormProvider>
);
- };
+ });
};
diff --git a/apps/frontend/src/components/media/media.component.tsx b/apps/frontend/src/components/media/media.component.tsx
index d715ebb1f..e74b336dd 100644
--- a/apps/frontend/src/components/media/media.component.tsx
+++ b/apps/frontend/src/components/media/media.component.tsx
@@ -294,7 +294,7 @@ export const MultiMediaComponent: FC<{
/>
</svg>
</div>
- <div className="text-[12px] font-[500] text-primary">
+ <div className="text-[12px] font-[500] !text-current">
Insert Media
</div>
</div>
@@ -315,11 +315,11 @@ export const MultiMediaComponent: FC<{
>
<path
d="M19.5 3H7.5C7.10218 3 6.72064 3.15804 6.43934 3.43934C6.15804 3.72064 6 4.10218 6 4.5V6H4.5C4.10218 6 3.72064 6.15804 3.43934 6.43934C3.15804 6.72064 3 7.10218 3 7.5V19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72064 20.842 4.10218 21 4.5 21H16.5C16.8978 21 17.2794 20.842 17.5607 20.5607C17.842 20.2794 18 19.8978 18 19.5V18H19.5C19.8978 18 20.2794 17.842 20.5607 17.5607C20.842 17.2794 21 16.8978 21 16.5V4.5C21 4.10218 20.842 3.72064 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3ZM7.5 4.5H19.5V11.0044L17.9344 9.43875C17.6531 9.15766 17.2717 8.99976 16.8741 8.99976C16.4764 8.99976 16.095 9.15766 15.8137 9.43875L8.75344 16.5H7.5V4.5ZM16.5 19.5H4.5V7.5H6V16.5C6 16.8978 6.15804 17.2794 6.43934 17.5607C6.72064 17.842 7.10218 18 7.5 18H16.5V19.5ZM19.5 16.5H10.875L16.875 10.5L19.5 13.125V16.5ZM11.25 10.5C11.695 10.5 12.13 10.368 12.5 10.1208C12.87 9.87357 13.1584 9.52217 13.3287 9.11104C13.499 8.6999 13.5436 8.2475 13.4568 7.81105C13.37 7.37459 13.1557 6.97368 12.841 6.65901C12.5263 6.34434 12.1254 6.13005 11.689 6.04323C11.2525 5.95642 10.8001 6.00097 10.389 6.17127C9.97783 6.34157 9.62643 6.62996 9.37919 6.99997C9.13196 7.36998 9 7.80499 9 8.25C9 8.84674 9.23705 9.41903 9.65901 9.84099C10.081 10.2629 10.6533 10.5 11.25 10.5ZM11.25 7.5C11.3983 7.5 11.5433 7.54399 11.6667 7.6264C11.79 7.70881 11.8861 7.82594 11.9429 7.96299C11.9997 8.10003 12.0145 8.25083 11.9856 8.39632C11.9566 8.5418 11.8852 8.67544 11.7803 8.78033C11.6754 8.88522 11.5418 8.95665 11.3963 8.98559C11.2508 9.01453 11.1 8.99968 10.963 8.94291C10.8259 8.88614 10.7088 8.79001 10.6264 8.66668C10.544 8.54334 10.5 8.39834 10.5 8.25C10.5 8.05109 10.579 7.86032 10.7197 7.71967C10.8603 7.57902 11.0511 7.5 11.25 7.5Z"
- fill="white"
+ fill="currentColor"
/>
</svg>
</div>
- <div className="text-[12px] font-[500] !text-white">
+ <div className="text-[12px] font-[500] !text-current">
Design Media
</div>
</div>