Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Adds Loading Component (#3707)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac authored and jacogr committed Dec 2, 2016
1 parent c892a4f commit 456b506
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/src/ui/Loading/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

export default from './loading';
23 changes: 23 additions & 0 deletions js/src/ui/Loading/loading.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright 2015, 2016 Ethcore (UK) Ltd.
/* This file is part of Parity.
/*
/* Parity is free software: you can redistribute it and/or modify
/* it under the terms of the GNU General Public License as published by
/* the Free Software Foundation, either version 3 of the License, or
/* (at your option) any later version.
/*
/* Parity is distributed in the hope that it will be useful,
/* but WITHOUT ANY WARRANTY; without even the implied warranty of
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/* GNU General Public License for more details.
/*
/* You should have received a copy of the GNU General Public License
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/

.loading {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
36 changes: 36 additions & 0 deletions js/src/ui/Loading/loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React, { Component, PropTypes } from 'react';
import CircularProgress from 'material-ui/CircularProgress';

import styles from './loading.css';

export default class Loading extends Component {
static propTypes = {
size: PropTypes.number
};

render () {
const size = (this.props.size || 2) * 60;

return (
<div className={ styles.loading }>
<CircularProgress size={ size } />
</div>
);
}
}
2 changes: 2 additions & 0 deletions js/src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import Errors from './Errors';
import Form, { AddressSelect, FormWrap, TypedInput, Input, InputAddress, InputAddressSelect, InputChip, InputInline, Select, RadioButtons } from './Form';
import IdentityIcon from './IdentityIcon';
import IdentityName from './IdentityName';
import Loading from './Loading';
import MethodDecoding from './MethodDecoding';
import Modal, { Busy as BusyStep, Completed as CompletedStep } from './Modal';
import muiTheme from './Theme';
Expand Down Expand Up @@ -72,6 +73,7 @@ export {
InputAddressSelect,
InputChip,
InputInline,
Loading,
Select,
IdentityIcon,
IdentityName,
Expand Down

0 comments on commit 456b506

Please sign in to comment.