Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdding BAT token by default to accounts, component patching work #3
Conversation
93ab9b1
to
9d36048
|
@bbondy updated to use |
ui/app/components/app/dropdowns/components/brave/token-menu-dropdown.js
Outdated
Show resolved
Hide resolved
| ]) | ||
| } | ||
|
|
||
| module.exports = connect(mapStateToProps, mapDispatchToProps)(BraveTokenMenuDropdown) |
This comment has been minimized.
This comment has been minimized.
ryanml
Jun 13, 2019
Author
Member
Unfortunately the way TokenMenuDropdown was set up didn't really make it prime for simple extension, so this is more or less the same file. No copy involved still
This comment has been minimized.
This comment has been minimized.
bbondy
Jun 14, 2019
Member
I guess it's ok for us to fork certain components like this but we should try to avoid when possible.
1ad2e15
to
0b4b872
|
@bbondy this is ready for another look - this approach should be as we discussed, resulting in 0 patches or any Also, the task do all of the import replacing takes ~1.25 seconds or so, so |
|
|
||
| module.exports = compose( | ||
| withRouter, | ||
| connect(mapStateToProps, mapDispatchToProps) |
This comment has been minimized.
This comment has been minimized.
ryanml
Jun 14, 2019
•
Author
Member
These two (mapStateToProps and mapDispatchToProps) were not exported in the MM component so they are included here.
| } | ||
| } | ||
|
|
||
| BraveHome.propTypes['batTokenAdded'] = PropTypes.bool |
ryanml commentedJun 11, 2019
•
edited
Fixes: brave/brave-browser#4773
Fixes: brave/brave-browser#4924
This PR contains the initial patching strategy for overriding MM components without any actual patches :)
This adds BAT to the user list of tokens by default after creating their account
Ideally this would have been done just by placing the BAT token object in the default store, but this proved to be a little too complicated for a few reasons. A one time add via an existing action proved to be much more simple and reliable:
Main View:

Non Removable:

With other assets:
