Skip to content

Commit

Permalink
feat(showcase): adding zod type for showcases with default values (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
CruuzAzul authored May 3, 2024
1 parent 93737b9 commit 266a4be
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {Composition, Folder} from 'remotion';

import {defaultTalkValues} from '../../../../src/data/defaultValues';
import {ShowcaseSchema} from '../showcases.types';

import {AlpesCraft} from './AlpesCraft';

Expand All @@ -15,6 +16,7 @@ export const AlpesCraftComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
</Folder>
Expand Down
6 changes: 4 additions & 2 deletions remotion/compositions/showcases/alpescraft/AlpesCraft.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import {AbsoluteFill, Sequence} from 'remotion';
import {z} from 'zod';

import {Speaker} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Details} from './Details';
import {Logo} from './Logo';
Expand All @@ -18,13 +20,13 @@ export type AlpesCraftProps = {
speakers?: Speaker[];
};

export const AlpesCraft: React.FC<AlpesCraftProps> = ({
export const AlpesCraft = ({
title,
date,
time,
location,
speakers,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill
style={{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import {Composition, Folder} from 'remotion';

import {DevfestLille} from './DevfestLille';
import {defaultTalkValues} from '../../../../src/data/defaultValues';
import React from 'react';
import {ShowcaseSchema} from '../showcases.types';

import {DevfestLille} from './DevfestLille';

export const DevfestLilleComposition: React.FC = () => {
return (
Expand All @@ -14,6 +16,7 @@ export const DevfestLilleComposition: React.FC = () => {
fps={60}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
</Folder>
Expand Down
9 changes: 5 additions & 4 deletions remotion/compositions/showcases/devfestLille/DevfestLille.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import {loadFont} from '@remotion/google-fonts/CrimsonText';
import {AbsoluteFill, Sequence} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Background} from './Background';
import {Details} from './Details';
import {Logo} from './Logo';
import {Speakers} from './Speakers';
import {TalkTitle} from './TalkTitle';
import {Background} from './Background';
import {Logo} from './Logo';

const {fontFamily} = loadFont();
export const DevfestLille = ({
Expand All @@ -17,7 +18,7 @@ export const DevfestLille = ({
date,
time,
location,
}: DefaultProps) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {Composition, Folder} from 'remotion';

import {defaultTalkValues} from '../../../../src/data/defaultValues';
import {ShowcaseSchema} from '../showcases.types';

import {DevfestNantes} from './DevfestNantes';
import {DevfestNantesLoop} from './DevfestNantesLoop';
Expand All @@ -18,6 +19,7 @@ export const DevfestNantesComposition = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand All @@ -27,6 +29,7 @@ export const DevfestNantesComposition = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand All @@ -36,6 +39,7 @@ export const DevfestNantesComposition = () => {
fps={30}
width={720}
height={1280}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import {loadFont} from '@remotion/google-fonts/CrimsonText';
import {AbsoluteFill, Sequence, staticFile} from 'remotion';
import {z} from 'zod';

import {BackgroundFiller} from '../../../design/atoms/BackgroundFiller';
import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Android} from './Android';
import {Details} from './Details';
Expand All @@ -19,7 +20,7 @@ export const DevfestNantes = ({
date,
time,
location,
}: DefaultProps) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import {
staticFile,
useCurrentFrame,
} from 'remotion';
import {z} from 'zod';

import {BackgroundFiller} from '../../../design/atoms/BackgroundFiller';
import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Android} from './Android';
import {Details} from './Details';
Expand All @@ -26,7 +27,7 @@ export const DevfestNantesLoop = ({
date,
time,
location,
}: DefaultProps) => {
}: z.infer<typeof ShowcaseSchema>) => {
const frame = useCurrentFrame();

const SlideDown = interpolate(frame, [300, 330], [0, 650], {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import {
staticFile,
useCurrentFrame,
} from 'remotion';
import {z} from 'zod';

import {BackgroundFiller} from '../../../design/atoms/BackgroundFiller';
import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Android} from './Android';
import {Details} from './Details';
Expand All @@ -27,7 +28,7 @@ export const DevfestNantesLoopTotem = ({
date,
time,
location,
}: DefaultProps) => {
}: z.infer<typeof ShowcaseSchema>) => {
const frame = useCurrentFrame();

const SlideDown = interpolate(frame, [300, 330], [0, 1300], {
Expand Down
3 changes: 3 additions & 0 deletions remotion/compositions/showcases/devoxx/Devoxx.composition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {Composition, Folder} from 'remotion';

import {defaultTalkValues} from '../../../../src/data/defaultValues';
import {ShowcaseSchema} from '../showcases.types';

import {Devoxx2023} from './Devoxx2023';
import {Devoxx2024} from './Devoxx2024';
Expand All @@ -16,6 +17,7 @@ export const DevoxxComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand All @@ -25,6 +27,7 @@ export const DevoxxComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
</Folder>
Expand Down
7 changes: 4 additions & 3 deletions remotion/compositions/showcases/devoxx/Devoxx2023.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import Balloons from './Balloons';
import {Details} from './Details';
import {Logo} from './Logo';
import {Speakers} from './Speakers';
import {TalkTitle} from './TalkTitle';

export const Devoxx2023: React.FC<DefaultProps> = ({
export const Devoxx2023 = ({
title,
speakers,
date,
time,
location,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const ANIMATION_DELAY = 50;
Expand Down
7 changes: 4 additions & 3 deletions remotion/compositions/showcases/devoxx/Devoxx2024.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Details} from './2024/Details';
import {Logo} from './2024/Logo';
import {RobotRun} from './2024/RobotRun';
import {Speakers} from './2024/Speakers';
import {TalkTitle} from './2024/TalkTitle';

export const Devoxx2024: React.FC<DefaultProps> = ({
export const Devoxx2024 = ({
title,
speakers,
date,
time,
location,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const ANIMATION_DELAY = 50;
Expand Down
3 changes: 3 additions & 0 deletions remotion/compositions/showcases/mixit/Mixit.composition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {Composition, Folder} from 'remotion';

import {defaultTalkValues} from '../../../../src/data/defaultValues';
import {ShowcaseSchema} from '../showcases.types';

import {Mixit} from './Mixit';
import {MixitIntro} from './MixitIntro';
Expand All @@ -18,6 +19,7 @@ export const MixitComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand All @@ -35,6 +37,7 @@ export const MixitComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
<Composition
Expand Down
7 changes: 4 additions & 3 deletions remotion/compositions/showcases/mixit/Mixit.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {AbsoluteFill} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Details} from './Details';
import {Logo} from './Logo';
import {LyonSkyline} from './LyonSkyline';
import {Speakers} from './Speakers';
import {TalkTitle} from './TalkTitle';

export const Mixit: React.FC<DefaultProps> = ({
export const Mixit = ({
title,
speakers,
date,
time,
location,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill
style={{
Expand Down
7 changes: 4 additions & 3 deletions remotion/compositions/showcases/mixit/MixitIntroTalk.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import {AbsoluteFill} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Mixit} from './Mixit';
import {MixitIntro} from './MixitIntro';

export const MixitIntroTalk: React.FC<DefaultProps> = ({
export const MixitIntroTalk = ({
title,
speakers,
date,
time,
location,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill>
<MixitIntro />
Expand Down
14 changes: 14 additions & 0 deletions remotion/compositions/showcases/showcases.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {z} from 'zod';

const SpeakerSchema = z.object({
name: z.string(),
picture: z.string(),
});

export const ShowcaseSchema = z.object({
title: z.string(),
speakers: z.array(SpeakerSchema),
date: z.string(),
time: z.string(),
location: z.string(),
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {Composition, Folder} from 'remotion';

import {defaultTalkValues} from '../../../../src/data/defaultValues';
import {ShowcaseSchema} from '../showcases.types';

import {Snowcamp} from './Snowcamp';

Expand All @@ -15,6 +16,7 @@ export const SnowcampComposition: React.FC = () => {
fps={30}
width={1280}
height={720}
schema={ShowcaseSchema}
defaultProps={defaultTalkValues}
/>
</Folder>
Expand Down
7 changes: 4 additions & 3 deletions remotion/compositions/showcases/snowcamp/Snowcamp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import {AbsoluteFill, Sequence} from 'remotion';
import {z} from 'zod';

import {DefaultProps} from '../../../types/defaultProps.types';
import {ShowcaseSchema} from '../showcases.types';

import {Details} from './Details';
import {Logo} from './Logo';
Expand All @@ -10,13 +11,13 @@ import {Speakers} from './Speakers';
import {TalkBackground} from './TalkBackground';
import {TalkTitle} from './TalkTitle';

export const Snowcamp: React.FC<DefaultProps> = ({
export const Snowcamp = ({
title,
speakers,
date,
time,
location,
}) => {
}: z.infer<typeof ShowcaseSchema>) => {
return (
<AbsoluteFill style={{backgroundColor: 'white', overflow: 'hidden'}}>
<Sequence>
Expand Down
Loading

0 comments on commit 266a4be

Please sign in to comment.