Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aea49e2
add eslint jsdoc
PUndef Nov 20, 2019
0f118c4
Add TransferToken form & dialog
PUndef Nov 20, 2019
ff70969
Update TokenTransfer.test.js
PUndef Nov 20, 2019
e7513a0
Fix placeholder for TransferTokenForm
PUndef Nov 20, 2019
192e6dd
disable failOnWarning
PUndef Nov 20, 2019
d46ea28
add TokenTransferError
PUndef Nov 20, 2019
0100060
Add DefinetelyAgree
PUndef Nov 20, 2019
2e5319a
small upd
PUndef Nov 20, 2019
1141800
Add DefinetelyReject
PUndef Nov 20, 2019
fa2278a
Create DefinetelyReject.test.js
PUndef Nov 20, 2019
925b4ce
Update TransferTokenForm.js
PUndef Dec 2, 2019
f545d59
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef Dec 2, 2019
12298c2
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef Dec 2, 2019
5db2c59
fix some error & upd stories
PUndef Dec 2, 2019
a91cfbd
add stories
PUndef Dec 2, 2019
6257bd5
Update TokenTransfer.js
PUndef Dec 2, 2019
52fc4e6
Merge branch 'component-dialog' of https://github.com/Neos1/zeroone i…
PUndef Dec 4, 2019
ee28bb6
Remove old DefinetelyReject & add new
PUndef Dec 4, 2019
7c51934
remove definetely forms & add simple decision component
PUndef Dec 4, 2019
f37d85f
token transfer refactor
PUndef Dec 4, 2019
b3e955f
dialog TokenTransferError refactor
PUndef Dec 4, 2019
5a71d2f
Update index.js
PUndef Dec 4, 2019
a9f54f4
remove comment rules
PUndef Dec 4, 2019
83c4a9a
small upd
PUndef Dec 4, 2019
3b852ed
Merge branch 'refactoring' of https://github.com/Neos1/zeroone into s…
PUndef Dec 5, 2019
990f7ee
fix jsdoc
PUndef Dec 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@
"jest/globals": true
},
"parser": "babel-eslint",
"extends": ["airbnb"],
"extends": [
"airbnb",
"plugin:jsdoc/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},

"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["react", "jest"],
"plugins": [
"react",
"jsdoc",
"jest"
],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"no-underscore-dangle":"off",
Expand Down
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"eslint-config-airbnb": "^18.0.1",
"eslint-loader": "^3.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsdoc": "^18.1.3",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^1.7.0",
Expand Down
10 changes: 10 additions & 0 deletions src/assets/styles/includes/_mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@mixin title {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it class

margin-top: 18px;
margin-bottom: 8px;
color: #000;
font-weight: 700;
font-size: 24px;
font-family: "Grotesk";
line-height: 28px;
text-align: center;
}
3 changes: 2 additions & 1 deletion src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Button.propTypes = {
iconPosition: propTypes.bool,
type: propTypes.string,
disabled: propTypes.bool,
onClick: propTypes.func.isRequired,
onClick: propTypes.func,
theme: propTypes.string,
size: propTypes.string,
};
Expand All @@ -54,6 +54,7 @@ Button.defaultProps = {
icon: null,
iconPosition: false,
disabled: false,
onClick: () => {},
};

export default Button;
49 changes: 49 additions & 0 deletions src/components/Decision/Decision.js
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;
25 changes: 25 additions & 0 deletions src/components/Decision/Decision.scss
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;
}
}
}
31 changes: 31 additions & 0 deletions src/components/Decision/Decision.test.js
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);
});
});
25 changes: 25 additions & 0 deletions src/components/Decision/DecisionAgree.js
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;
25 changes: 25 additions & 0 deletions src/components/Decision/DecisionReject.js
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;
11 changes: 11 additions & 0 deletions src/components/Decision/index.js
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,
};
2 changes: 1 addition & 1 deletion src/components/Dialog/Dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
&__inner {
position: relative;
z-index: 1;
min-height: 325px;
min-height: 309px;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/Dialog/index.js
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,
};
49 changes: 49 additions & 0 deletions src/components/FinPassFormWrapper/FinPassFormWrapper.js
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;
Loading