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
Landing #7
Conversation
What do you think of renaming
Maybe also rename the |
I like @tynes What happens when all participants join the wallet? Does it pop up to the Wallets List? Or is there still a separate Multisig section? |
lib/Containers/MainContainer.js
Outdated
|
||
export default class MainContainer extends PureComponent { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
const { match } = this.props; | ||
|
||
// TODO: figure out how to get subitems on sidebar to work |
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.
Hopefully the docs help with this: https://bpanel.org/docs/ui-utilities.html#createnestedviews
If there's anything that's not clear, overlooked, or could be clarified, let me know! (or submit as PR to bpanel-docs 😁). There's also a sample implementation in the @bpanel/bui plugin.
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.
It looks like you're basically there though!
@pinheadmz To my understanding, the Multisig Init table was for pending multisig wallets that have yet to be fully joined, so a redeem script hasn't been generated yet for them If that is what the table is supposed to be, then i'd imagine that when a wallet is fully joined, it would no longer exist in that list. The one problem that we have right now is that we do not have websockets set up for |
I like |
That's a great point about making it even more accessible, in which case |
|
Linting is failing, will return to this once we have our meeting on the design |
lib/constants/index.js
Outdated
const REDUCE_INTERFACE_NAMESPACE = '@bpanel/bwallet/interface'; | ||
const REDUCE_NODE_NAMESPACE = '@bpanel/bwallet/node'; | ||
const REDUCE_CHAIN_NAMESPACE = '@bpanel/bwallet/chain'; | ||
const REDUCE_WALLETS_NAMESPACE = '@bpanel/bwallet/wallets'; |
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.
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.
How do I join multiple reducers into 1 namespace?
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.
nested reducers and/or combineReducers:
reduxjs/redux#738
http://www.ematipico.com/javascript/redux/nested-reducers/
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.
It's a little obfuscated but this is how we actually manage the plugin reducers in bpanel to enable for the namespaced reducers nested in the plugins
reducer: https://github.com/bpanel-org/bpanel/blob/development/webapp/plugins/plugins.js#L263
Maybe this would be helpful to add to the reducers documentation... 🤔
lib/components/PendingMultisig.js
Outdated
import { connect } from 'react-redux'; | ||
import { Header, Table } from '@bpanel/bpanel-ui'; | ||
|
||
class PendingMultisig extends PureComponent { |
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'm not sure which way is best myself, I could see the argument for either, but do you think it makes to switch this component to be called PendingMultiparty
as well to match what the UI displays?
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.
We will probably have to change it again if we always change every name based on the UI. I think its close enough
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.
What do you mean? Ideally the UI doesn't change if at all once we've stabilized. Just thinking about the situation where someone wants to make a change to the PendingMultiparty
component and can't find it immediately. It's not hard to deduce of course, but it's the convention we use with virtually every other component right?
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.
Updating to PendingMultiparty
, I meant that until after we have our design meetings, the names could be unstable
@bucko13 - ready for a lookthrough |
lib/components/PendingMultiparty.js
Outdated
this.COL_HEADERS = ['Name', 'Date', 'M of N', 'Init']; | ||
} | ||
|
||
componentDidMount() { |
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.
delete
lib/components/RecentTxList.js
Outdated
this.COL_HEADERS = ['Date']; | ||
} | ||
|
||
componentDidMount() { |
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.
delete
lib/components/index.js
Outdated
@@ -0,0 +1,19 @@ | |||
import WalletsList from './WalletsList'; |
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.
Small styling nit, more of a personal style so feel free to ignore, but you could simplify this file with: export { default as WalletsList } from './WalletsList';
This only works for default exports though
lib/constants/index.js
Outdated
@@ -10,27 +10,47 @@ | |||
* in the redux store in case | |||
* of collisions with other plugins | |||
*/ |
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.
If we're going to keep all constants in a single file, does it need to be in a directory? Could it just be a single constants.js
file?
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.
There are multiple files in the constants
directory. Do you think it should be modularized more? There are some defined in index
, but also others defined in the other files
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 think so. I feel like indexes should either be fully an "entrypoint" or fully code logic. Feels easier to reason about.
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.
👍
lib/containers/SendReceive.js
Outdated
return ( | ||
<div> | ||
<Header type="h5">Select Wallet</Header> | ||
<Dropdown options={[]} placeholder={'Select Wallet'} /> |
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.
when a prop is just a string, I believe you can just pass it without the curly braces: placeholder="Select Wallet"
same as we do for classNames.
} from './selectors'; | ||
|
||
// TODO: append proper network symbol to balance based on chain | ||
function buildWalletsList(wallets, multisigWallets) { |
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.
So this is basically the ideal use case of reselect
and selectors since you're going through the stores and re-shaping the data based on a specific use case. I think what will likely happen in this implementation is that every time walletsList
is retrieved through the mapStateToProps
below is that this function will be called, which will go through the for loops. If you use reselect
(which is available as a peerDependency too for plugins), then the walletsList will be memoized and returned, only recalculated if the state gets updated.
lib/mappings/mainContainer.js
Outdated
function mapDispatchToProps(dispatch) { | ||
return { | ||
selectAccount: async (walletId, accountId) => | ||
dispatch(selectAccount(walletId, accountId)), |
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.
You shouldn't need the async here since there's not an await inside this function (there is in selectAccount itself, but that already has the async in the containing function declaration). when selectAccount
is called later on, the containing function will have an async
and then you would have something like const acct = await selectAccount
.
}; | ||
} | ||
|
||
// TODO: be certain we need selectAccount and selectWallet |
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 like we don't
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.
should this comment be cleaned up then?
|
||
render() { | ||
const { wallets, accounts, selectedWallet, selectedAccount } = this.props; | ||
const tabs = [ |
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.
Move tabs into own function
This should fix the infinite loop bug and is ready to be looked at again @bucko13 |
Overview
container component, without stylingMeant to be this view:
Where there is 1 container and 3 components that go with it, the TxList component will be the most reusable