Skip to content

Commit

Permalink
chore: pin onchainkit, update aspect ratio classname (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasc authored Feb 24, 2024
1 parent 03aea54 commit 27affc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions framegear/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ 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 +40,7 @@ function ValidFrame({ tags }: { tags: Record<string, string> }) {
});
return {
image,
imageAspectRatio,
imageAspectRatioClassname,
input,
buttons,
};
Expand All @@ -49,7 +50,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
2 changes: 1 addition & 1 deletion framegear/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "jest"
},
"dependencies": {
"@coinbase/onchainkit": "^0.9.4",
"@coinbase/onchainkit": "0.9.4",
"@radix-ui/react-icons": "^1.3.0",
"jotai": "^2.6.4",
"next": "14.1.0",
Expand Down
4 changes: 2 additions & 2 deletions framegear/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ __metadata:
languageName: node
linkType: hard

"@coinbase/onchainkit@npm:^0.9.4":
"@coinbase/onchainkit@npm:0.9.4":
version: 0.9.4
resolution: "@coinbase/onchainkit@npm:0.9.4"
peerDependencies:
Expand Down Expand Up @@ -3193,7 +3193,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "framegear@workspace:."
dependencies:
"@coinbase/onchainkit": "npm:^0.9.4"
"@coinbase/onchainkit": "npm:0.9.4"
"@radix-ui/react-icons": "npm:^1.3.0"
"@testing-library/jest-dom": "npm:^6.4.2"
"@testing-library/react": "npm:^14.2.1"
Expand Down

0 comments on commit 27affc7

Please sign in to comment.