-
Notifications
You must be signed in to change notification settings - Fork 0
Some dialogs #51
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
Open
PUndef
wants to merge
26
commits into
refactoring
Choose a base branch
from
some-dialogs
base: refactoring
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Some dialogs #51
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
aea49e2
add eslint jsdoc
PUndef 0f118c4
Add TransferToken form & dialog
PUndef ff70969
Update TokenTransfer.test.js
PUndef e7513a0
Fix placeholder for TransferTokenForm
PUndef 192e6dd
disable failOnWarning
PUndef d46ea28
add TokenTransferError
PUndef 0100060
Add DefinetelyAgree
PUndef 2e5319a
small upd
PUndef 1141800
Add DefinetelyReject
PUndef fa2278a
Create DefinetelyReject.test.js
PUndef 925b4ce
Update TransferTokenForm.js
PUndef f545d59
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef 12298c2
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef 5db2c59
fix some error & upd stories
PUndef a91cfbd
add stories
PUndef 6257bd5
Update TokenTransfer.js
PUndef 52fc4e6
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef ee28bb6
Remove old DefinetelyReject & add new
PUndef 7c51934
remove definetely forms & add simple decision component
PUndef f37d85f
token transfer refactor
PUndef b3e955f
dialog TokenTransferError refactor
PUndef 5a71d2f
Update index.js
PUndef a9f54f4
remove comment rules
PUndef 83c4a9a
small upd
PUndef 3b852ed
Merge branch 'refactoring' of https://github.com/Neos1/zeroone into s…
PUndef 990f7ee
fix jsdoc
PUndef 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
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,10 @@ | ||
| @mixin title { | ||
| margin-top: 18px; | ||
| margin-bottom: 8px; | ||
| color: #000; | ||
| font-weight: 700; | ||
| font-size: 24px; | ||
| font-family: "Grotesk"; | ||
| line-height: 28px; | ||
| text-align: center; | ||
| } | ||
This file contains hidden or 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 hidden or 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,49 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { withTranslation } from 'react-i18next'; | ||
| import FinPassForm from '../../stores/FormsStore/FinPassForm'; | ||
| import FinPassFormWrapper from '../FinPassFormWrapper/FinPassFormWrapper'; | ||
|
|
||
| import styles from './Decision.scss'; | ||
|
|
||
| @withTranslation() | ||
| class Decision extends React.Component { | ||
| form = new FinPassForm({ | ||
| hooks: { | ||
| onSuccess() { | ||
| return Promise.resolve(); | ||
| }, | ||
| onError() { | ||
| /* eslint-disable-next-line */ | ||
| console.error('error'); | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| static propTypes = { | ||
| t: PropTypes.func.isRequired, | ||
| icon: PropTypes.node.isRequired, | ||
| title: PropTypes.string.isRequired, | ||
| }; | ||
|
|
||
| render() { | ||
| const { props, form } = this; | ||
| const { t, icon, title } = props; | ||
| return ( | ||
| <div className={styles.decision}> | ||
| <div className={styles.decision__icon}> | ||
| {icon} | ||
| </div> | ||
| <h2 className={styles.decision__title}> | ||
| {title} | ||
| </h2> | ||
| <p className={styles.decision__subtext}> | ||
| {t('other:enterPassForConfirm')} | ||
| </p> | ||
| <FinPassFormWrapper form={form} /> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default Decision; |
This file contains hidden or 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,25 @@ | ||
| @import '../../assets/styles/includes/mixin'; | ||
|
|
||
| .decision { | ||
| width: 100%; | ||
| text-align: center; | ||
|
|
||
| &__title { | ||
| @include title; | ||
| } | ||
|
|
||
| &__subtext { | ||
| color: rgba(0, 0, 0, 0.7); | ||
| font-size: 14px; | ||
| line-height: 16px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| &__icon { | ||
| svg { | ||
| width: auto; | ||
| height: auto; | ||
| margin-top: 47px; | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,31 @@ | ||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import { DecisionReject, DecisionAgree } from '.'; | ||
|
|
||
| describe('DecisionReject', () => { | ||
| let wrapper; | ||
|
|
||
| beforeEach(() => { | ||
| wrapper = shallow( | ||
| <DecisionReject />, | ||
| ).dive(); | ||
| }); | ||
|
|
||
| it('should render without error', () => { | ||
| expect(wrapper.length).toEqual(1); | ||
| }); | ||
| }); | ||
|
|
||
| describe('DecisionAgree', () => { | ||
| let wrapper; | ||
|
|
||
| beforeEach(() => { | ||
| wrapper = shallow( | ||
| <DecisionAgree />, | ||
| ).dive(); | ||
| }); | ||
|
|
||
| it('should render without error', () => { | ||
| expect(wrapper.length).toEqual(1); | ||
| }); | ||
| }); |
This file contains hidden or 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,25 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { withTranslation } from 'react-i18next'; | ||
| import Decision from './Decision'; | ||
| import { VerifyIcon } from '../Icons'; | ||
|
|
||
| @withTranslation() | ||
| class DecisionAgree extends React.Component { | ||
| static propTypes = { | ||
| t: PropTypes.func.isRequired, | ||
| }; | ||
|
|
||
| render() { | ||
| const { props } = this; | ||
| const { t } = props; | ||
| return ( | ||
| <Decision | ||
| title={t('dialogs:definetelyAgree')} | ||
| icon={(<VerifyIcon />)} | ||
| /> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default DecisionAgree; |
This file contains hidden or 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,25 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { withTranslation } from 'react-i18next'; | ||
| import Decision from './Decision'; | ||
| import { RejectIcon } from '../Icons'; | ||
|
|
||
| @withTranslation() | ||
| class DecisionReject extends React.Component { | ||
| static propTypes = { | ||
| t: PropTypes.func.isRequired, | ||
| }; | ||
|
|
||
| render() { | ||
| const { props } = this; | ||
| const { t } = props; | ||
| return ( | ||
| <Decision | ||
| title={t('dialogs:definetelyReject')} | ||
| icon={(<RejectIcon />)} | ||
| /> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default DecisionReject; |
This file contains hidden or 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,11 @@ | ||
| import Decision from './Decision'; | ||
| import DecisionReject from './DecisionReject'; | ||
| import DecisionAgree from './DecisionAgree'; | ||
|
|
||
| export default Decision; | ||
|
|
||
| export { | ||
| Decision, | ||
| DecisionReject, | ||
| DecisionAgree, | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
| &__inner { | ||
| position: relative; | ||
| z-index: 1; | ||
| min-height: 325px; | ||
| min-height: 309px; | ||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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,3 +1,8 @@ | ||
| import Dialog from './Dialog'; | ||
| import DefaultDialogFooter from './DefaultDialogFooter'; | ||
|
|
||
| export default { Dialog }; | ||
|
|
||
| export { | ||
| DefaultDialogFooter, | ||
| }; |
This file contains hidden or 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,49 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { withTranslation } from 'react-i18next'; | ||
| import Input from '../Input'; | ||
| import { Password } from '../Icons'; | ||
| import Button from '../Button/Button'; | ||
|
|
||
| import styles from './FinPassFormWrapper.scss'; | ||
|
|
||
| @withTranslation() | ||
| class FinPassFormWrapper extends React.Component { | ||
| static propTypes = { | ||
| t: PropTypes.func.isRequired, | ||
| form: PropTypes.shape({ | ||
| onSubmit: PropTypes.func.isRequired, | ||
| $: PropTypes.func.isRequired, | ||
| }).isRequired, | ||
| }; | ||
|
|
||
| render() { | ||
| const { props } = this; | ||
| const { t, form } = props; | ||
| return ( | ||
| <div | ||
| className={styles['form-fin-pass']} | ||
| > | ||
| <form | ||
| onSubmit={form.onSubmit} | ||
| > | ||
| <div className={styles.input__wrapper}> | ||
| <Input field={form.$('fin-password')}> | ||
| <Password /> | ||
| </Input> | ||
| </div> | ||
| <div className={styles.button__wrapper}> | ||
| <Button | ||
| className="btn--default btn--black" | ||
| type="submit" | ||
| > | ||
| {t('buttons:vote')} | ||
| </Button> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default FinPassFormWrapper; |
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.
make it class