1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

3631 Commits

Author SHA1 Message Date
Mark Stacey
88bed7181f
Refactor token selectors (#8671)
Unused token selectors have been removed, and the remaining token
selector has been moved to the `metamask` Redux store.
2020-05-28 21:43:44 -03:00
Erik Marks
606618ee28
Update eth_accounts permission description (#8693)
* update eth_accounts permission description

* make it easier to find permission name locale message

* handle longer permissions descriptions in UI
2020-05-28 15:53:11 -07:00
Mark Stacey
7ff3b4c928
Extract selected token from token input (#8692)
The `TokenInput` component now takes the token as a prop, instead of
using the `selectedTokenAddress` state. The `UserPreferencedTokenInput`
component that wrapped `TokenInput` has also been updated to take the
token as a prop.
2020-05-28 19:08:11 -03:00
Whymarrh Whitby
91a26bae89
Fix propType for Home defaultHomeActiveTabName (#8683) 2020-05-28 19:15:04 -02:30
Erik Marks
eb7ef4047f
Fix create account form styling (#8689)
* ensure space between create account buttons

* delete wrapper div class name
2020-05-28 13:23:50 -07:00
Mark Stacey
8ed4510d90
Remove unused getSelectedTokenAssetImage selector (#8691)
This selector has been unused as of #8637
2020-05-28 17:17:04 -03:00
Mark Stacey
795676d3ec
Remove getTxParams (#8676)
This function primarily ensured that there was a reasonable fallback
for `txParams` if the given transaction was missing it. This fallback
was only used in one place: the customize gas modal, during the send
flow specifically.

The helper function has been removed, and the default `txParams` is set
in the one place it was needed. In the future we should attempt to
simplify this modal so it doesn't need to know details about the
context in which it's being used.
2020-05-28 16:39:33 -03:00
Brad Decker
00834f5de6
do not show account mismatch alert on details (#8678) 2020-05-28 14:20:56 -05:00
Erik Marks
22699cb1d9
Fix connect hardware styling (#8680)
* Connect -> Hardware

* fix connect hardware styling

* rename some components and classes

* make hardware account scrolling sane
2020-05-28 11:47:48 -07:00
Erik Marks
b34ccbb904
Fix Firefox account menu styling (#8681)
* Fix Firefox account menu styling
2020-05-28 11:02:59 -07:00
Brad Decker
fbe16e8a5f
various fixes to transaction list (#8673) 2020-05-28 13:00:51 -05:00
Whymarrh Whitby
93c2184bd9
Add metrics events for Wyre and CoinSwitch (#8677) 2020-05-28 13:54:52 -02:30
Whymarrh Whitby
f8137b7a66
Fix height of connect screen (#8675) 2020-05-28 12:22:16 -02:30
Whymarrh Whitby
a75dcae9bb
Merge branch 'develop' into manual-connect 2020-05-28 07:20:26 -02:30
Mark Stacey
95a95ee4bc
Refactor transaction list token filtering (#8669)
The transaction list now filters by token in the `TransactionList`
component instead of in the transaction selector. This was done in
preparation for the asset page work.

Technically this approach is slightly less efficient than before, as
we're now filtering the transactions after they've been grouped
together rather than beforehand. The difference is minimal though, and
this method is more correct.

The old filtering was broken because it inappropriately filtered out
cancel transactions. Cancel transactions always have the `to` address
set to the same as the `from` address, and the token filter only
returned transactions where the `to` address was set to the token
address.

Now that we're only filtering by the `to` address of the initial
transaction, token transaction groups will be included in their
entirety, including any cancel transactions.
2020-05-28 00:11:15 -03:00
Mark Stacey
e89540fd94
Fix token decimal type (#8670)
The `decimals` property of tokens was being set as a string instead of
a Number for any tokens added via `getTokenParams`. It's now cast to a
Number instead.
2020-05-27 22:33:59 -03:00
Whymarrh Whitby
5b1608681c Manually connect via the full connect flow 2020-05-27 21:45:41 -02:30
Whymarrh Whitby
145edbe99d
Make address display wider in Account Details (#8665) 2020-05-27 20:11:44 -02:30
Whymarrh Whitby
3931427db8
Show hostname in the disconnect confirmation (#8663) 2020-05-27 19:39:14 -02:30
Whymarrh Whitby
34adccec7c
Fix JSDoc for Tabs#_findChildByName (#8664) 2020-05-27 19:10:26 -02:30
Mark Stacey
cc1170f577
Remove unused isWideViewport prop (#8662)
This prop is no longer required, now that the new fullscreen redesign
has been implemented. This was unused before the redesign as well,
seemingly by accident.
2020-05-27 18:36:55 -03:00
Whymarrh Whitby
4802ed1df5
Localize permission descriptions (#8661) 2020-05-27 18:15:10 -02:30
Mark Stacey
a0d64c7932
Implement new fullscreen design (#8657)
The fullscreen UI now shows roughly the same design as the popup UI.
A few additional changes depicted in the new fullscreen designs will
be implemented in subsequent PRs (e.g. the inline buttons on assets)

This was done now to make asset pages easier to implement. Implementing
asset pages solely for the popup UI would have been complicated by the
fact that we use viewport size to switch between the two layouts, so we
would have had to re-route upon resizing the window.
2020-05-27 17:28:33 -03:00
Brad Decker
398f2647c0
resolve remaining issues with transaction list (#8659) 2020-05-27 14:45:20 -05:00
Mark Stacey
a6f2156386
Update account options menu design (#8654)
The `AccountDetailsDropdown` component has been rewritten to use the
new `Menu` component, and to follow the latest designs.

This should be functionally equivalent. A couple of the icons have
changed, but that's about it.

Support for a subtitle was added to `MenuItem` to support the `origin`
subtitle used for the explorer link for custom RPC endpoints.

A few adjustments were required to `test/helper.js` to accommodate
the use of `Menu` from a JSDOM context (this is the first time it's
been used in a unit test). A `popover-content` element was added to the
fake DOM, and another global was added that `react-popper` used
internally.

An additional driver method (`clickPoint`) was added to the e2e driver
to allow clicking the background behind the menu to dismiss it. This
wasn't possible using the `clickElement` method, because that method
would refuse to click an obscured element. The only non-obscured
element to click was the menu backdrop, and that didn't work either
because the center was obscured by the menu (Selenium clicks the center
of whichever element is targeted).
2020-05-27 12:31:53 -03:00
Brad Decker
706dc02cb4
Implement new transaction list design (#8564)
Co-authored-by: Whymarrh Whitby <whymarrh.whitby@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-05-26 15:49:11 -05:00
Whymarrh Whitby
ab11e0b623
Rename preferencesSelector selector to getPreferences (#8647) 2020-05-26 03:41:58 -02:30
Whymarrh Whitby
835386bf35
Persist home tab state (#8612) 2020-05-25 16:31:28 -02:30
Mark Stacey
3cedf708e9
Remove duplicate 'Account options' tooltip (#8644)
The `title` HTML attribute already resulted in this having a tooltip.
We didn't need to add an extra one.
2020-05-22 14:42:09 -03:00
Mark Stacey
8379dd6a07
Refactor MenuBar component (#8643)
The `MenuBar` component has been converted to a functional component.
This was done to make upcoming changes related to the home screen
redesign easier to implement.
2020-05-22 14:11:42 -03:00
Brad Decker
684c58b94e
fix prop name for disconnect icon (#8641) 2020-05-21 16:12:38 -05:00
Brad Decker
389df9dd37
warn user when sending from different account (#8601) 2020-05-21 15:21:34 -05:00
Mark Stacey
dd41870f1d
Split TransactionViewBalance component (#8637)
The `TransactionViewBalance` component has been split into three
separate components. This was done primarily to make the asset page
easier to implement. Also the name `TransactionViewBalance` didn't
describe this component very well anymore.

Instead of the Ethereum and token-specific logic being in the same
component, the two cases were split into the `EthOverview` and
`TokenOverview` components respectively. They both use the
`WalletOverview` component, which has the structure shared by both
cases.
2020-05-21 14:33:48 -03:00
Mark Stacey
57531ad100
Fix AssetList metric events (#8639)
The metric events in the `AssetList` component were using the
`useMetricEvent` hook incorrectly.
2020-05-21 13:06:06 -03:00
Brad Decker
f9ea9b541a
add useI18nContext shortcut hook (#8635) 2020-05-21 10:26:49 -05:00
Brad Decker
ec99cc82b8
Design QA fixes for v8 (#8630) 2020-05-20 15:42:18 -05:00
Mark Stacey
f886686db2
Extract Menu component from ConnectedAccountsListOptions (#8632)
A `Menu` component has been extracted from the
`ConnectedAccountsListOptions` component. The menu and the menu items
are now the `Menu` and `MenuItem` components respectively.

A custom body was added to the Storybook preview to ensure that the
`popover-content` element was present in the DOM before the Menu was
constructed.
2020-05-20 14:52:23 -03:00
Mark Stacey
91953f062b
Remove unused network prop (#8633)
The `Identicon` component was being passed a `network` prop, despite
not accepting a `network` prop.

A duplicate set of `token-cell` tests have also been deleted, as they
used this prop. The tests were never run, because the file was misnamed
(it needs to be named `.test.js`).
2020-05-20 13:51:21 -03:00
Erik Marks
f748664638
Cleanup network enums (#8627)
* cleanup & consolidate network enums
2020-05-20 08:57:45 -07:00
Whymarrh Whitby
4ced792aec
Remove title from Connected Sites modal (#8623) 2020-05-19 14:47:55 -02:30
Whymarrh Whitby
97d65b645a
Delete the ABTestController and its state (#8620) 2020-05-19 13:27:06 -02:30
Whymarrh Whitby
1ba65d5128
Handle zero nextNonce in ConfirmTransactionBase placeholder (#8618) 2020-05-18 21:18:38 -02:30
Whymarrh Whitby
e4b8cddf02
Disallow all anonymous default export, aside from CSF and migrations (#8535)
CSF = Storybook’s Component Story Format (CSF)

See https://storybook.js.org/docs/formats/component-story-format/

Note that the migrations still use CommonJS require, so the default export as
an object is quite ergonomic (& I don't want to touch the migrations).
2020-05-18 21:18:11 -02:30
Whymarrh Whitby
3244449ab9
Use activeTab.origin where possible (#8617)
This changeset updates the `getOriginOfCurrentTab` selector and the container
for the ConnectedSites page to use `activeTab.origin` instead of parsing the
URL. The `activeTab` URL is parsed in `queryCurrentActiveTab` before the UI is
launched and any subsequent parsing of the URL is unnecessary.

See `queryCurrentActiveTab` in `ui.js:86` [1].

  [1]:e7bb0876f5/app/scripts/ui.js (L86-L118)
2020-05-18 20:04:51 -02:30
Whymarrh Whitby
9e8f922c10
Remove unused index for dropdowns (#8615) 2020-05-18 19:14:40 -02:30
Whymarrh Whitby
3485bfbc5c
Sticky position the tabs at the top (#8609) 2020-05-18 16:22:42 -02:30
Mark Stacey
ce11fad81c
Improve account options menu (#8607)
The account options menu is now much faster, and it correctly closes
when 'Switch account' is selected.

A static width had to be set on the menu so that it could be positioned
reliably. Without this width set, it was rendered as a different size
before positioning than after, which resulted in it being positioned
incorrectly. A `z-index` had to be added (equal to the `z-index` used
by the popover component) to ensure it wasn't rendered beneath the
popover.

The menu is automatically positioned relative to the account options
button, appearing below the button by default but above it instead if
there isn't room below. It is positioned to be inside the bounds of the
popover as well.

The account options button is now a `<button>` rather than a `<i>`.
This required a few additional style rules to overrule the default
button styles. Additionally the size was increased so that it matches
the designs more closely.

The callbacks for connecting, disconnecting, and switching accounts
have been updated to use state and props to determine the correct
address to use, rather than being bound to the correct address
parameter in the render function. This means we aren't creating a new
function upon each render anymore.

The `showAccountOptions` method still needs to be bound once per
account, but this was switched to use more readable syntax (`.bind`,
instead of the double arrow function).

`react-popper` and `@popperjs/core` were both added as dependencies.
These should be used for any UI requiring relative positioning (e.g.
tooltips, menus, etc.). Older versions of these libraries are already
in our codebase as transitive dependencies of the tooltip library we're
using.
2020-05-18 14:51:29 -03:00
Mark Stacey
0033a64e5d
Connected accounts secondary sort order (#8608)
The connected accounts are now ordered by keyring controller order
whenever the `lastSelected` time is equal. This ensures the order is
identical to what connected sites see. This is especially important
when no accounts have been selected, as it ensures the correct account
is marked as the "Primary" account.
2020-05-18 13:31:11 -03:00
Whymarrh Whitby
d488c16df5
Add Connected Accounts modal (#8313) 2020-05-15 15:53:52 -03:00
Whymarrh Whitby
320804bb71
Delete unused DisconnectAll modal (#8599) 2020-05-15 15:32:46 -02:30