-
Notifications
You must be signed in to change notification settings - Fork 60
Implement routing for modals - Closes #554 #750
Conversation
4111f12
to
79bed75
Compare
79bed75
to
0924d89
Compare
59145e7
to
66bd091
Compare
@@ -32,6 +32,7 @@ | |||
"bitcore-mnemonic": "=1.1.1", | |||
"copy-to-clipboard": "=3.0.6", | |||
"flexboxgrid": "=6.3.1", | |||
"history": "^4.7.2", |
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 should use =
instead of ^
.
We should set up this in .npmrc
file like lisk-js
guys did LiskArchive/lisk-elements#382
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.
TBH, I never liked this approach, choosing =
we easily end up with outdated dependencies. if there's a breaking change in one of the dependencies, I prefer to get notified of somehow. that's exactly the reason I clean install my node modules every once in a while.
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.
Sure it's a good idea, but please don't tell me to add it in this PR :-D
features/accountManagement.feature
Outdated
And I select option no. 3 from "network" select | ||
When I fill in "http://localhost:4000" to "address" field | ||
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field | ||
And I click "login button" |
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 think these changes are not necessary.
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.
fixed
src/components/header/index.test.js
Outdated
<I18nextProvider i18n={ i18n }> | ||
<HeaderHOC /> | ||
</I18nextProvider> | ||
</I18nextProvider></Router> |
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'd prefer <Router>
on its own line
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.
fixed
src/components/login/login.js
Outdated
}); | ||
} | ||
// eslint-disable-next-line class-methods-use-this | ||
getPassphraseValidationError(passphrase) { |
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.
functionality inside getPassphraseValidationError
was moved to PassphraseInput
component. Here it's reintroduced from a merging.
src/components/tabs/tabs.js
Outdated
{getTabs(isDelegate).map((tab, index) => | ||
<Tab | ||
key={index} | ||
label={t(tab)} |
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.
Calling t(tab)
doesn't allow i18n-scanner to find tab names for the source*.json 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.
Done
break; | ||
default: | ||
type = false; | ||
break; | ||
} | ||
const address = props.address !== props.senderId ? props.senderId : props.recipientId; | ||
const template = type ? | ||
<span className={sytles.smallButton}>{type}</span> : | ||
<ClickToSend recipient={address} className='from-to' > | ||
<span className={styles.smallButton}>{t(type)}</span> : |
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.
Calling t(type)
doesn't allow i18n-scanner to find type names for the source *.json 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.
Done
@@ -2,16 +2,17 @@ export const getSavedAccount = () => { | |||
const savedAccounts = localStorage.getItem('accounts'); | |||
let account; | |||
if (savedAccounts) { | |||
account = JSON.parse(savedAccounts)[0]; | |||
account = JSON.parse(savedAccounts); |
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 don't see why [0]
was removed.
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.
Since we aim to have multiple accounts there, I've implement the reducer to handle multiple. So I always should receive an array, even so currently the utility returns only one item.
There are also other problems with this utility which I found it irrelevant to this PR so I didn't touch.
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.
then account
should be accounts
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's a ticket to fix many other issues about this utility.
if (primary !== undefined) style += `${buttonStyle.primary} `; | ||
if (disableWhenOffline !== undefined) style += `${offlineStyle.disableWhenOffline} `; | ||
if (style !== '') style += ` ${buttonStyle.button}`; | ||
|
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 think that https://github.com/JedWatson/classnames is better solution for dynamic classnames
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.
Seems a neat way to go, since we use string literal everywhere in the project, it's worth creating a ticket if we plan to use this.
const index = networksRaw.map((item, i) => { | ||
return (item.name === network) ? i : null; | ||
}).filter(item => item !== null)[0]; | ||
accountSaved({ |
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.
.find(item => item ! == null);
will return first element that not equal null
switch (action.type) { | ||
case actionTypes.accountSaved: | ||
store.dispatch(successToastDisplayed({ label: 'Account saved' })); | ||
break; |
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.
why not use return
instead of break
in the switch case? It will look more compact.
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's a ticket to fix many other issues about this utility.
Closes #554
Closes #553