Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/UI ux enhancement framegear #1241

Merged

Conversation

adarshswaminath
Copy link
Contributor

Enhance Home Component with Layout, Loading State, and Placeholder Improvements

What changed? Why?

This PR includes the following changes:

  1. Improved Responsiveness and Layout:

    • Updated the grid layout in the Home component to ensure better responsiveness: now a single column on smaller screens and two columns on larger screens.
    • Added padding (p-2) to the main container for better spacing and improved layout on all screen sizes.
  2. Loading State in FrameInput Component:

    • Added a loading state to the fetchFrame API call in FrameInput. The button now reflects "Loading..." when the API call is in progress, enhancing user experience.
  3. Placeholder for Missing Images:

    • Added placeholders to handle missing images, ensuring the UI remains clean and informative even when images are unavailable.

Notes to reviewers

  • Please focus on checking the responsiveness of the layout across different screen sizes.
  • Verify that the loading state in the FrameInput component works as expected.
  • Check if the placeholders for missing images are working correctly.

How has it been tested?

  • Manual testing was performed to ensure the layout is responsive on both small and large screens.
  • The loading state was tested by simulating a slow API call, confirming the button updates appropriately.
  • Missing images were tested by intentionally breaking image links, verifying the placeholders display properly.

Screenshots:

image
image
image

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 3:33am
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 3:33am

Copy link

vercel bot commented Sep 12, 2024

@adarshswaminath is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

className={`w-full rounded-t-xl ${imageAspectRatioClassname} object-cover`}
src={image.src}
className={`w-full rounded-t-xl ${imageAspectRatioClassname} ${image.src ? "object-cover" : "object-contain"}`}
src={image.src ? image.src : "https://demofree.sirv.com/nope-not-here.jpg?w=750"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry we can not have links here on random websites.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be acceptable if I add the images directly to the public folder of the project and reference them from there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, but only if it's a cool image. If it's not, is probably best have something else as default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
is it ok ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is best we avoid add those kind of images so far. As we want our designer to take a look at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll update the image based on the designer's review.

@@ -28,12 +31,12 @@ export function FrameInput() {
/>
</label>
<button
className="h-[40px] self-end rounded-full bg-white text-black"
className={`h-[40px] self-end rounded-full ${isLoading ? "bg-neutral-800 text-white" : "bg-white text-black"}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can use clx on Framegear as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will implement the clx

@Zizzamia
Copy link
Contributor

I am going to have @brendan-defi review this as well, as he is leading our effort to keep polish Framegear.

@@ -76,10 +85,6 @@ function ValidFrame({ metadata }: { metadata: FrameMetadataWithImageObject }) {
}

function ErrorFrame() {
// TODO: implement -- decide how to handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely acknowledge that this isn't elegant, but let's not remove. We will work on cleaning up these comments.

@@ -116,14 +121,12 @@ function FrameButton({

const handleClick = useCallback(async () => {
if (button?.action === 'post' || button?.action === 'post_redirect') {
// TODO: collect user options (follow, like, etc.) and include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above, let's keep this comment

const confirmAction = async () => {
const result = await postFrame(
{
buttonIndex: index,
url: (button as any).postUrl!,
state: JSON.stringify(state),
// TODO: make these user-input-driven
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -136,7 +139,6 @@ function FrameButton({
},
mockFrameOptions
);
// TODO: handle when result is not defined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -162,7 +164,6 @@ You can test this action on the official Warpcast validator: https://warpcast.co
(must deploy frame to a publicly accessible URL)`
);
}
// TODO: implement other actions (mint, etc.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@brendan-defi
Copy link
Contributor

I am going to have @brendan-defi review this as well, as he is leading our effort to keep polish Framegear.

Thanks @Zizzamia !

@adarshswaminath Thanks for taking the time to work on this. The responsiveness and the loading state on the fetch-button are nice, good work. :-)

Left a few comments. Most importantly, I don't think we should add an placeholder image like this though. This generic 404 isn't really the right message (the issue isn't necessarily a 404, it's that the image for that frame isn't valid, which can happen for many reasons). With these changes I think you'll be g2g.

Thanks!

@adarshswaminath
Copy link
Contributor Author

@brendan-defi Thankyou for the review :) I don’t know why I removed those comments earlier :(
I have now added them back. Instead of the placeholder image, I have added a 'No Image Found' message, which is straightforward for the user to understand that there is no image to display.
image

@brendan-defi
Copy link
Contributor

@brendan-defi Thankyou for the review :) I don’t know why I removed those comments earlier :( I have now added them back. Instead of the placeholder image, I have added a 'No Image Found' message, which is straightforward for the user to understand that there is no image to display.

Thanks @adarshswaminath, nice work :-)

@adarshswaminath
Copy link
Contributor Author

Thank you! Actually, these comments from @brendan-defi and @Zizzamia are really exciting for a newbie like me. Getting positive feedback from such a great team feels like the next level :-) . Is this PR ready to merge?

@Zizzamia Zizzamia merged commit 76c1edb into coinbase:main Sep 14, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants