-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading the Import Account modal (#17763)
Co-authored-by: georgewrmarshall <george.marshall@consensys.net> Co-authored-by: NidhiKJha <nidhi.kumari@consensys.net> Co-authored-by: montelaidev <monte.lai@consensys.net>
- Loading branch information
1 parent
01abfb3
commit 694773f
Showing
27 changed files
with
652 additions
and
747 deletions.
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, | ||
}; | ||
|
||
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.