-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ee09d5b
draft - fixing Import Account error messages (#16895)
HowardBraham 893815d
fixed lint and test errors
HowardBraham 2cb0fc7
fixing e2e tests
HowardBraham 7a151b0
responding to Monte's review
HowardBraham 754d119
Fixes #17719
HowardBraham af227eb
George updates
georgewrmarshall 1626dfa
Updates
georgewrmarshall 678b740
Some suggestions
georgewrmarshall abbfb03
Merged suggestions from @georgewrmarshall and @NidhiKJha, then contin…
HowardBraham 4ff6bfc
Response to latest @georgewrmarshall review
HowardBraham 2eff25c
Merge branch 'develop' into fix/import-account-error-messages
HowardBraham 7d70de3
fixed a test and bumped coverage targets
HowardBraham 3479ec7
Merge branch 'develop' into fix/import-account-error-messages
HowardBraham 104d553
eliminated the INVISIBLE_CHARACTER that was holding vertical space
HowardBraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} gap={4}> | ||
<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> | ||
); | ||
} |
18 changes: 18 additions & 0 deletions
18
ui/pages/create-account/import-account/bottom-buttons.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import BottomButtons from './bottom-buttons'; | ||
|
||
export default { | ||
title: 'Pages/CreateAccount/ImportAccount/BottomButtons', | ||
component: BottomButtons, | ||
argTypes: { | ||
isPrimaryDisabled: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const DefaultStory = (args) => <BottomButtons {...args} />; | ||
|
||
DefaultStory.storyName = 'Default'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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