diff --git a/src/timelines/MediaAttachmentGrid.tsx b/src/timelines/MediaAttachmentGrid.tsx index e22a767..2ae56be 100644 --- a/src/timelines/MediaAttachmentGrid.tsx +++ b/src/timelines/MediaAttachmentGrid.tsx @@ -81,58 +81,52 @@ const MediaAttachmentGrid: Component<{ > {(item, index) => { - const [loaded, setLoaded] = createSignal(false); - const width = item.meta?.small?.width; - const height = item.meta?.small?.height; - const aspectRatio = item.meta?.small?.aspect; - const maxHeight = vh35(); - const realHeight = height && height > maxHeight ? maxHeight : height; - const realWidth = - width && height && height > maxHeight - ? maxHeight * (aspectRatio ?? 1) - : width; - const style = () => - loaded() - ? undefined - : { - width: realWidth ? `${realWidth}px` : undefined, - height: realHeight ? `${realHeight}px` : undefined, - }; + // I don't know why mastodon does not return this + // and the condition for it to return this. + // Anyway, It is useless now. + // My hope is the FastAverageColor, but + // we may need better tool to manage the performance impact + // before using this. See #37. + // TODO: use fast average color to extract accent color + const accentColor = item.meta?.colors?.accent; switch (item.type) { case "image": return ( {item.description ); case "video": return (