diff --git a/src/components/DropdownOption/index.js b/src/components/DropdownOption/index.js
index 69a6cf81..66d759b2 100644
--- a/src/components/DropdownOption/index.js
+++ b/src/components/DropdownOption/index.js
@@ -27,10 +27,11 @@ DropdownOption.propTypes = {
value: propTypes.string.isRequired,
label: propTypes.string.isRequired,
select: propTypes.func.isRequired,
- subOption: propTypes.string.isRequired,
+ subOption: propTypes.string,
};
DropdownOption.defaultProps = {
+ subOption: '',
};
export default DropdownOption;
diff --git a/src/components/Footer/Footer.scss b/src/components/Footer/Footer.scss
new file mode 100644
index 00000000..19351ba7
--- /dev/null
+++ b/src/components/Footer/Footer.scss
@@ -0,0 +1,34 @@
+@import '../../assets/styles/partials/variables';
+
+.footer {
+ padding: 15px 0;
+ a {
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+ justify-content: center;
+ color: $border;
+ font-size: 11px;
+ text-align: center;
+ svg {
+ path {
+ transition: .2s;
+ }
+ }
+ span {
+ margin-left: 10px;
+ transition: .2s;
+ }
+ &:hover{
+ svg {
+ path {
+ opacity: 1;
+ fill: $primary;
+ }
+ }
+ span {
+ color: $primary;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js
new file mode 100644
index 00000000..82109b80
--- /dev/null
+++ b/src/components/Footer/index.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import { GithubIcon } from '../Icons';
+
+import styles from './Footer.scss';
+
+const Footer = () => (
+
+);
+
+export default Footer;
diff --git a/src/components/Header/Header.scss b/src/components/Header/Header.scss
index 392cf70d..1c482fe4 100644
--- a/src/components/Header/Header.scss
+++ b/src/components/Header/Header.scss
@@ -1,7 +1,7 @@
@import '../../assets/styles/partials/variables';
.header {
- position: absolute;
+ position: relative;
top: 30px;
left: 50%;
z-index: 2;
diff --git a/src/components/Icons/entities/GithubIcon.js b/src/components/Icons/entities/GithubIcon.js
new file mode 100644
index 00000000..f6f0d017
--- /dev/null
+++ b/src/components/Icons/entities/GithubIcon.js
@@ -0,0 +1,8 @@
+import React from 'react';
+
+const GithubIcon = () => (
+
+);
+export default GithubIcon;
diff --git a/src/components/Icons/entities/StartIcon.js b/src/components/Icons/entities/StartIcon.js
new file mode 100644
index 00000000..699eba1b
--- /dev/null
+++ b/src/components/Icons/entities/StartIcon.js
@@ -0,0 +1,12 @@
+import React from 'react';
+
+const StartIcon = () => (
+
+);
+
+export default StartIcon;
diff --git a/src/components/Icons/index.js b/src/components/Icons/index.js
index a8335074..819aa576 100644
--- a/src/components/Icons/index.js
+++ b/src/components/Icons/index.js
@@ -22,6 +22,8 @@ import TokenName from './entities/TokenNameIcon';
import TxHashIcon from './entities/TxHashIcon';
import TxRecieptIcon from './entities/TxRecieptIcon';
import VerifyIcon from './entities/VerifyIcon';
+import StartIcon from './entities/StartIcon';
+import GithubIcon from './entities/GithubIcon';
export {
AddIcon,
@@ -48,4 +50,6 @@ export {
TxHashIcon,
TxRecieptIcon,
VerifyIcon,
+ StartIcon,
+ GithubIcon,
};
diff --git a/src/components/ProjectList/index.js b/src/components/ProjectList/index.js
index 08f606f2..beeea7b4 100644
--- a/src/components/ProjectList/index.js
+++ b/src/components/ProjectList/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import propTypes from 'prop-types';
-import { NavLink } from 'react-router-dom';
+import { NavLink, Redirect } from 'react-router-dom';
import { inject, observer } from 'mobx-react';
import { withTranslation } from 'react-i18next';
import Button from '../Button/Button';
@@ -17,7 +17,10 @@ import styles from '../Login/Login.scss';
class ProjectList extends Component {
constructor(props) {
super(props);
- this.state = {};
+ this.state = {
+ redirectToProject: false,
+ redirectToUploading: false,
+ };
}
componentDidMount() {
@@ -25,16 +28,42 @@ class ProjectList extends Component {
appStore.readProjectList();
}
+ gotoProject = (address) => {
+ const { appStore } = this.props;
+ appStore.gotoProject(address);
+ this.setState({ redirectToProject: true });
+ }
+
+ startUploading = (address) => {
+ const { appStore } = this.props;
+ appStore.setProjectAddress(address);
+ this.setState({ redirectToUploading: true });
+ }
+
+ checkProject = async (address) => {
+ const { appStore } = this.props;
+ const isQuestionsUploaded = await appStore.checkIsQuestionsUploaded(address);
+ // eslint-disable-next-line no-unused-expressions
+ isQuestionsUploaded
+ ? this.gotoProject(address)
+ : this.startUploading(address);
+ }
+
render() {
const { appStore: { projectList }, t } = this.props;
+ const { redirectToProject, redirectToUploading } = this.state;
const projects = projectList.map((project, index) => (
));
+
+ if (redirectToProject) return
;
+ if (redirectToUploading) return
;
return (
@@ -62,6 +91,9 @@ ProjectList.propTypes = {
appStore: propTypes.shape({
readProjectList: propTypes.func.isRequired,
projectList: propTypes.arrayOf(propTypes.object).isRequired,
+ checkIsQuestionsUploaded: propTypes.func.isRequired,
+ gotoProject: propTypes.func.isRequired,
+ setProjectAddress: propTypes.func.isRequired,
}).isRequired,
t: propTypes.func.isRequired,
};
diff --git a/src/components/ProjectUploading/index.js b/src/components/ProjectUploading/index.js
index c323c6e6..418163d0 100644
--- a/src/components/ProjectUploading/index.js
+++ b/src/components/ProjectUploading/index.js
@@ -37,11 +37,34 @@ class ProjectUploading extends Component {
componentDidMount() {
const { steps } = this;
const {
- appStore, appStore: { deployArgs, name }, userStore: { password }, t,
+ appStore, appStore: { deployArgs, projectAddress }, userStore: { password }, type,
} = this.props;
- this.setState({
- step: steps.sending,
- });
+
+ switch (type) {
+ case ('project'):
+ this.setState({
+ step: steps.sending,
+ });
+ this.deployProject(deployArgs, password);
+ break;
+ case ('question'):
+ this.setState({
+ step: steps.questions,
+ });
+ appStore.deployQuestions(projectAddress).then(() => {
+ this.setState({
+ uploading: false,
+ });
+ });
+ break;
+ default:
+ break;
+ }
+ }
+
+ deployProject(deployArgs, password) {
+ const { steps } = this;
+ const { appStore, appStore: { name }, t } = this.props;
appStore.deployContract('project', deployArgs, password)
.then((txHash) => {
@@ -55,6 +78,7 @@ class ProjectUploading extends Component {
this.setState({
step: steps.questions,
});
+ appStore.setProjectAddress(receipt.contractAddress);
appStore.addProjectToList({ name, address: receipt.contractAddress });
appStore.deployQuestions(receipt.contractAddress).then(() => {
this.setState({
@@ -126,9 +150,11 @@ const AlertBlock = withTranslation()(({ t }) => (
{t('headings:projectCreated.subheading.1')}
-
} type="submit">
- {t('buttons:toCreatedProject')}
-
+
+ } type="submit">
+ {t('buttons:toCreatedProject')}
+
+