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

fix: card push fee staking pool visual style #1933

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wolfcito
Copy link

Pull Request Template

Ticket Number

Description

  • Problem/Feature:
    The claim button on the "PUSH Fee Staking Pool" card wasn't displaying correctly. Additionally, the label for "Current APR" was misaligned, affecting the overall user interface and readability. This PR addresses these UI bugs and corrects the visual display of these components.

Type of Change

  • Bug fix
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe):

Checklist

  • Quick PR: Is this a quick PR? Can be approved before finishing a coffee.
    • Quick PR label added
  • Not Merge Ready: Is this PR dependent on some other PR/tasks and not ready to be merged right now.
    • DO NOT Merge PR label added

Frontend Guidelines

Build & Testing

  • No errors in the build terminal
  • Engineer has tested the changes on their local environment
  • Engineer has tested the changes on deploy preview

Screenshots/Video with Explanation

before

  • Before:
    The claim button was not aligned properly, and the text for the "Current APR" was displayed vertically, making it hard to read and breaking the layout.

after

  • After:
    The claim button is now properly aligned and the label for "Current APR" is displayed horizontally with clear readability, improving the overall UI of the "PUSH Fee Staking Pool" card.

Additional Context

  • These changes are part of UI fixes for the staking section of the dashboard, focusing on improving clarity and user experience.

Review & Approvals

  • Self-review completed
  • Code review by at least one other engineer
  • Documentation updates if applicable

Notes

  • This PR includes fixes only for UI issues observed on the "PUSH Fee Staking Pool" card.

@wolfcito wolfcito changed the title Fix/card push fee staking pool fix: card push fee staking pool visual style Oct 22, 2024
@abhishek-01k abhishek-01k self-requested a review October 23, 2024 06:46
@abhishek-01k abhishek-01k assigned wolfcito and unassigned wolfcito Oct 23, 2024
@@ -41,6 +41,7 @@ const StyledButton = styled.button<ButtonProps>`
justify-content: center;
white-space: nowrap;
flex-shrink: 0;
flex: 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We cannot add this here as this will affect Button Design which is used in other places.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of changing Button in design component. Change the Button here

In line no. 819

<Button
  size="medium"
  disabled={true}
  block
>

Add this and then try.

Copy link
Author

Choose a reason for hiding this comment

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

Hello @abhishek-01k

I reviewed the code again and noticed that, since block internally applies width: 100%, this behavior makes the button occupy the entire width of the container as a single element. However, in a flexbox container with multiple elements, this causes overflow, as each button tries to take 100% of the container's width.

For this reason, I believe the best options to address this problem are:

Op1: Using styled-components inline css:

css={css`flex: 1;`}

Op2: Supporting the flex property (instead of my previous change flex: 1;,

${({ flex }) => flex && flex: ${flex};}

Op3: Or creating a wrapper for the buttons, similar to the StakingToolTip component.

<StakingToolTip >
   <Button />
   <Button />
</StakingToolTip >

Based on this, to keep the component reusable, maintain more precise control over the design, and preserve adaptability, I would personally suggest extending the component to support the flex property (Option 2).

Therefore, I would like to confirm which of these options you would prefer me to adopt.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hey @wolfcito,

Yeah you are right about using block. It would create overflow issue.

I think right now go with Option 1 because we are still working on Design system components and we will extend the property of Button to support flex property as well. Thanks for pointing out the issue.

Copy link
Author

Choose a reason for hiding this comment

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

hello @abhishek-01k , It's done!

I have made the adjustment to the Push and Uniswap cards.

Copy link
Author

Choose a reason for hiding this comment

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

Hello @rohitmalhotra1420, I hope you'll have a chance to review it. 🙂

Comment on lines 726 to 728
css={css`
flex: 1;
`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
css={css`
flex: 1;
`}
<Box display="flex" width="-webkit-fill-available">
<Button
variant="outline"
size="medium"
block
>
...
</Button>
</Box>

@wolfcito please follow this approach.

This can import Box component like this:

import { Box } from "blocks"

Copy link
Author

Choose a reason for hiding this comment

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

Super cool @rohitmalhotra1420 , that component was exactly what was needed. I’ve made the adjustment so you can check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants