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

Commit

Permalink
Merge pull request #25 from cfpb/css-loading-icon
Browse files Browse the repository at this point in the history
Bring css loading icon to modified lar
  • Loading branch information
awolfe76 authored Apr 17, 2018
2 parents 8381611 + 69b5cb8 commit 65a507d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 18 deletions.
12 changes: 5 additions & 7 deletions src/common/LoadingIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react'

const LoadingIcon = () => {
const LoadingIcon = props => {
let className = 'LoadingIconWrapper'
if (props.className) className += ' ' + props.className
return (
<div className="LoadingIconWrapper">
<img
src="/data-publication/img/LoadingIcon.png"
className="LoadingIcon"
alt="Loading"
/>
<div className={className}>
<div className="LoadingIcon" />
</div>
)
}
Expand Down
49 changes: 40 additions & 9 deletions src/common/LoadingIcon.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
.LoadingIconWrapper {
.LoadingInline.LoadingIconWrapper {
height: 22px;
width: 22px;
display: inline-block;
position: relative;
transform: rotateX(180deg);
width: 40px;
margin-left: 5px;
margin-top: 0;
padding-top: 3px;
.LoadingIcon {
height: 22px;
width: 22px;
}
}

.LoadingIcon {
animation: loading-spin 2s infinite linear;
position: absolute;
top: -7px;
.status .LoadingInline {
height: 18px;
width: 18px;
}


@keyframes loading-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(-359deg);
transform: rotate(360deg);
}
}

.LoadingIconWrapper {
position: relative;
height: 30px;
width: 30px;
display: inline-block;
margin-top: 2em;
margin-left: 48%;
}

.LoadingIcon {
position:absolute;
margin: 0 auto;
border: 4px solid $color-gray-lightest;
border-left-color: $color-primary;
border-radius: 50%;
width: 30px;
height: 30px;
animation: loading-spin 1.2s linear infinite;
}

.usa-alert .LoadingIcon {
border: 4px solid $color-gray-lighter;
border-left-color: $color-primary;
}
Binary file removed src/img/LoadingIcon.png
Binary file not shown.
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/data-publication/img/favicons/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/data-publication/css/app.min.css">
<link rel="prefetch" href="/data-publication/img/LoadingIcon.png">
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
Expand Down
2 changes: 1 addition & 1 deletion src/reports/modified-lar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ModifiedLar extends React.Component {

let loading = null
if (this.state.status.id === 1 || this.state.status.id === 3) {
loading = <LoadingIcon />
loading = <LoadingIcon className="LoadingInline" />
}

return (
Expand Down

0 comments on commit 65a507d

Please sign in to comment.