🎥 Make videos programmatically with React
cleanup remainders
JonnyBurger2fe4766a1ae5
diff --git a/packages/convert/app/components/CardLikeButton.tsx b/packages/convert/app/components/CardLikeButton.tsxdeleted file mode 100644index a299cace9c..0000000000--- a/packages/convert/app/components/CardLikeButton.tsx+++ /dev/null@@ -1,76 +0,0 @@-import {Heart} from '@remotion/shapes';-import React, {useCallback, useEffect, useState} from 'react';-import {REMOTION_PRO_ORIGIN} from '~/lib/config';-import {- formatLikeCount,- getLikedIds,- removeLikedId,- saveLikedId,-} from '~/lib/prompt-helpers';-import {useHeartAnimation} from '~/lib/use-heart-animation';--export const CardLikeButton: React.FC<{- readonly submissionId: string;- readonly initialLikeCount: number;-}> = ({submissionId, initialLikeCount}) => {- const [liked, setLiked] = useState(false);- const [likeCount, setLikeCount] = useState(initialLikeCount);- const {scale, roundness, animate} = useHeartAnimation();-- useEffect(() => {- setLiked(getLikedIds().has(submissionId));- }, [submissionId]);-- const onClick = useCallback(- async (e: React.MouseEvent) => {- e.preventDefault();- if (liked) {- setLiked(false);- setLikeCount((c) => c - 1);- removeLikedId(submissionId);-- try {- await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/unlike`, {- method: 'POST',- headers: {'content-type': 'application/json'},- body: JSON.stringify({submissionId}),- });- } catch {- // Optimistic- }- } else {- animate();- setLiked(true);- setLikeCount((c) => c + 1);- saveLikedId(submissionId);-- try {- await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/like`, {- method: 'POST',- headers: {'content-type': 'application/json'},- body: JSON.stringify({submissionId}),- });- } catch {- // Optimistic- }- }- },- [liked, submissionId, animate],- );-- return (- <button onClick={onClick} className="flex items-center" type="button">- <Heart- height={16}- fill={liked ? 'var(--color-brand)' : 'none'}- stroke={liked ? 'var(--color-brand)' : 'black'}- strokeWidth={2}- bottomRoundnessAdjustment={roundness}- style={{transform: `scale(${scale})`, marginTop: 2}}- />- <span className="font-brand font-medium" style={{marginLeft: 8, flex: 1}}>- {formatLikeCount(likeCount)}- </span>- </button>- );-};diff --git a/packages/convert/app/components/LikeButton.tsx b/packages/convert/app/components/LikeButton.tsxdeleted file mode 100644index 9ed3efc9c1..0000000000--- a/packages/convert/app/components/LikeButton.tsx+++ /dev/null@@ -1,79 +0,0 @@-import {Button} from '@remotion/design';-import {Heart} from '@remotion/shapes';-import React, {useCallback, useEffect, useState} from 'react';-import {REMOTION_PRO_ORIGIN} from '~/lib/config';-import {- formatLikeCount,- getLikedIds,- removeLikedId,- saveLikedId,-} from '~/lib/prompt-helpers';-import {useHeartAnimation} from '~/lib/use-heart-animation';--export const LikeButton: React.FC<{- readonly submissionId: string;- readonly initialLikeCount: number;-}> = ({submissionId, initialLikeCount}) => {- const [liked, setLiked] = useState(false);- const [likeCount, setLikeCount] = useState(initialLikeCount);- const {scale, roundness, animate} = useHeartAnimation();-- useEffect(() => {- setLiked(getLikedIds().has(submissionId));- }, [submissionId]);-- const onClick = useCallback(async () => {- if (liked) {- setLiked(false);- setLikeCount((c) => c - 1);- removeLikedId(submissionId);-- try {- await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/unlike`, {- method: 'POST',- headers: {'content-type': 'application/json'},- body: JSON.stringify({submissionId}),- });- } catch {- // Optimistic- }- } else {- animate();- setLiked(true);- setLikeCount((c) => c + 1);- saveLikedId(submissionId);-- try {- await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/like`, {- method: 'POST',- headers: {'content-type': 'application/json'},- body: JSON.stringify({submissionId}),- });- } catch {- // Optimistic- }- }- }, [liked, submissionId, animate]);-- return (- <Button- className={`font-brand rounded-full flex items-center ${liked ? 'bg-brand text-white' : ''}`}- onClick={onClick}- style={{width: 90}}- >- <div className="flex items-center flex-row flex-1 w-[40px] justify-center">- <Heart- height={14}- fill={liked ? 'white' : 'none'}- stroke={liked ? 'white' : 'black'}- strokeWidth={2}- bottomRoundnessAdjustment={roundness}- style={{transform: `scale(${scale})`}}- />- <span style={{fontSize: 15, marginLeft: 10}}>- {formatLikeCount(likeCount)}- </span>- </div>- </Button>- );-};diff --git a/packages/convert/app/components/get-supported-configs.tsx b/packages/convert/app/components/get-supported-configs.tsxindex 288bf785c7..bc74379d26 100644--- a/packages/convert/app/components/get-supported-configs.tsx+++ b/packages/convert/app/components/get-supported-configs.tsx@@ -82,14 +82,6 @@ const shouldPrioritizeVideoCopyOverReencode = (routeAction: RouteAction) => {return true;}- if (routeAction.type === 'prompt-showcase') {- return false;- }-- if (routeAction.type === 'prompt-showcase-detail') {- return false;- }-throw new Error('Unsupported route action' + (routeAction satisfies never));};diff --git a/packages/convert/app/lib/default-ui.ts b/packages/convert/app/lib/default-ui.tsindex cde7b5baf4..f0f589dd9d 100644--- a/packages/convert/app/lib/default-ui.ts+++ b/packages/convert/app/lib/default-ui.ts@@ -61,14 +61,6 @@ export const defaultRotateOrMirorState = (return null;}- if (action.type === 'prompt-showcase') {- return null;- }-- if (action.type === 'prompt-showcase-detail') {- return null;- }-throw new Error('Rotate is not enabled by default ' + (action satisfies never),);@@ -131,14 +123,6 @@ export const isConvertEnabledByDefault = (action: RouteAction) => {return true;}- if (action.type === 'prompt-showcase') {- return true;- }-- if (action.type === 'prompt-showcase-detail') {- return true;- }-throw new Error('Convert is not enabled by default ' + (action satisfies never),);@@ -215,9 +199,7 @@ export const getOrderOfSections = (action.type === 'resize-format' ||action.type === 'report' ||action.type === 'transcribe' ||- action.type === 'timing-editor' ||- action.type === 'prompt-showcase' ||- action.type === 'prompt-showcase-detail'+ action.type === 'timing-editor') {return {resize: 0,diff --git a/packages/convert/app/seo.ts b/packages/convert/app/seo.tsindex e3d42f5439..0c3226a355 100644--- a/packages/convert/app/seo.ts+++ b/packages/convert/app/seo.ts@@ -78,12 +78,6 @@ export type RouteAction =}| {type: 'timing-editor';- }- | {- type: 'prompt-showcase';- }- | {- type: 'prompt-showcase-detail';};export const getHeaderTitle = (routeAction: RouteAction) => {@@ -143,14 +137,6 @@ export const getHeaderTitle = (routeAction: RouteAction) => {return `Fast ${renderHumanReadableContainer(routeAction.format)} cropping in the browser`;}- if (routeAction.type === 'prompt-showcase') {- return 'Prompt Gallery';- }-- if (routeAction.type === 'prompt-showcase-detail') {- return 'Prompt Gallery';- }-throw new Error(`Invalid route action ${routeAction satisfies never}`);};@@ -211,14 +197,6 @@ export const getPageTitle = (routeAction: RouteAction) => {return `Online ${renderHumanReadableContainer(routeAction.format)} Cropper - Remotion Convert`;}- if (routeAction.type === 'prompt-showcase') {- return 'Prompt Gallery - Remotion';- }-- if (routeAction.type === 'prompt-showcase-detail') {- return 'Prompt Gallery - Remotion';- }-throw new Error(`Invalid route action ${routeAction satisfies never}`);};@@ -285,14 +263,6 @@ export const getDescription = (routeAction: RouteAction) => {return `The fastest online ${renderHumanReadableContainer(routeAction.format)} cropper, powered by WebCodecs. No upload required, no watermarks, no limits.`;}- if (routeAction.type === 'prompt-showcase') {- return 'Browse AI-generated video prompts created with Remotion Skills. Get inspired and create your own.';- }-- if (routeAction.type === 'prompt-showcase-detail') {- return 'Browse AI-generated video prompts created with Remotion Skills. Get inspired and create your own.';- }-throw new Error(`Invalid route action ${routeAction satisfies never}`);};@@ -353,13 +323,5 @@ export const makeSlug = (routeAction: RouteAction) => {return `/crop/${routeAction.format}`;}- if (routeAction.type === 'prompt-showcase') {- return '/prompts';- }-- if (routeAction.type === 'prompt-showcase-detail') {- return '/prompts/show';- }-throw new Error(`Invalid route action ${routeAction satisfies never}`);};diff --git a/packages/docs/copy-convert.ts b/packages/docs/copy-convert.tsindex 91c6d2e2e6..5e33bab18e 100644--- a/packages/docs/copy-convert.ts+++ b/packages/docs/copy-convert.ts@@ -107,14 +107,6 @@ extraPages.push({type: 'timing-editor',});-extraPages.push({- type: 'prompt-showcase',-});--extraPages.push({- type: 'prompt-showcase-detail',-});-for (const page of extraPages) {const slug = seo.makeSlug(page);const pageTitle = seo.getPageTitle(page);