-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Consolidate connected account alerts #8802
Conversation
b3257a1
to
c1c561c
Compare
ui/app/components/app/alerts/unconnected-account-alert/unconnected-account-alert.scss
Outdated
Show resolved
Hide resolved
shouldRenderListOptions: (props, propName, componentName) => { | ||
if (props[propName]) { | ||
if (typeof props[propName] !== 'boolean') { | ||
return new Error( | ||
`${componentName}: '${propName}' must be a boolean if provided.` | ||
) | ||
} | ||
if (!props['removePermittedAccount']) { | ||
return new Error( | ||
`${componentName}: '${propName}' requires 'removePermittedAccount'.` | ||
) | ||
} | ||
} | ||
}, |
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.
removePermittedAccount
is used in disconnectAccount
, which is only called if the list item options are rendered. So, if shouldRenderListOptions === true
, removePermittedAccount
must be provided. Otherwise, we don't care.
I'm not completely happy with this solution, but it works. I'm very open to suggestions!
ddb5a21
to
6db7890
Compare
Builds ready [6db7890]
Page Load Metrics (1189 ± 68 ms)
|
6db7890
to
2532b89
Compare
Builds ready [2532b89]
Page Load Metrics (651 ± 24 ms)
|
ui/app/pages/connected-accounts/connected-accounts.container.js
Outdated
Show resolved
Hide resolved
/** | ||
* Checks whether a URL-like value (object or string) is an extension URL. | ||
* | ||
* @param {string | URL | object} urlLike - The URL-like value to test. |
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.
Nit: Why make this function more complicated than it needs to be? We only ever pass in a string.
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.
activeTab
is not a string, but an object with a protocol
property, much like a URL
object.
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.
Of course, knowing that, we could simply pass it the protocol
string of that object. I'm fine with that if you prefer.
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.
Or the origin
, which is what we used to be comparing against.
It doesn't really matter. Just that it's nice to avoid branches if possible, and it's nice to have clearer type signatures.
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
ui/app/components/app/alerts/unconnected-account-alert/unconnected-account-alert.scss
Outdated
Show resolved
Hide resolved
ui/app/components/app/alerts/unconnected-account-alert/unconnected-account-alert.scss
Outdated
Show resolved
Hide resolved
ui/app/components/app/alerts/unconnected-account-alert/unconnected-account-alert.scss
Outdated
Show resolved
Hide resolved
Builds ready [c78e377]
Page Load Metrics (644 ± 11 ms)
|
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
|
Builds ready [bb9bb6a]
Page Load Metrics (871 ± 57 ms)
|
Builds ready [ef4aabe]
Page Load Metrics (694 ± 39 ms)
|
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.
LGTM!
* origin/develop: (58 commits) Fix site icon fallback letter (#8815) add hover style to list-item (#8813) Fix site icon size (#8814) Consolidate connected account alerts (#8802) lowercase web3 Use markdown-to-jsx@6.11.4 (#8809) Update app/_locales/en/messages.json Update app/_locales/en/messages.json also remove 'dapp' from descriptions remove all user-facing instances of 'dapp' update button styling on home/asset page (#8800) Fix handling of permissions of removed accounts (#8803) Clear permssions during createNewVaultAndRestore (#8804) Hide token transfers on ETH asset page (#8799) Fix account name editing (#8801) Fix connect flow account list height (#8798) Update color of menu item icons (#8797) Update "Connected accounts" empty description (#8796) Stop reporting failed transactions to Sentry (#8795) Omit state snapshot from Sentry errors (#8794) ...
Screenshot
Consolidates the two former connected account alerts into one, and updates it to use the
ConnectedAccountsList
component.Summary
switch-to-connected
alert intounconnected-account-alert
ConnectedAccountsList
to implement new designsConnectedAccountPermissions
fromConnectedAccountsList
folderConnectedAccounts
component instead ofConnectedAccountsList
, in thePopover
footerConnectedAccountsList
and other components to support these changesConnectedAccountsList
is functionally identical todevelop
Open Questions