-
Articles
-
- {article.map((item) => (
-
-
-
+ {!isGeneral() && (
+
+
Articles
+
+ {article.map((item) => (
+
+
+
+
+
{item.name}
-
{item.name}
-
- ))}
+ ))}
+
-
+ )}
);
};
diff --git a/apps/frontend/src/components/launches/editor.tsx b/apps/frontend/src/components/launches/editor.tsx
index c4db0630..e1847252 100644
--- a/apps/frontend/src/components/launches/editor.tsx
+++ b/apps/frontend/src/components/launches/editor.tsx
@@ -3,7 +3,6 @@ import type { MDEditorProps } from '@uiw/react-md-editor/src/Types';
import { RefMDEditor } from '@uiw/react-md-editor/src/Editor';
import MDEditor from '@uiw/react-md-editor';
import { useCopilotAction, useCopilotReadable } from '@copilotkit/react-core';
-import { timer } from '@gitroom/helpers/utils/timer';
import dayjs from 'dayjs';
export const Editor = forwardRef<
diff --git a/apps/frontend/src/components/launches/providers/continue-provider/facebook/facebook.continue.tsx b/apps/frontend/src/components/launches/providers/continue-provider/facebook/facebook.continue.tsx
index e51c5e6a..e6e7634c 100644
--- a/apps/frontend/src/components/launches/providers/continue-provider/facebook/facebook.continue.tsx
+++ b/apps/frontend/src/components/launches/providers/continue-provider/facebook/facebook.continue.tsx
@@ -32,7 +32,7 @@ export const FacebookContinue: FC<{
[]
);
- const { data } = useSWR('load-pages', loadPages, {
+ const { data, isLoading } = useSWR('load-pages', loadPages, {
refreshWhenHidden: false,
refreshWhenOffline: false,
revalidateOnFocus: false,
@@ -57,6 +57,19 @@ export const FacebookContinue: FC<{
);
}, [data]);
+ if (!isLoading && !data?.length) {
+ return (
+
+ We couldn{"'"}t find any business connected to the selected pages.
+
+ We recommend you to connect all the pages and all the businesses.
+
+ Please close this dialog, delete your integration and add a new channel
+ again.
+
+ );
+ }
+
return (
Select Page:
diff --git a/apps/frontend/src/components/launches/providers/continue-provider/instagram/instagram.continue.tsx b/apps/frontend/src/components/launches/providers/continue-provider/instagram/instagram.continue.tsx
index 7225635c..35b047ee 100644
--- a/apps/frontend/src/components/launches/providers/continue-provider/instagram/instagram.continue.tsx
+++ b/apps/frontend/src/components/launches/providers/continue-provider/instagram/instagram.continue.tsx
@@ -35,7 +35,7 @@ export const InstagramContinue: FC<{
[]
);
- const { data } = useSWR('load-pages', loadPages, {
+ const { data, isLoading } = useSWR('load-pages', loadPages, {
refreshWhenHidden: false,
refreshWhenOffline: false,
revalidateOnFocus: false,
@@ -60,6 +60,19 @@ export const InstagramContinue: FC<{
);
}, [data]);
+ if (!isLoading && !data?.length) {
+ return (
+
+ We couldn{"'"}t find any business connected to the selected pages.
+
+ We recommend you to connect all the pages and all the businesses.
+
+ Please close this dialog, delete your integration and add a new channel
+ again.
+
+ );
+ }
+
return (
Select Instagram Account:
diff --git a/apps/frontend/src/components/launches/providers/continue-provider/linkedin/linkedin.continue.tsx b/apps/frontend/src/components/launches/providers/continue-provider/linkedin/linkedin.continue.tsx
index f5e53fab..bcdfeaaa 100644
--- a/apps/frontend/src/components/launches/providers/continue-provider/linkedin/linkedin.continue.tsx
+++ b/apps/frontend/src/components/launches/providers/continue-provider/linkedin/linkedin.continue.tsx
@@ -35,7 +35,7 @@ export const LinkedinContinue: FC<{
[]
);
- const { data } = useSWR('load-pages', loadPages, {
+ const { data, isLoading } = useSWR('load-pages', loadPages, {
refreshWhenHidden: false,
refreshWhenOffline: false,
revalidateOnFocus: false,
@@ -60,9 +60,19 @@ export const LinkedinContinue: FC<{
);
}, [data]);
+ if (!isLoading && !data?.length) {
+ return (
+
+ We couldn{"'"}t find any business connected to your LinkedIn Page.
+
+ Please close this dialog, create a new page, and add a new channel again.
+
+ );
+ }
+
return (
-
Select Linkedin Account:
+
Select Linkedin Page:
{filteredData?.map(
(p: {
@@ -81,11 +91,7 @@ export const LinkedinContinue: FC<{
onClick={setPage(p)}
>
-
+
{p.name}
diff --git a/apps/frontend/src/components/launches/providers/dribbble/dribbble.provider.tsx b/apps/frontend/src/components/launches/providers/dribbble/dribbble.provider.tsx
index 42739668..dcf710f6 100644
--- a/apps/frontend/src/components/launches/providers/dribbble/dribbble.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/dribbble/dribbble.provider.tsx
@@ -12,6 +12,7 @@ import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.v
import { Input } from '@gitroom/react/form/input';
import { DribbbleTeams } from '@gitroom/frontend/components/launches/providers/dribbble/dribbble.teams';
import { DribbbleDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/dribbble.dto';
+import ImageFile from 'next/image';
const DribbbleSettings: FC = () => {
const { register, control } = useSettings();
@@ -45,8 +46,10 @@ const DribbblePreview: FC = (props) => {
-
@@ -83,8 +86,10 @@ const DribbblePreview: FC = (props) => {
{morePosts.map((p, index) => (
-
@@ -138,15 +143,16 @@ export default withProvider(
return 'Dribbble does not support mp4 files';
}
- const details = await new Promise<{width: number, height: number}>((resolve, reject) => {
- const url = new Image();
- url.onload = function() {
- // @ts-ignore
- resolve({width: this.width, height: this.height});
+ const details = await new Promise<{ width: number; height: number }>(
+ (resolve, reject) => {
+ const url = new Image();
+ url.onload = function () {
+ // @ts-ignore
+ resolve({ width: this.width, height: this.height });
+ };
+ url.src = firstItem[0].path;
}
- url.src = firstItem[0].path;
- });
-
+ );
if (
(details?.width === 400 && details?.height === 300) ||
diff --git a/apps/frontend/src/components/launches/providers/facebook/facebook.provider.tsx b/apps/frontend/src/components/launches/providers/facebook/facebook.provider.tsx
index 0eb8d336..4f4bef07 100644
--- a/apps/frontend/src/components/launches/providers/facebook/facebook.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/facebook/facebook.provider.tsx
@@ -8,6 +8,7 @@ import {
linkedinCompanyPreventRemove,
} from '@gitroom/helpers/utils/linkedin.company.prevent.remove';
import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
+import Image from 'next/image';
const FacebookPreview: FC = (props) => {
const { value: topValue, integration } = useIntegration();
@@ -32,8 +33,10 @@ const FacebookPreview: FC = (props) => {
-
@@ -70,8 +73,10 @@ const FacebookPreview: FC = (props) => {
{morePosts.map((p, index) => (
-
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 6361f476..5da567ab 100644
--- a/apps/frontend/src/components/launches/providers/high.order.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/high.order.provider.tsx
@@ -301,9 +301,9 @@ export const withProvider = (
height={InPlaceValue.length > 1 ? 200 : 250}
value={val.content}
commands={[
- ...commands
- .getCommands()
- .filter((f) => f.name !== 'image'),
+ // ...commands
+ // .getCommands()
+ // .filter((f) => f.name !== 'image'),
newImage,
postSelector(date),
...linkedinCompany(
diff --git a/apps/frontend/src/components/launches/providers/instagram/instagram.provider.tsx b/apps/frontend/src/components/launches/providers/instagram/instagram.provider.tsx
index f6d8351d..99eb30bb 100644
--- a/apps/frontend/src/components/launches/providers/instagram/instagram.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/instagram/instagram.provider.tsx
@@ -8,6 +8,7 @@ import {
linkedinCompanyPreventRemove,
} from '@gitroom/helpers/utils/linkedin.company.prevent.remove';
import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
+import Image from 'next/image';
const InstagramPreview: FC = (props) => {
const { value: topValue, integration } = useIntegration();
@@ -32,8 +33,10 @@ const InstagramPreview: FC = (props) => {
-
@@ -69,8 +72,10 @@ const InstagramPreview: FC = (props) => {
{morePosts.map((p, index) => (
-
@@ -109,10 +114,15 @@ const InstagramPreview: FC = (props) => {
);
};
-export default withProvider(null, InstagramPreview, undefined, async ([firstPost, ...otherPosts]) => {
- if (!firstPost.length) {
- return 'Instagram should have at least one media';
- }
+export default withProvider(
+ null,
+ InstagramPreview,
+ undefined,
+ async ([firstPost, ...otherPosts]) => {
+ if (!firstPost.length) {
+ return 'Instagram should have at least one media';
+ }
- return true;
-});
+ return true;
+ }
+);
diff --git a/apps/frontend/src/components/launches/providers/linkedin/linkedin.provider.tsx b/apps/frontend/src/components/launches/providers/linkedin/linkedin.provider.tsx
index 8aa305a8..95241e75 100644
--- a/apps/frontend/src/components/launches/providers/linkedin/linkedin.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/linkedin/linkedin.provider.tsx
@@ -8,6 +8,7 @@ import {
linkedinCompanyPreventRemove,
} from '@gitroom/helpers/utils/linkedin.company.prevent.remove';
import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
+import Image from 'next/image';
const LinkedinPreview: FC = (props) => {
const { value: topValue, integration } = useIntegration();
@@ -32,8 +33,10 @@ const LinkedinPreview: FC = (props) => {
-
@@ -70,8 +73,10 @@ const LinkedinPreview: FC = (props) => {
{morePosts.map((p, index) => (
);
};
@@ -48,8 +54,10 @@ const PinterestPreview: FC = (props) => {
-
@@ -86,8 +94,10 @@ const PinterestPreview: FC = (props) => {
{morePosts.map((p, index) => (
-
@@ -132,7 +142,9 @@ export default withProvider(
PinterestSettingsDto,
async ([firstItem, ...otherItems]) => {
const isMp4 = firstItem?.find((item) => item.path.indexOf('mp4') > -1);
- const isPicture = firstItem?.find((item) => item.path.indexOf('mp4') === -1);
+ const isPicture = firstItem?.find(
+ (item) => item.path.indexOf('mp4') === -1
+ );
if (firstItem.length === 0) {
return 'Pinterest requires at least one media';
@@ -142,25 +154,31 @@ export default withProvider(
return 'If posting a video to Pinterest you have to also include a cover image as second media';
}
- if (isMp4 && firstItem.length > 2) {
- return 'If posting a video to Pinterest you can only have two media items';
- }
+ if (isMp4 && firstItem.length > 2) {
+ return 'If posting a video to Pinterest you can only have two media items';
+ }
if (otherItems.length) {
return 'Pinterest can only have one post';
}
- if (firstItem.length > 1 && firstItem.every(p => p.path.indexOf('mp4') == -1)) {
- const loadAll: Array<{width: number, height: number}> = await Promise.all(firstItem.map(p => {
- return new Promise((resolve, reject) => {
- const url = new Image();
- url.onload = function() {
- // @ts-ignore
- resolve({width: this.width, height: this.height});
- }
- url.src = p.path;
- });
- })) as any;
+ if (
+ firstItem.length > 1 &&
+ firstItem.every((p) => p.path.indexOf('mp4') == -1)
+ ) {
+ const loadAll: Array<{ width: number; height: number }> =
+ (await Promise.all(
+ firstItem.map((p) => {
+ return new Promise((resolve, reject) => {
+ const url = new Image();
+ url.onload = function () {
+ // @ts-ignore
+ resolve({ width: this.width, height: this.height });
+ };
+ url.src = p.path;
+ });
+ })
+ )) as any;
const checkAllTheSameWidthHeight = loadAll.every((p, i, arr) => {
return p.width === arr[0].width && p.height === arr[0].height;
diff --git a/apps/frontend/src/components/launches/providers/reddit/reddit.provider.tsx b/apps/frontend/src/components/launches/providers/reddit/reddit.provider.tsx
index 7f8907e4..352b3770 100644
--- a/apps/frontend/src/components/launches/providers/reddit/reddit.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/reddit/reddit.provider.tsx
@@ -15,6 +15,7 @@ import { useMediaDirectory } from '@gitroom/react/helpers/use.media.directory';
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
import MDEditor from '@uiw/react-md-editor';
import interClass from '@gitroom/react/helpers/inter.font';
+import Image from 'next/image';
const RenderRedditComponent: FC<{
type: string;
@@ -118,8 +119,10 @@ const RedditPreview: FC = (props) => {
{restOfPosts.map((p, index) => (
-
diff --git a/apps/frontend/src/components/launches/providers/threads/threads.provider.tsx b/apps/frontend/src/components/launches/providers/threads/threads.provider.tsx
index 70f5f7d7..22cfcd9f 100644
--- a/apps/frontend/src/components/launches/providers/threads/threads.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/threads/threads.provider.tsx
@@ -8,6 +8,7 @@ import {
linkedinCompanyPreventRemove,
} from '@gitroom/helpers/utils/linkedin.company.prevent.remove';
import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
+import Image from 'next/image';
const ThreadsPreview: FC = (props) => {
const { value: topValue, integration } = useIntegration();
@@ -32,8 +33,10 @@ const ThreadsPreview: FC = (props) => {
-
@@ -69,8 +72,10 @@ const ThreadsPreview: FC = (props) => {
{morePosts.map((p, index) => (
-
diff --git a/apps/frontend/src/components/launches/providers/tiktok/tiktok.provider.tsx b/apps/frontend/src/components/launches/providers/tiktok/tiktok.provider.tsx
index b2fddd50..92722df7 100644
--- a/apps/frontend/src/components/launches/providers/tiktok/tiktok.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/tiktok/tiktok.provider.tsx
@@ -11,6 +11,7 @@ import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
import { TikTokDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/tiktok.dto';
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
import { Select } from '@gitroom/react/form/select';
+import Image from 'next/image';
const privacyLevel = [
{
@@ -159,8 +160,10 @@ const TikTokPreview: FC = (props) => {
-
@@ -197,8 +200,10 @@ const TikTokPreview: FC = (props) => {
{morePosts.map((p, index) => (
-
diff --git a/apps/frontend/src/components/launches/providers/youtube/youtube.provider.tsx b/apps/frontend/src/components/launches/providers/youtube/youtube.provider.tsx
index a80a109e..77927b27 100644
--- a/apps/frontend/src/components/launches/providers/youtube/youtube.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/youtube/youtube.provider.tsx
@@ -14,6 +14,7 @@ import { Input } from '@gitroom/react/form/input';
import { MediumTags } from '@gitroom/frontend/components/launches/providers/medium/medium.tags';
import { MediaComponent } from '@gitroom/frontend/components/media/media.component';
import { Select } from '@gitroom/react/form/select';
+import Image from 'next/image';
const type = [
{ label: 'Public', value: 'public' },
@@ -26,7 +27,7 @@ const YoutubeSettings: FC = () => {
return (
-
+
{type.map((t) => (
{t.label}
@@ -68,8 +69,10 @@ const YoutubePreview: FC = (props) => {
-
@@ -106,8 +109,10 @@ const YoutubePreview: FC = (props) => {
{morePosts.map((p, index) => (
-
diff --git a/apps/frontend/src/components/onboarding/connect.channels.tsx b/apps/frontend/src/components/onboarding/connect.channels.tsx
index 22a94f16..74c9d06e 100644
--- a/apps/frontend/src/components/onboarding/connect.channels.tsx
+++ b/apps/frontend/src/components/onboarding/connect.channels.tsx
@@ -15,6 +15,7 @@ import Image from 'next/image';
import { Menu } from '@gitroom/frontend/components/launches/menu/menu';
import { ApiModal } from '@gitroom/frontend/components/launches/add.provider.component';
import { useRouter } from 'next/navigation';
+import { isGeneral } from '@gitroom/react/helpers/is.general';
export const ConnectChannels: FC = () => {
const fetch = useFetch();
@@ -142,9 +143,12 @@ export const ConnectChannels: FC = () => {
className="h-[96px] bg-input flex flex-col justify-center items-center gap-[10px] cursor-pointer"
>
-
@@ -154,28 +158,30 @@ export const ConnectChannels: FC = () => {
))}
-
-
Publishing Platforms
-
- {data?.article.map((article: any) => (
-
setIdentifier(article)}
- key={article.identifier}
- className="h-[96px] bg-input flex flex-col justify-center items-center gap-[10px] cursor-pointer"
- >
-
-
+ {!isGeneral() && (
+
+
Publishing Platforms
+
+ {data?.article.map((article: any) => (
+
setIdentifier(article)}
+ key={article.identifier}
+ className="h-[96px] bg-input flex flex-col justify-center items-center gap-[10px] cursor-pointer"
+ >
+
+
+
+
+ {article.name}
+
-
- {article.name}
-
-
- ))}
+ ))}
+
-
+ )}
@@ -201,7 +207,7 @@ export const ConnectChannels: FC = () => {
)}
-