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
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/blocks/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.


/* Common icon css added through CSS class */
.icon {
Expand Down
2 changes: 1 addition & 1 deletion src/components/yield/YieldPushFeeV3.tsx
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. 🙂

Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ const OuterContainer = styled.div`
position: relative;
@media ${device.tablet} {
width: 100%;
min-width: 100%;
/* min-width: 100%; */
max-width: 100%;
}
`;
Expand Down