fix: images in /today expanding parent

This commit is contained in:
TresAbhi committed 2023-06-06 00:25:23 +00:00
1 parent 632881c6b0
commit 26e78c72b9
7 files changed
+13 -30

No files matched your search

+2 -6
View File
@@ -2,7 +2,6 @@ import { Resvg } from '@resvg/resvg-js';
import { readFile } from 'fs';
import { ReactNode } from 'react';
import satori from 'satori';
import { WRAPPER_SIZE_WIDTHS, WrapperSize } from '../../components/Wrapper.js';
const FONT_NAME = 'Roboto';
const FONT_FILES = ['Roboto', 'Roboto-Bold', 'Roboto-Black'];
@@ -21,12 +20,9 @@ const [robotoFlex, robotoFlexBold, robotoFlexBlack] = await Promise.all(
);
console.log('Fonts imported');
export default async function render(
element: ReactNode,
size: WrapperSize = WrapperSize.Regular,
) {
export default async function render(element: ReactNode) {
const svg = await satori(element, {
width: WRAPPER_SIZE_WIDTHS[size],
width: 640,
fonts: [
{ data: robotoFlex, name: FONT_NAME, weight: 400 },
{ data: robotoFlexBold, name: FONT_NAME, weight: 700 },