-
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
Upgrading the Import Account modal #17763
Changes from 9 commits
ee09d5b
893815d
2cb0fc7
7a151b0
754d119
af227eb
1626dfa
678b740
abbfb03
4ff6bfc
2eff25c
7d70de3
3479ec7
104d553
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { Text } from './text'; | ||
export { TEXT_DIRECTIONS } from './text.constants'; | ||
export { TEXT_DIRECTIONS, INVISIBLE_CHARACTER } from './text.constants'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
import React, { Component } from 'react'; | ||
import { Switch, Route } from 'react-router-dom'; | ||
import React from 'react'; | ||
import { Route, Switch } from 'react-router-dom'; | ||
import Box from '../../components/ui/box'; | ||
|
||
import { | ||
NEW_ACCOUNT_ROUTE, | ||
IMPORT_ACCOUNT_ROUTE, | ||
CONNECT_HARDWARE_ROUTE, | ||
IMPORT_ACCOUNT_ROUTE, | ||
NEW_ACCOUNT_ROUTE, | ||
} from '../../helpers/constants/routes'; | ||
import NewAccountCreateForm from './new-account.container'; | ||
import NewAccountImportForm from './import-account'; | ||
import ConnectHardwareForm from './connect-hardware'; | ||
import NewAccountImportForm from './import-account'; | ||
import NewAccountCreateForm from './new-account.container'; | ||
|
||
export default class CreateAccountPage extends Component { | ||
render() { | ||
return ( | ||
<div className="new-account"> | ||
<div className="new-account__form"> | ||
<Switch> | ||
<Route | ||
exact | ||
path={NEW_ACCOUNT_ROUTE} | ||
component={NewAccountCreateForm} | ||
/> | ||
<Route | ||
exact | ||
path={IMPORT_ACCOUNT_ROUTE} | ||
component={NewAccountImportForm} | ||
/> | ||
<Route | ||
exact | ||
path={CONNECT_HARDWARE_ROUTE} | ||
component={ConnectHardwareForm} | ||
/> | ||
</Switch> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export default function CreateAccountPage() { | ||
return ( | ||
<Box className="new-account"> | ||
<Switch> | ||
<Route | ||
exact | ||
path={NEW_ACCOUNT_ROUTE} | ||
component={NewAccountCreateForm} | ||
/> | ||
<Route | ||
exact | ||
path={IMPORT_ACCOUNT_ROUTE} | ||
component={NewAccountImportForm} | ||
/> | ||
<Route | ||
exact | ||
path={CONNECT_HARDWARE_ROUTE} | ||
component={ConnectHardwareForm} | ||
/> | ||
</Switch> | ||
</Box> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,48 @@ | ||||||
import PropTypes from 'prop-types'; | ||||||
import React from 'react'; | ||||||
import { useDispatch } from 'react-redux'; | ||||||
import { | ||||||
ButtonPrimary, | ||||||
ButtonSecondary, | ||||||
BUTTON_SECONDARY_SIZES, | ||||||
} from '../../../components/component-library'; | ||||||
import Box from '../../../components/ui/box/box'; | ||||||
import { DISPLAY } from '../../../helpers/constants/design-system'; | ||||||
import { useI18nContext } from '../../../hooks/useI18nContext'; | ||||||
import * as actions from '../../../store/actions'; | ||||||
|
||||||
BottomButtons.propTypes = { | ||||||
importAccountFunc: PropTypes.func.isRequired, | ||||||
isPrimaryDisabled: PropTypes.bool.isRequired, | ||||||
HowardBraham marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
}; | ||||||
|
||||||
export default function BottomButtons({ | ||||||
importAccountFunc, | ||||||
isPrimaryDisabled, | ||||||
}) { | ||||||
const t = useI18nContext(); | ||||||
const dispatch = useDispatch(); | ||||||
|
||||||
return ( | ||||||
<Box display={DISPLAY.FLEX}> | ||||||
HowardBraham marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed this in a previous commit, I'm not sure how it came back 🤔 |
||||||
<ButtonSecondary | ||||||
onClick={() => { | ||||||
dispatch(actions.hideWarning()); | ||||||
window.history.back(); | ||||||
}} | ||||||
size={BUTTON_SECONDARY_SIZES.LG} | ||||||
block | ||||||
> | ||||||
{t('cancel')} | ||||||
</ButtonSecondary> | ||||||
<ButtonPrimary | ||||||
onClick={importAccountFunc} | ||||||
disabled={isPrimaryDisabled} | ||||||
size={BUTTON_SECONDARY_SIZES.LG} | ||||||
block | ||||||
> | ||||||
{t('import')} | ||||||
</ButtonPrimary> | ||||||
</Box> | ||||||
); | ||||||
} |
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.
Oh thank you! Have a PR here for this #17939