feat: add comment or add post
This commit is contained in:
parent
41746808c6
commit
e12f795717
|
|
@ -3,33 +3,45 @@
|
|||
import { Button } from '@gitroom/react/form/button';
|
||||
import React, { FC } from 'react';
|
||||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
import { PostComment } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export const AddPostButton: FC<{
|
||||
onClick: () => void;
|
||||
num: number;
|
||||
postComment: PostComment;
|
||||
}> = (props) => {
|
||||
const { onClick, num } = props;
|
||||
const t = useT();
|
||||
|
||||
return (
|
||||
<Button
|
||||
onClick={onClick}
|
||||
className="!h-[24px] rounded-[3px] flex gap-[4px] w-[102px] text-[12px] font-[500]"
|
||||
>
|
||||
<div>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M7 1.3125C5.87512 1.3125 4.7755 1.64607 3.8402 2.27102C2.90489 2.89597 2.17591 3.78423 1.74544 4.82349C1.31496 5.86274 1.20233 7.00631 1.42179 8.10958C1.64124 9.21284 2.18292 10.2263 2.97833 11.0217C3.77374 11.8171 4.78716 12.3588 5.89043 12.5782C6.99369 12.7977 8.13726 12.685 9.17651 12.2546C10.2158 11.8241 11.104 11.0951 11.729 10.1598C12.3539 9.2245 12.6875 8.12488 12.6875 7C12.6859 5.49207 12.0862 4.04636 11.0199 2.98009C9.95365 1.91382 8.50793 1.31409 7 1.3125ZM7 11.8125C6.04818 11.8125 5.11773 11.5303 4.32632 11.0014C3.53491 10.4726 2.91808 9.72103 2.55383 8.84166C2.18959 7.96229 2.09428 6.99466 2.27997 6.06113C2.46566 5.12759 2.92401 4.27009 3.59705 3.59705C4.27009 2.92401 5.1276 2.46566 6.06113 2.27997C6.99466 2.09428 7.9623 2.18958 8.84167 2.55383C9.72104 2.91808 10.4726 3.53491 11.0015 4.32632C11.5303 5.11773 11.8125 6.04818 11.8125 7C11.8111 8.27591 11.3036 9.49915 10.4014 10.4014C9.49915 11.3036 8.27591 11.8111 7 11.8125ZM9.625 7C9.625 7.11603 9.57891 7.22731 9.49686 7.30936C9.41481 7.39141 9.30353 7.4375 9.1875 7.4375H7.4375V9.1875C7.4375 9.30353 7.39141 9.41481 7.30936 9.49686C7.22731 9.57891 7.11603 9.625 7 9.625C6.88397 9.625 6.77269 9.57891 6.69064 9.49686C6.6086 9.41481 6.5625 9.30353 6.5625 9.1875V7.4375H4.8125C4.69647 7.4375 4.58519 7.39141 4.50314 7.30936C4.4211 7.22731 4.375 7.11603 4.375 7C4.375 6.88397 4.4211 6.77269 4.50314 6.69064C4.58519 6.60859 4.69647 6.5625 4.8125 6.5625H6.5625V4.8125C6.5625 4.69647 6.6086 4.58519 6.69064 4.50314C6.77269 4.42109 6.88397 4.375 7 4.375C7.11603 4.375 7.22731 4.42109 7.30936 4.50314C7.39141 4.58519 7.4375 4.69647 7.4375 4.8125V6.5625H9.1875C9.30353 6.5625 9.41481 6.60859 9.49686 6.69064C9.57891 6.77269 9.625 6.88397 9.625 7Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="!text-white">{t('add_comment', 'Add comment')}</div>
|
||||
</Button>
|
||||
<div>
|
||||
<Button
|
||||
onClick={onClick}
|
||||
className="!h-[24px] rounded-[3px] flex gap-[4px] text-[12px] font-[500]"
|
||||
>
|
||||
<div>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M7 1.3125C5.87512 1.3125 4.7755 1.64607 3.8402 2.27102C2.90489 2.89597 2.17591 3.78423 1.74544 4.82349C1.31496 5.86274 1.20233 7.00631 1.42179 8.10958C1.64124 9.21284 2.18292 10.2263 2.97833 11.0217C3.77374 11.8171 4.78716 12.3588 5.89043 12.5782C6.99369 12.7977 8.13726 12.685 9.17651 12.2546C10.2158 11.8241 11.104 11.0951 11.729 10.1598C12.3539 9.2245 12.6875 8.12488 12.6875 7C12.6859 5.49207 12.0862 4.04636 11.0199 2.98009C9.95365 1.91382 8.50793 1.31409 7 1.3125ZM7 11.8125C6.04818 11.8125 5.11773 11.5303 4.32632 11.0014C3.53491 10.4726 2.91808 9.72103 2.55383 8.84166C2.18959 7.96229 2.09428 6.99466 2.27997 6.06113C2.46566 5.12759 2.92401 4.27009 3.59705 3.59705C4.27009 2.92401 5.1276 2.46566 6.06113 2.27997C6.99466 2.09428 7.9623 2.18958 8.84167 2.55383C9.72104 2.91808 10.4726 3.53491 11.0015 4.32632C11.5303 5.11773 11.8125 6.04818 11.8125 7C11.8111 8.27591 11.3036 9.49915 10.4014 10.4014C9.49915 11.3036 8.27591 11.8111 7 11.8125ZM9.625 7C9.625 7.11603 9.57891 7.22731 9.49686 7.30936C9.41481 7.39141 9.30353 7.4375 9.1875 7.4375H7.4375V9.1875C7.4375 9.30353 7.39141 9.41481 7.30936 9.49686C7.22731 9.57891 7.11603 9.625 7 9.625C6.88397 9.625 6.77269 9.57891 6.69064 9.49686C6.6086 9.41481 6.5625 9.30353 6.5625 9.1875V7.4375H4.8125C4.69647 7.4375 4.58519 7.39141 4.50314 7.30936C4.4211 7.22731 4.375 7.11603 4.375 7C4.375 6.88397 4.4211 6.77269 4.50314 6.69064C4.58519 6.60859 4.69647 6.5625 4.8125 6.5625H6.5625V4.8125C6.5625 4.69647 6.6086 4.58519 6.69064 4.50314C6.77269 4.42109 6.88397 4.375 7 4.375C7.11603 4.375 7.22731 4.42109 7.30936 4.50314C7.39141 4.58519 7.4375 4.69647 7.4375 4.8125V6.5625H9.1875C9.30353 6.5625 9.41481 6.60859 9.49686 6.69064C9.57891 6.77269 9.625 6.88397 9.625 7Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="!text-white">
|
||||
{t(
|
||||
...(props.postComment === PostComment.ALL
|
||||
? ['add_comment_or_post', 'Add comment or post']
|
||||
: props.postComment === PostComment.POST
|
||||
? ['add_post', 'Add post']
|
||||
: ['add_comment', 'Add comment'])
|
||||
)}
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ export const EditorWrapper: FC<{
|
|||
setInternalValue,
|
||||
internalFromAll,
|
||||
totalChars,
|
||||
postComment,
|
||||
} = useLaunchStore(
|
||||
useShallow((state) => ({
|
||||
internal: state.internal.find((p) => p.integration.id === state.current),
|
||||
|
|
@ -86,6 +87,7 @@ export const EditorWrapper: FC<{
|
|||
totalChars: state.totalChars,
|
||||
appendInternalValueMedia: state.appendInternalValueMedia,
|
||||
appendGlobalValueMedia: state.appendGlobalValueMedia,
|
||||
postComment: state.postComment,
|
||||
}))
|
||||
);
|
||||
|
||||
|
|
@ -346,7 +348,13 @@ export const EditorWrapper: FC<{
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{canEdit && <AddPostButton num={index} onClick={addValue(index)} />}
|
||||
{canEdit ? (
|
||||
<AddPostButton
|
||||
num={index}
|
||||
onClick={addValue(index)}
|
||||
postComment={postComment}
|
||||
/>
|
||||
) : <div className="h-[25px]" />}
|
||||
</div>
|
||||
));
|
||||
};
|
||||
|
|
@ -467,7 +475,6 @@ export const Editor: FC<{
|
|||
</div>
|
||||
</div>
|
||||
<div className="relative">
|
||||
{/*<ProgressBar id={`prog-${num}`} uppy={uppy} />*/}
|
||||
<div {...getRootProps()}>
|
||||
<div
|
||||
className={clsx(
|
||||
|
|
@ -544,16 +551,18 @@ export const Editor: FC<{
|
|||
/>
|
||||
)}
|
||||
</div>
|
||||
{(props?.totalChars || 0) > 0 && (
|
||||
<div
|
||||
className={clsx(
|
||||
'text-end text-sm mt-1',
|
||||
props?.value?.length > props.totalChars && '!text-red-500'
|
||||
)}
|
||||
>
|
||||
{props?.value?.length}/{props.totalChars}
|
||||
</div>
|
||||
)}
|
||||
<div className="absolute bottom-10px end-[25px]">
|
||||
{(props?.totalChars || 0) > 0 && (
|
||||
<div
|
||||
className={clsx(
|
||||
'text-end text-sm mt-1',
|
||||
props?.value?.length > props.totalChars && '!text-red-500'
|
||||
)}
|
||||
>
|
||||
{props?.value?.length}/{props.totalChars}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { ThreadFinisher } from '@gitroom/frontend/components/new-launch/finisher/thread.finisher';
|
||||
|
||||
const SettingsComponent = () => {
|
||||
|
|
@ -8,6 +8,7 @@ const SettingsComponent = () => {
|
|||
};
|
||||
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
SettingsComponent,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { DevToSettingsDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/dev.to.settings.dto';
|
||||
import { Input } from '@gitroom/react/form/input';
|
||||
import { MediaComponent } from '@gitroom/frontend/components/media/media.component';
|
||||
|
|
@ -83,4 +83,4 @@ const DevtoSettings: FC = () => {
|
|||
</>
|
||||
);
|
||||
};
|
||||
export default withProvider(DevtoSettings, DevtoPreview, DevToSettingsDto);
|
||||
export default withProvider(PostComment.COMMENT, DevtoSettings, DevtoPreview, DevToSettingsDto);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { FC } from 'react';
|
||||
import { DiscordDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/discord.dto';
|
||||
import { DiscordChannelSelect } from '@gitroom/frontend/components/new-launch/providers/discord/discord.channel.select';
|
||||
|
|
@ -14,6 +14,7 @@ const DiscordComponent: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
DiscordComponent,
|
||||
undefined,
|
||||
DiscordDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { Input } from '@gitroom/react/form/input';
|
||||
import { DribbbleTeams } from '@gitroom/frontend/components/new-launch/providers/dribbble/dribbble.teams';
|
||||
|
|
@ -16,6 +16,7 @@ const DribbbleSettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
DribbbleSettings,
|
||||
undefined,
|
||||
DribbbleDto,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(null, undefined, undefined, undefined, 63206);
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(PostComment.COMMENT,null, undefined, undefined, undefined, 63206);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { Input } from '@gitroom/react/form/input';
|
||||
import { HashnodePublications } from '@gitroom/frontend/components/new-launch/providers/hashnode/hashnode.publications';
|
||||
|
|
@ -86,6 +86,7 @@ const HashnodeSettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
HashnodeSettings,
|
||||
HashnodePreview,
|
||||
HashnodeSettingsDto
|
||||
|
|
|
|||
|
|
@ -27,7 +27,14 @@ class Empty {
|
|||
empty: string;
|
||||
}
|
||||
|
||||
export enum PostComment {
|
||||
ALL,
|
||||
POST,
|
||||
COMMENT
|
||||
}
|
||||
|
||||
export const withProvider = function <T extends object>(
|
||||
postComment: PostComment,
|
||||
SettingsComponent: FC<{
|
||||
values?: any;
|
||||
}> | null,
|
||||
|
|
@ -63,6 +70,7 @@ export const withProvider = function <T extends object>(
|
|||
setTotalChars,
|
||||
justCurrent,
|
||||
allIntegrations,
|
||||
setPostComment,
|
||||
} = useLaunchStore(
|
||||
useShallow((state) => ({
|
||||
date: state.date,
|
||||
|
|
@ -77,6 +85,7 @@ export const withProvider = function <T extends object>(
|
|||
isGlobal: state.current === 'global',
|
||||
setCurrent: state.setCurrent,
|
||||
setTotalChars: state.setTotalChars,
|
||||
setPostComment: state.setPostComment,
|
||||
selectedIntegration: state.selectedIntegrations.find(
|
||||
(p) => p.integration.id === props.id
|
||||
),
|
||||
|
|
@ -89,10 +98,12 @@ export const withProvider = function <T extends object>(
|
|||
}
|
||||
|
||||
if (isGlobal) {
|
||||
setPostComment(PostComment.ALL);
|
||||
setTotalChars(0);
|
||||
}
|
||||
|
||||
if (current) {
|
||||
setPostComment(postComment);
|
||||
setTotalChars(
|
||||
typeof maximumCharacters === 'number'
|
||||
? maximumCharacters
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { FC } from 'react';
|
||||
import { Select } from '@gitroom/react/form/select';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
|
|
@ -51,6 +51,7 @@ const InstagramCollaborators: FC<{
|
|||
);
|
||||
};
|
||||
export default withProvider<InstagramDto>(
|
||||
PostComment.COMMENT,
|
||||
InstagramCollaborators,
|
||||
undefined,
|
||||
InstagramDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC, useCallback } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { useFieldArray } from 'react-hook-form';
|
||||
import { Button } from '@gitroom/react/form/button';
|
||||
|
|
@ -64,6 +64,7 @@ const LemmySettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
LemmySettings,
|
||||
undefined,
|
||||
LemmySettingsDto,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { Checkbox } from '@gitroom/react/form/checkbox';
|
||||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
|
|
@ -23,6 +23,7 @@ const LinkedInSettings = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider<LinkedinDto>(
|
||||
PostComment.COMMENT,
|
||||
LinkedInSettings,
|
||||
undefined,
|
||||
LinkedinDto,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,14 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(null, undefined, undefined, undefined, 500);
|
||||
import {
|
||||
PostComment,
|
||||
withProvider,
|
||||
} from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
null,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
500
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import {
|
||||
PostComment,
|
||||
withProvider,
|
||||
} from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { Input } from '@gitroom/react/form/input';
|
||||
import { MediumPublications } from '@gitroom/frontend/components/new-launch/providers/medium/medium.publications';
|
||||
|
|
@ -63,4 +66,9 @@ const MediumSettings: FC = () => {
|
|||
</>
|
||||
);
|
||||
};
|
||||
export default withProvider(MediumSettings, MediumPreview, MediumSettingsDto);
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
MediumSettings,
|
||||
MediumPreview,
|
||||
MediumSettingsDto
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
null,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { PinterestBoard } from '@gitroom/frontend/components/new-launch/providers/pinterest/pinterest.board';
|
||||
import { PinterestSettingsDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/pinterest.dto';
|
||||
|
|
@ -24,6 +24,7 @@ const PinterestSettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
PinterestSettings,
|
||||
undefined,
|
||||
PinterestSettingsDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC, useCallback } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { useIntegration } from '@gitroom/frontend/components/launches/helpers/use.integration';
|
||||
import { Subreddit } from '@gitroom/frontend/components/new-launch/providers/reddit/subreddit';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
|
|
@ -213,6 +213,7 @@ const RedditSettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
RedditSettings,
|
||||
RedditPreview,
|
||||
RedditSettingsDto,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { FC } from 'react';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { SlackChannelSelect } from '@gitroom/frontend/components/new-launch/providers/slack/slack.channel.select';
|
||||
|
|
@ -14,6 +14,7 @@ const SlackComponent: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
SlackComponent,
|
||||
undefined,
|
||||
SlackDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
null,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { ThreadFinisher } from '@gitroom/frontend/components/new-launch/finisher/thread.finisher';
|
||||
const SettingsComponent = () => {
|
||||
return <ThreadFinisher />;
|
||||
};
|
||||
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
SettingsComponent,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
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';
|
||||
|
|
@ -344,6 +344,7 @@ const TikTokSettings: FC<{
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
TikTokSettings,
|
||||
undefined,
|
||||
TikTokDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
null,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { useFieldArray } from 'react-hook-form';
|
||||
|
|
@ -55,6 +55,7 @@ const WrapcastProvider: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
WrapcastProvider,
|
||||
undefined,
|
||||
undefined,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { ThreadFinisher } from '@gitroom/frontend/components/new-launch/finisher/thread.finisher';
|
||||
import { Select } from '@gitroom/react/form/select';
|
||||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
|
|
@ -60,6 +60,7 @@ const SettingsComponent = () => {
|
|||
};
|
||||
|
||||
export default withProvider(
|
||||
PostComment.POST,
|
||||
SettingsComponent,
|
||||
undefined,
|
||||
XDto,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { PostComment, withProvider } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
import { YoutubeSettingsDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/youtube.settings.dto';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
import { Input } from '@gitroom/react/form/input';
|
||||
|
|
@ -54,6 +54,7 @@ const YoutubeSettings: FC = () => {
|
|||
);
|
||||
};
|
||||
export default withProvider(
|
||||
PostComment.COMMENT,
|
||||
YoutubeSettings,
|
||||
undefined,
|
||||
YoutubeSettingsDto,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import dayjs from 'dayjs';
|
|||
import { Integrations } from '@gitroom/frontend/components/launches/calendar.context';
|
||||
import { createRef, RefObject } from 'react';
|
||||
import { arrayMoveImmutable } from 'array-move';
|
||||
import { PostComment } from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
|
||||
|
||||
interface Values {
|
||||
id: string;
|
||||
|
|
@ -25,6 +26,7 @@ interface SelectedIntegrations {
|
|||
|
||||
interface StoreState {
|
||||
date: dayjs.Dayjs;
|
||||
postComment: PostComment;
|
||||
repeater?: number;
|
||||
isCreateSet: boolean;
|
||||
totalChars: number;
|
||||
|
|
@ -111,10 +113,12 @@ interface StoreState {
|
|||
index: number,
|
||||
media: { id: string; path: string }[]
|
||||
) => void;
|
||||
setPostComment: (postComment: PostComment) => void;
|
||||
}
|
||||
|
||||
const initialState = {
|
||||
date: dayjs(),
|
||||
postComment: PostComment.ALL,
|
||||
tags: [] as { label: string; value: string }[],
|
||||
totalChars: 0,
|
||||
tab: 0 as 0,
|
||||
|
|
@ -490,4 +494,8 @@ export const useLaunchStore = create<StoreState>()((set) => ({
|
|||
i === index ? { ...item, media: [...item.media, ...media] } : item
|
||||
),
|
||||
})),
|
||||
setPostComment: (postComment: PostComment) =>
|
||||
set((state) => ({
|
||||
postComment,
|
||||
})),
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@
|
|||
"add_platform": "Add platform",
|
||||
"articles": "Articles",
|
||||
"add_comment": "Add comment",
|
||||
"add_post": "Add post in a thread",
|
||||
"add_comment_or_post": "Add comment / post",
|
||||
"you_are_in_global_editing_mode": "You are in global editing mode",
|
||||
"the_post_should_be_at_least_6_characters_long": "The post should be at least 6 characters long",
|
||||
"delete_post": "Delete Post",
|
||||
|
|
|
|||
Loading…
Reference in New Issue