Skip to content

Commit

Permalink
fix: correct preset return types
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherdjerred committed Jul 1, 2024
1 parent c233c2f commit 21e668a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ on:
branches:
- main
pull_request:

name: ci

jobs:
ci:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions src/presets/blackAndWhite.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import type { RenderFunctionInput } from "../types.js";

export function blackAndWhite({ title, description }: RenderFunctionInput): React.ReactNode {
return (
export function blackAndWhite({ title, description }: RenderFunctionInput): Promise<React.ReactNode> {
return Promise.resolve(
<div
style={{
height: "100%",
Expand Down Expand Up @@ -30,6 +30,6 @@ export function blackAndWhite({ title, description }: RenderFunctionInput): Reac
>
{description ?? ""}
</div>
</div>
</div>,
);
}
6 changes: 3 additions & 3 deletions src/presets/gradients.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import type { RenderFunctionInput } from "../types.js";

export function gradients({ title, description }: RenderFunctionInput): React.ReactNode {
return (
export function gradients({ title, description }: RenderFunctionInput): Promise<React.ReactNode> {
return Promise.resolve(
<div
style={{
display: "flex",
Expand Down Expand Up @@ -36,6 +36,6 @@ export function gradients({ title, description }: RenderFunctionInput): React.Re
>
{description ?? ""}
</div>
</div>
</div>,
);
}
3 changes: 2 additions & 1 deletion src/presets/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { RenderFunction } from "../types.js";
import { backgroundImage } from "./backgroundImage.js";
import { blackAndWhite } from "./blackAndWhite.js";
import { brandedLogo } from "./brandedLogo.js";
Expand All @@ -9,7 +10,7 @@ import { tailwind } from "./tailwind.js";
import { vercel } from "./vercel.js";
import { waveSvg } from "./waveSvg.js";

export const presets = {
export const presets: Record<string, RenderFunction> = {
blackAndWhite,
gradients,
rauchg,
Expand Down
6 changes: 3 additions & 3 deletions src/presets/rauchg.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import type { RenderFunctionInput } from "../types.js";

export function rauchg({ title }: RenderFunctionInput): React.ReactNode {
return (
export function rauchg({ title }: RenderFunctionInput): Promise<React.ReactNode> {
return Promise.resolve(
<div
style={{
display: "flex",
Expand Down Expand Up @@ -58,6 +58,6 @@ export function rauchg({ title }: RenderFunctionInput): React.ReactNode {
>
{title}
</div>
</div>
</div>,
);
}
6 changes: 3 additions & 3 deletions src/presets/vercel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import type { RenderFunctionInput } from "../types.js";

export function vercel({ title }: RenderFunctionInput): React.ReactNode {
return (
export function vercel({ title }: RenderFunctionInput): Promise<React.ReactNode> {
return Promise.resolve(
<div
style={{
height: "100%",
Expand Down Expand Up @@ -43,6 +43,6 @@ export function vercel({ title }: RenderFunctionInput): React.ReactNode {
>
<b>{title}</b>
</div>
</div>
</div>,
);
}

0 comments on commit 21e668a

Please sign in to comment.