Skip to content

Commit 9192cc4

Browse files
authored
Merge pull request #786 from gitroomhq/feat/carusel
LinkedIn post as carousel
2 parents 9dc9ac3 + 8cfd940 commit 9192cc4

File tree

23 files changed

+589
-219
lines changed

23 files changed

+589
-219
lines changed

apps/backend/.swcrc

Lines changed: 0 additions & 38 deletions
This file was deleted.

apps/cron/.swcrc

Lines changed: 0 additions & 38 deletions
This file was deleted.

apps/frontend/src/components/launches/providers/linkedin/linkedin.provider.tsx

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
2-
export default withProvider(
3-
null,
2+
import { Checkbox } from '@gitroom/react/form/checkbox';
3+
import { useT } from '@gitroom/react/translation/get.transation.service.client';
4+
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
5+
import { LinkedinDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/linkedin.dto';
6+
7+
const LinkedInSettings = () => {
8+
const t = useT();
9+
const { watch, register, formState, control } = useSettings();
10+
11+
return (
12+
<div className="mb-[20px]">
13+
<Checkbox
14+
variant="hollow"
15+
label={t('post_as_images_carousel', 'Post as images carousel')}
16+
{...register('post_as_images_carousel', {
17+
value: false,
18+
})}
19+
/>
20+
</div>
21+
);
22+
};
23+
export default withProvider<LinkedinDto>(
24+
LinkedInSettings,
425
undefined,
5-
undefined,
6-
async (posts) => {
26+
LinkedinDto,
27+
async (posts, vals) => {
728
const [firstPost, ...restPosts] = posts;
29+
30+
if (
31+
vals.post_as_images_carousel &&
32+
(firstPost.length < 2 ||
33+
firstPost.some((p) => p.path.indexOf('mp4') > -1))
34+
) {
35+
return 'LinkedIn carousel can only be created with 2 or more images and no videos.';
36+
}
37+
838
if (
939
firstPost.length > 1 &&
1040
firstPost.some((p) => p.path.indexOf('mp4') > -1)

i18n.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,4 @@ checksums:
487487
start_7_days_free_trial: e9c42510c2cc750fabe704ebc0a9e768
488488
change_language: c798f65b78e23b2cf8fc29a1a24a182f
489489
that_a_wrap: 0ecf5b5a1fbac9c2653f2642baf5d4a5
490+
post_as_images_carousel: 2f82f0f6adbf03abfeec3389800d7232
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { IsBoolean, IsOptional } from 'class-validator';
2+
3+
export class LinkedinDto {
4+
@IsBoolean()
5+
@IsOptional()
6+
post_as_images_carousel: boolean;
7+
}

0 commit comments

Comments
 (0)