Browse Source

Minor tweaks

develop
Ezerous 6 years ago
parent
commit
80d0903cf6
  1. 14
      app/package.json
  2. 1
      app/src/assets/fonts/fontawesome-free-5.7.2/all.js
  3. 2
      app/src/containers/CoreLayoutContainer.js
  4. 3
      app/src/containers/SignUpContainer.js
  5. 14
      app/src/containers/UsernameFormContainer.js

14
app/package.json

@ -7,18 +7,18 @@
"url": "https://gitlab.com/Ezerous/Apella.git" "url": "https://gitlab.com/Ezerous/Apella.git"
}, },
"dependencies": { "dependencies": {
"@drizzle-utils/get-accounts": "0.1.4-alpha.0", "@drizzle-utils/get-contract-instance": "^0.1.6-alpha.0",
"@drizzle-utils/get-contract-instance": "^0.1.4-alpha.0", "@drizzle-utils/get-web3": "^0.1.6-alpha.0",
"@drizzle-utils/get-web3": "^0.1.4-alpha.0",
"connected-react-router": "^6.3.1", "connected-react-router": "^6.3.1",
"drizzle": "^1.3.3", "drizzle": "^1.3.3",
"history": "^4.7.2", "history": "^4.7.2",
"ipfs": "^0.33.0", "ipfs": "~0.33.0",
"orbit-db": "^0.19.9", "orbit-db": "^0.19.9",
"orbit-db-keystore": "^0.1.0",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.8.1", "react": "^16.8.3",
"react-dom": "^16.8.1", "react-dom": "^16.8.3",
"react-redux": "^6.0.0", "react-redux": "^6.0.1",
"react-router-dom": "^4.3.1", "react-router-dom": "^4.3.1",
"react-scripts": "^2.1.5", "react-scripts": "^2.1.5",
"redux": "^4.0.1", "redux": "^4.0.1",

1
app/src/assets/fonts/fontawesome-free-5.7.2/all.js

@ -1,3 +1,4 @@
/* eslint-disable */
(function () { (function () {
'use strict'; 'use strict';

2
app/src/containers/CoreLayoutContainer.js

@ -4,7 +4,7 @@ import NavBarContainer from './NavBarContainer';
/*import TransactionsMonitorContainer from '../../containers/TransactionsMonitorContainer';*/ /*import TransactionsMonitorContainer from '../../containers/TransactionsMonitorContainer';*/
// Styles // Styles
import '../assets/fonts/fontawesome-free-5.7.2/all.js'; import '../assets/fonts/fontawesome-free-5.7.2/all.js'; //TODO: check https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers
import '../assets/css/App.css'; import '../assets/css/App.css';
import '../assets/css/sign-up-container.css'; import '../assets/css/sign-up-container.css';

3
app/src/containers/SignUpContainer.js

@ -6,10 +6,9 @@ import UsernameFormContainer from './UsernameFormContainer';
class SignUp extends Component { class SignUp extends Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (this.props.user.hasSignedUp && !prevProps.user.hasSignedUp){ if (this.props.user.hasSignedUp && !prevProps.user.hasSignedUp)
this.props.history.push("/"); this.props.history.push("/");
} }
}
render() { render() {
return ( return (

14
app/src/containers/UsernameFormContainer.js

@ -12,7 +12,7 @@ const checkUsernameTakenMethod = "isUserNameTaken";
const signUpMethod = "signUp"; const signUpMethod = "signUp";
class UsernameFormContainer extends Component { class UsernameFormContainer extends Component {
constructor(props, context) { constructor(props) {
super(props); super(props);
this.handleInputChange = this.handleInputChange.bind(this); this.handleInputChange = this.handleInputChange.bind(this);
@ -33,7 +33,7 @@ class UsernameFormContainer extends Component {
this.setState({ this.setState({
[name]: value, [name]: value,
error: false error: false
}) });
if (value !== '') { if (value !== '') {
if (this.checkedUsernames.length > 0) { if (this.checkedUsernames.length > 0) {
if (this.checkedUsernames.some(e => e.usernameChecked === value)){ if (this.checkedUsernames.some(e => e.usernameChecked === value)){
@ -78,16 +78,16 @@ class UsernameFormContainer extends Component {
componentDidUpdate() { componentDidUpdate() {
if (this.state.signingUp) { if (this.state.signingUp) {
var txHash = this.props.transactionStack[this.stackId]; const txHash = this.props.transactionStack[this.stackId];
if (txHash && this.props.transactions[txHash].status === "error") { if (txHash && this.props.transactions[txHash].status === "error") {
this.setState({signingUp: false}); this.setState({signingUp: false});
} }
} else { } else {
var temp = Object.values(this.props.contracts[contract][checkUsernameTakenMethod]); const temp = Object.values(this.props.contracts[contract][checkUsernameTakenMethod]);
this.checkedUsernames = temp.map(checked => {return { this.checkedUsernames = temp.map(checked => {return {
usernameChecked: checked.args[0], usernameChecked: checked.args[0],
isTaken: checked.value isTaken: checked.value
}}) }});
if (this.checkedUsernames.length > 0){ if (this.checkedUsernames.length > 0){
this.checkedUsernames.forEach( checked => { this.checkedUsernames.forEach( checked => {
@ -111,7 +111,7 @@ class UsernameFormContainer extends Component {
if(hasSignedUp !== null) { if(hasSignedUp !== null) {
const buttonText = hasSignedUp ? "Update" : "Sign Up"; const buttonText = hasSignedUp ? "Update" : "Sign Up";
const placeholderText = hasSignedUp ? this.props.user.username : "Username"; const placeholderText = hasSignedUp ? this.props.user.username : "Username";
var withError = this.state.error && {error: true}; const withError = this.state.error && {error: true};
return( return(
<div> <div>
@ -134,7 +134,7 @@ class UsernameFormContainer extends Component {
</Form> </Form>
<Dimmer active={this.state.signingUp} page> <Dimmer active={this.state.signingUp} page>
<Header as='h2' inverted> <Header as='h2' inverted>
<Loader size='large'>Magic elfs are processing your nobel request.</Loader> <Loader size='large'>Magic elves are processing your noble request.</Loader>
</Header> </Header>
</Dimmer> </Dimmer>
</div> </div>

Loading…
Cancel
Save