Skip to content

Commit f3dd984

Browse files
committed
feat: minor fixes
1 parent afc8f19 commit f3dd984

File tree

6 files changed

+17
-103
lines changed

6 files changed

+17
-103
lines changed

apps/frontend/src/components/launches/add.edit.model.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
'use client';
22

33
import React, {
4-
ClipboardEventHandler,
5-
FC,
6-
Fragment,
7-
MouseEventHandler,
8-
useCallback,
9-
useEffect,
10-
useMemo,
11-
useRef,
12-
ClipboardEvent,
13-
useState,
4+
ClipboardEventHandler, FC, Fragment, MouseEventHandler, useCallback, useEffect, useMemo, useRef, ClipboardEvent, useState, memo
145
} from 'react';
156
import dayjs from 'dayjs';
167
import { Integrations } from '@gitroom/frontend/components/launches/calendar.context';
@@ -79,7 +70,7 @@ export const AddEditModal: FC<{
7970
id?: string;
8071
image?: Array<{ id: string; path: string }>;
8172
}>;
82-
}> = (props) => {
73+
}> = memo((props) => {
8374
const { date, integrations: ints, reopenModal, mutate, onlyValues } = props;
8475
const [customer, setCustomer] = useState('');
8576
const [loading, setLoading] = useState(false);
@@ -834,4 +825,4 @@ export const AddEditModal: FC<{
834825
</div>
835826
</>
836827
);
837-
};
828+
});

apps/frontend/src/components/launches/ai.image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ ${type}
9191
>
9292
<path
9393
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"
94-
fill="white"
94+
fill="currentColor"
9595
/>
9696
</svg>
9797
</div>
98-
<div className="text-[12px] font-[500] !text-white">AI</div>
98+
<div className="text-[12px] font-[500] !text-current">AI</div>
9999
</div>
100100
</Button>
101101
{value.length >= 30 && !loading && (

apps/frontend/src/components/launches/calendar.tsx

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
'use client';
22

33
import React, {
4-
FC,
5-
Fragment,
6-
useCallback,
7-
useEffect,
8-
useMemo,
9-
useState,
4+
FC, Fragment, memo, useCallback, useEffect, useMemo, useState
105
} from 'react';
116
import {
127
CalendarContext,
@@ -264,7 +259,7 @@ export const Calendar = () => {
264259
export const CalendarColumn: FC<{
265260
getDate: dayjs.Dayjs;
266261
randomHour?: boolean;
267-
}> = (props) => {
262+
}> = memo((props) => {
268263
const { getDate, randomHour } = props;
269264
const [num, setNum] = useState(0);
270265

@@ -636,7 +631,7 @@ export const CalendarColumn: FC<{
636631
</div>
637632
</div>
638633
);
639-
};
634+
});
640635

641636
const CalendarItem: FC<{
642637
date: dayjs.Dayjs;
@@ -647,7 +642,7 @@ const CalendarItem: FC<{
647642
state: State;
648643
display: 'day' | 'week' | 'month';
649644
post: Post & { integration: Integration };
650-
}> = (props) => {
645+
}> = memo((props) => {
651646
const { editPost, duplicatePost, post, date, isBeforeNow, state, display } =
652647
props;
653648

@@ -718,69 +713,4 @@ const CalendarItem: FC<{
718713
</div>
719714
</div>
720715
);
721-
};
722-
723-
export const CommentBox: FC<{ totalComments: number; date: dayjs.Dayjs }> = (
724-
props
725-
) => {
726-
const { totalComments, date } = props;
727-
const { mutate } = useSWRConfig();
728-
729-
const openCommentsModal = useCallback(() => {
730-
openModal({
731-
children: <CommentComponent date={date} />,
732-
withCloseButton: false,
733-
onClose() {
734-
mutate(`/posts`);
735-
},
736-
classNames: {
737-
modal: 'bg-transparent text-textColor',
738-
},
739-
size: '80%',
740-
});
741-
}, [date]);
742-
743-
return (
744-
<div
745-
className={
746-
totalComments === 0
747-
? 'transition-opacity opacity-0 group-hover:opacity-100'
748-
: ''
749-
}
750-
>
751-
<div
752-
onClick={openCommentsModal}
753-
data-tooltip-id="tooltip"
754-
data-tooltip-content="Add / View comments"
755-
className={clsx(
756-
'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',
757-
totalComments === 0 ? 'opacity-50' : 'opacity-95'
758-
)}
759-
>
760-
<div
761-
className={clsx(
762-
'relative w-full h-full group-hover:opacity-100',
763-
totalComments === 0 && 'opacity-0'
764-
)}
765-
>
766-
{totalComments > 0 && (
767-
<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">
768-
{totalComments}
769-
</div>
770-
)}
771-
<svg
772-
xmlns="http://www.w3.org/2000/svg"
773-
viewBox="0 0 32 32"
774-
id="comment"
775-
>
776-
<path
777-
fill="#fff"
778-
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"
779-
></path>
780-
</svg>
781-
</div>
782-
<div className="absolute right-0 bottom-0 w-[0] h-[0] shadow-yellow bg-[rgba(0,0,0,0)]"></div>
783-
</div>
784-
</div>
785-
);
786-
};
716+
});

apps/frontend/src/components/launches/new.post.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const NewPost = () => {
3131
size: '80%',
3232
title: ``,
3333
});
34-
}, []);
34+
}, [integrations]);
3535

3636
return (
3737
<button

apps/frontend/src/components/launches/providers/high.order.provider.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
'use client';
22

33
import React, {
4-
FC,
5-
Fragment,
6-
ReactNode,
7-
useCallback,
8-
useEffect,
9-
useMemo,
10-
useState,
11-
ClipboardEvent,
4+
FC, Fragment, ReactNode, useCallback, useEffect, useMemo, useState, ClipboardEvent, memo
125
} from 'react';
136
import { Button } from '@gitroom/react/form/button';
147
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
@@ -89,7 +82,7 @@ export const withProvider = function <T extends object>(
8982
) => Promise<string | true>,
9083
maximumCharacters?: number | ((settings: any) => number)
9184
) {
92-
return (props: {
85+
return memo((props: {
9386
identifier: string;
9487
id: string;
9588
value: Array<{
@@ -590,5 +583,5 @@ export const withProvider = function <T extends object>(
590583
</div>
591584
</FormProvider>
592585
);
593-
};
586+
});
594587
};

apps/frontend/src/components/media/media.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export const MultiMediaComponent: FC<{
294294
/>
295295
</svg>
296296
</div>
297-
<div className="text-[12px] font-[500] text-primary">
297+
<div className="text-[12px] font-[500] !text-current">
298298
Insert Media
299299
</div>
300300
</div>
@@ -315,11 +315,11 @@ export const MultiMediaComponent: FC<{
315315
>
316316
<path
317317
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"
318-
fill="white"
318+
fill="currentColor"
319319
/>
320320
</svg>
321321
</div>
322-
<div className="text-[12px] font-[500] !text-white">
322+
<div className="text-[12px] font-[500] !text-current">
323323
Design Media
324324
</div>
325325
</div>

0 commit comments

Comments
 (0)