mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Merge pull request #4156 from MetaMask/i4010-spinner
Fix styling of the app spinner
This commit is contained in:
commit
096851d091
@ -29,7 +29,7 @@ const AddTokenPage = require('./components/pages/add-token')
|
|||||||
const CreateAccountPage = require('./components/pages/create-account')
|
const CreateAccountPage = require('./components/pages/create-account')
|
||||||
const NoticeScreen = require('./components/pages/notice')
|
const NoticeScreen = require('./components/pages/notice')
|
||||||
|
|
||||||
const Loading = require('./components/loading')
|
const Loading = require('./components/loading-screen')
|
||||||
const NetworkIndicator = require('./components/network')
|
const NetworkIndicator = require('./components/network')
|
||||||
const Identicon = require('./components/identicon')
|
const Identicon = require('./components/identicon')
|
||||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||||||
@ -135,6 +135,7 @@ class App extends Component {
|
|||||||
|
|
||||||
(isLoading || isLoadingNetwork) && h(Loading, {
|
(isLoading || isLoadingNetwork) && h(Loading, {
|
||||||
loadingMessage: loadMessage,
|
loadingMessage: loadMessage,
|
||||||
|
fullScreen: true,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// content
|
// content
|
||||||
|
@ -6,7 +6,7 @@ const connect = require('react-redux').connect
|
|||||||
const actions = require('../actions')
|
const actions = require('../actions')
|
||||||
const CoinbaseForm = require('./coinbase-form')
|
const CoinbaseForm = require('./coinbase-form')
|
||||||
const ShapeshiftForm = require('./shapeshift-form')
|
const ShapeshiftForm = require('./shapeshift-form')
|
||||||
const Loading = require('./loading')
|
const Loading = require('./loading-screen')
|
||||||
const AccountPanel = require('./account-panel')
|
const AccountPanel = require('./account-panel')
|
||||||
const RadioList = require('./custom-radio-list')
|
const RadioList = require('./custom-radio-list')
|
||||||
const { getNetworkDisplayName } = require('../../../app/scripts/controllers/network/util')
|
const { getNetworkDisplayName } = require('../../../app/scripts/controllers/network/util')
|
||||||
|
2
ui/app/components/loading-screen/index.js
Normal file
2
ui/app/components/loading-screen/index.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
const LoadingScreen = require('./loading-screen.component')
|
||||||
|
module.exports = LoadingScreen
|
@ -2,8 +2,9 @@ const { Component } = require('react')
|
|||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
const classnames = require('classnames')
|
const classnames = require('classnames')
|
||||||
|
const Spinner = require('../spinner')
|
||||||
|
|
||||||
class LoadingIndicator extends Component {
|
class LoadingScreen extends Component {
|
||||||
renderMessage () {
|
renderMessage () {
|
||||||
const { loadingMessage } = this.props
|
const { loadingMessage } = this.props
|
||||||
return loadingMessage && h('span', loadingMessage)
|
return loadingMessage && h('span', loadingMessage)
|
||||||
@ -14,9 +15,9 @@ class LoadingIndicator extends Component {
|
|||||||
h('.loading-overlay', {
|
h('.loading-overlay', {
|
||||||
className: classnames({ 'loading-overlay--full-screen': this.props.fullScreen }),
|
className: classnames({ 'loading-overlay--full-screen': this.props.fullScreen }),
|
||||||
}, [
|
}, [
|
||||||
h('.flex-center.flex-column', [
|
h('.loading-overlay__container', [
|
||||||
h('img', {
|
h(Spinner, {
|
||||||
src: 'images/loading.svg',
|
color: '#F7C06C',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
this.renderMessage(),
|
this.renderMessage(),
|
||||||
@ -26,9 +27,9 @@ class LoadingIndicator extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadingIndicator.propTypes = {
|
LoadingScreen.propTypes = {
|
||||||
loadingMessage: PropTypes.string,
|
loadingMessage: PropTypes.string,
|
||||||
fullScreen: PropTypes.bool,
|
fullScreen: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = LoadingIndicator
|
module.exports = LoadingScreen
|
@ -12,7 +12,7 @@ const { getSymbolAndDecimals } = require('../../token-util')
|
|||||||
const ConfirmSendEther = require('./confirm-send-ether')
|
const ConfirmSendEther = require('./confirm-send-ether')
|
||||||
const ConfirmSendToken = require('./confirm-send-token')
|
const ConfirmSendToken = require('./confirm-send-token')
|
||||||
const ConfirmDeployContract = require('./confirm-deploy-contract')
|
const ConfirmDeployContract = require('./confirm-deploy-contract')
|
||||||
const Loading = require('../loading')
|
const Loading = require('../loading-screen')
|
||||||
|
|
||||||
const TX_TYPES = {
|
const TX_TYPES = {
|
||||||
DEPLOY_CONTRACT: 'deploy_contract',
|
DEPLOY_CONTRACT: 'deploy_contract',
|
||||||
|
2
ui/app/components/spinner/index.js
Normal file
2
ui/app/components/spinner/index.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
const Spinner = require('./spinner.component')
|
||||||
|
module.exports = Spinner
|
78
ui/app/components/spinner/spinner.component.js
Normal file
78
ui/app/components/spinner/spinner.component.js
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
|
const Spinner = ({ className = '', color = '#000000' }) => {
|
||||||
|
return (
|
||||||
|
<div className={`spinner ${className}`}>
|
||||||
|
<svg className="lds-spinner" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style={{background: 'none'}}>
|
||||||
|
<g transform="rotate(0 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(30 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(60 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.75s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(90 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(120 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(150 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.5s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(180 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(210 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(240 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.25s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(270 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(300 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="rotate(330 50 50)">
|
||||||
|
<rect x={45} y={0} rx={0} ry={0} width={10} height={30} fill={color}>
|
||||||
|
<animate attributeName="opacity" values="1;0" dur="1s" begin="0s" repeatCount="indefinite" />
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spinner.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
color: PropTypes.string,
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Spinner
|
@ -13,7 +13,7 @@ const SignatureRequest = require('./components/signature-request')
|
|||||||
// const PendingMsg = require('./components/pending-msg')
|
// const PendingMsg = require('./components/pending-msg')
|
||||||
// const PendingPersonalMsg = require('./components/pending-personal-msg')
|
// const PendingPersonalMsg = require('./components/pending-personal-msg')
|
||||||
// const PendingTypedMsg = require('./components/pending-typed-msg')
|
// const PendingTypedMsg = require('./components/pending-typed-msg')
|
||||||
const Loading = require('./components/loading')
|
const Loading = require('./components/loading-screen')
|
||||||
const { DEFAULT_ROUTE } = require('./routes')
|
const { DEFAULT_ROUTE } = require('./routes')
|
||||||
|
|
||||||
module.exports = compose(
|
module.exports = compose(
|
||||||
|
@ -26,4 +26,25 @@
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__container {
|
||||||
|
position: absolute;
|
||||||
|
top: 33%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__message {
|
||||||
|
margin-top: 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 20px;
|
||||||
|
color: $manatee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
height: 58px;
|
||||||
|
width: 58px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user