Skip to content

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

feat: frontend integration cont.

David Anyatonwufc07ab8d7b89
diff --git a/apps/frontend/public/icons/platforms/tumblr.png b/apps/frontend/public/icons/platforms/tumblr.png
new file mode 100644
index 000000000..49c474356
Binary files /dev/null and b/apps/frontend/public/icons/platforms/tumblr.png differ
diff --git a/apps/frontend/src/components/new-launch/providers/continue-provider/tumblr/tumblr.continue.tsx b/apps/frontend/src/components/new-launch/providers/continue-provider/tumblr/tumblr.continue.tsx
new file mode 100644
index 000000000..102d15012
--- /dev/null
+++ b/apps/frontend/src/components/new-launch/providers/continue-provider/tumblr/tumblr.continue.tsx
@@ -0,0 +1,75 @@
+'use client';
+
+import { withContinueProvider } from '../with-continue-provider';
+
+interface TumblrBlogItem {
+ id: string;
+ name: string;
+ username?: string;
+ followers?: number;
+ primary?: boolean;
+ picture?: {
+ data: {
+ url: string;
+ };
+ };
+}
+
+interface TumblrBlogSelection {
+ id: string;
+}
+
+export const TumblrContinue = withContinueProvider<
+ TumblrBlogItem,
+ TumblrBlogSelection
+>({
+ endpoint: 'pages',
+ swrKey: 'load-tumblr-blogs',
+ titleKey: 'select_tumblr_blog',
+ titleDefault: 'Select Tumblr Blog:',
+ emptyStateMessages: [
+ {
+ key: 'tumblr_no_blogs_found',
+ text: "We couldn't find any Tumblr blogs connected to your account.",
+ },
+ {
+ key: 'tumblr_ensure_blog_exists',
+ text: 'Please ensure your Tumblr account has a blog you can post to.',
+ },
+ {
+ key: 'tumblr_try_again',
+ text: 'Please close this dialog, delete the integration and try again.',
+ },
+ ],
+ getItemId: (item) => item.id,
+ getSelectionValue: (item) => ({ id: item.id }),
+ transformSaveData: (selection) => selection,
+ isSelected: (item, selection) => selection?.id === item.id,
+ renderItem: (item) => (
+ <>
+ <div className="flex justify-center">
+ {item.picture?.data?.url ? (
+ <img
+ className="w-[80px] h-[80px] object-cover rounded-full"
+ src={item.picture.data.url}
+ alt={item.name}
+ />
+ ) : (
+ <div className="w-[80px] h-[80px] bg-input rounded-full flex items-center justify-center text-[32px] font-semibold">
+ t
+ </div>
+ )}
+ </div>
+ <div className="text-sm font-medium">{item.name}</div>
+ {item.username && (
+ <div className="text-xs text-gray-500 break-all">{item.username}</div>
+ )}
+ {!!item.followers && (
+ <div className="text-xs text-gray-400">
+ {item.followers.toLocaleString()} followers
+ </div>
+ )}
+ {item.primary && <div className="text-xs text-gray-400">Primary</div>}
+ </>
+ ),
+});
diff --git a/apps/frontend/src/components/new-launch/providers/tumblr/tumblr.provider.tsx b/apps/frontend/src/components/new-launch/providers/tumblr/tumblr.provider.tsx
new file mode 100644
index 000000000..8e638cd24
--- /dev/null
+++ b/apps/frontend/src/components/new-launch/providers/tumblr/tumblr.provider.tsx
@@ -0,0 +1,32 @@
+'use client';
+
+import {
+ PostComment,
+ withProvider,
+} from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
+import { Input } from '@gitroom/react/form/input';
+import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
+import { TumblrDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/tumblr.dto';
+
+const TumblrSettings = () => {
+ const form = useSettings();
+
+ return (
+ <>
+ <Input label="Title" {...form.register('title')} />
+ <Input label="Link URL" {...form.register('link')} />
+ <Input label="Source URL" {...form.register('sourceUrl')} />
+ <Input label="Tags" {...form.register('tags')} />
+ </>
+ );
+};
+
+export default withProvider({
+ comments: false,
+ postComment: PostComment.POST,
+ minimumCharacters: [],
+ SettingsComponent: TumblrSettings,
+ CustomPreviewComponent: undefined,
+ dto: TumblrDto,
+ maximumCharacters: 32768,
+});