-
Notifications
You must be signed in to change notification settings - Fork 393
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
DSL connection: Add new default wallet toggle top bar #3448
Conversation
0fffc8f
to
e777c49
Compare
This was being handled in Popup, but these bars are really a property of the page itself—for example, the transaction signing page has a different top bar and no tab bar, pages like Settings have the tab bar but no top bar, and the wallet has both. While this commit does not move all bar handling into the pages themselves, it does start moving the management of them into the page definitions by having `CorePage` take charge of rendering the tab and top bars (or not) depending on the parameters it is passed.
`onColor` and `offColor` parameters allow modifying the colors that the toggle's bulb takes on when it's turned on as well as when it's turned off. `leftToRight`, defaulting to `true`, indicates that the toggle is off on the left and on when on the right. Passing it as `false` flips the two horizontally.
Mostly this means we get to drop an extraneous div, and simplify styling overall to let flexbox do its thing instead of forcing widths and heights in several places.
The default toggle is always visible now, so showing the banner when a recent change has been made is unnecessary.
This component allows the user to manage the active dApp connection, as well as allowing them to always toggle the default wallet to/from Taho. The popup window with information on connecting to dApps when they are not connected yet needs some refinement for the new default connection approach, but that will be done separately.
These had drifted from the design system at some point, and are now anchored back to the values in Figma. All of the green shades and a few others have been tweaked.
This needs to be paired with a delayed removal of the component from the DOM, which cannot be handled in CSS unfortunately...
e777c49
to
d45eaf8
Compare
This gives all icons that have accessible labels also have proper tooltips for regular users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left some comments. Are we reverting the color changes in this PR or do we want to do that in the other one and merge that here?
SharedToggleButton.defaultProps = { | ||
leftToRight: true, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to default parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not really what we've been doing... If we want to do that we should systematically convert to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To wit:
shadowfiend@theano ~/g/t/extension /cable-connection> ag -l defaultProps | wc -l
20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh yeah there are also a few places where we're doing both. My reasoning is that there's no real advantage to use default props over parameter defaulting and it doesn't play well with typescript ( one known issue with forwarding refs ). Default props is also getting deprecated but, while I don't think it's happening anytime soon I feel this just provides another place where we could miss out potential bugs. If we're going back to defaultProps
then I suggest we should create an issue like #1120.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love an issue--but to move away from defaultProps. I just don't want to do it inconsistently, I think using the language feature rather than the framework feature is the right call.
For context, IIRC when we first built things out we had issues with typing and linting and param defaults which, combined with how common defaultProps was in the react literature, convinced us to stick to that to start with.
@@ -36,16 +37,15 @@ export default function CorePage(props: Props): ReactElement { | |||
align-items: center; | |||
background-color: var(--hunter-green); | |||
z-index: 10; | |||
height: calc(100vh - ${barSpace}px); | |||
margin-top: ${hasTopBar ? "0px" : "-64px"}; | |||
height: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is making pages larger which adds scrolling where it not needed 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I remember having to disentangle some serious stuff when I tackled this a few months ago. I think this is the least bad option without going deep on the DOM (which I'm planning to do next week), since the bar space situation has changed with the new work.
Are there any places where this seems egregious right now?
I personally would love to make everything in CSS kebab-case, but we're deep into using snake_case. Notably, fadeIn is in camelCase; it will be converted to snake_case soon.
This reverts commit 76ec40e. While there has been significant drift between these colors and the same named ones used in Figma, checking in with design indicated that the drift is a Figma issue. Pending a review on the design side of what's in Figma, we're bringing these back to their current values.
Made all of the changes I'm down for rn, but happy to discuss the other stuff further if desired! |
Co-authored-by: Jorge Luis <28708889+hyphenized@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🚢 🚢
I noticed one small style issue caused by these changes when the feature flag is enabled. I just reported it. #3474 |
Good catch thank you! |
## What's Changed * Fix broken E2E test removing wallet by @michalinacienciala in #3463 * DSL connection: Add new default wallet toggle top bar by @Shadowfiend in #3448 * Pull asset prices from on chain oracles by @0xDaedalus in #3264 * Cable Connection: Implement standard flow for dApp connect popup by @Shadowfiend in #3451 * Slide On Over: Drop an unnecessary z-index on CorePage by @Shadowfiend in #3476 * Restructure the settings page by @kkosiorowska in #3450 * Exclude `article` and `result` types for abilities by @kkosiorowska in #3479 * Release 0.37.0 by @Shadowfiend in #3461 **Full Changelog**: v0.37.0...v0.38.0 Latest build: [extension-builds-3480](https://github.com/tahowallet/extension/suites/13630673975/artifacts/752046785) (as of Thu, 15 Jun 2023 13:51:01 GMT).
To do this, we also restructure the top bar and, in the process,
the tab bar's management in
CorePage
. These give us the spaceand tools to set up the new
DAppConnection
component, which nowcontains the default wallet toggle and the current dApp connection's
information.
More changes in here than I would like, but it's mostly moving stuff
around from
TopMenu
intoDAppConnection
,ActiveDAppConnection
, andDAppConnectionDefaultToggle
. I do want to move a lot of the permissiontomfoolery out of the components and into redux and/or the services, but
that'll be later.
Testing
Latest build: extension-builds-3448 (as of Mon, 12 Jun 2023 01:01:56 GMT).