Skip to content

Commit

Permalink
fix: aspect ratio classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasc committed Feb 24, 2024
1 parent 77cd765 commit fb036d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions framegear/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export function Frame() {
}

function ValidFrame({ tags }: { tags: Record<string, string> }) {
const { image, imageAspectRatio, input, buttons } = useMemo(() => {
const { image, imageAspectRatioClassname, input, buttons } = useMemo(() => {
const image = tags['fc:frame:image'];
const imageAspectRatio = tags['fc:frame:image:aspect_ratio'] === '1:1' ? '1/1' : '1.91/1';
const imageAspectRatioClassname = tags['fc:frame:image:aspect_ratio'] === '1:1' ? 'aspect-square' : 'aspect-[1.91/1]';
const input = tags['fc:frame:input:text'];
// TODO: when debugger is live we will also need to extract actions, etc.
const buttons = [1, 2, 3, 4].map((index) => {
Expand All @@ -39,7 +39,7 @@ function ValidFrame({ tags }: { tags: Record<string, string> }) {
});
return {
image,
imageAspectRatio,
imageAspectRatioClassname,
input,
buttons,
};
Expand All @@ -49,7 +49,7 @@ function ValidFrame({ tags }: { tags: Record<string, string> }) {
<div>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
className={`w-full rounded-t-xl aspect-[${imageAspectRatio}] object-cover`}
className={`w-full rounded-t-xl ${imageAspectRatioClassname} object-cover`}
src={image}
alt=""
/>
Expand Down

0 comments on commit fb036d7

Please sign in to comment.