import type { Shout } from '../../graphql/schema/core.gen' import { createComputed, createSignal, Show, For } from 'solid-js' import { ArticleCard } from './ArticleCard' import { ArticleCardProps } from './ArticleCard/ArticleCard' const x = [ ['12', '12'], ['8', '16'], ['16', '8'], ] export const Row2 = (props: { articles: Shout[] isEqual?: boolean nodate?: boolean noAuthorLink?: boolean noauthor?: boolean }) => { const [y, setY] = createSignal(0) // FIXME: random can break hydration createComputed(() => setY(Math.floor(Math.random() * x.length))) return ( 0}>
{(a, i) => { // FIXME: refactor this, too ugly now const className = `col-md-${props.isEqual ? '12' : x[y()][i()]}` let desktopCoverSize: ArticleCardProps['desktopCoverSize'] switch (className) { case 'col-md-8': { desktopCoverSize = 'S' break } case 'col-md-12': { desktopCoverSize = 'M' break } default: { desktopCoverSize = 'L' } } return (
) }}
) }