From 6e5362245826223c8141d50646f3b7368850f924 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 18 Jun 2018 14:59:29 +0300 Subject: content loader --- vnext/package.json | 1 + vnext/src/components/Feeds.js | 2 +- vnext/src/components/Spinner.js | 21 ++++++++++++++++++--- vnext/yarn.lock | 4 ++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/vnext/package.json b/vnext/package.json index 83dff46c..4134026f 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -42,6 +42,7 @@ "moment": "^2.22.2", "query-string": "^6.1.0", "react": "^16.4.1", + "react-content-loader": "^3.1.2", "react-dom": "^16.4.1", "react-router-dom": "^4.3.1" } diff --git a/vnext/src/components/Feeds.js b/vnext/src/components/Feeds.js index d0123016..0c8f46ae 100644 --- a/vnext/src/components/Feeds.js +++ b/vnext/src/components/Feeds.js @@ -60,7 +60,7 @@ class Feed extends React.Component { }); return this.state.msgs.length > 0 ? (
{nodes}
- ) : ; + ) :
; } } diff --git a/vnext/src/components/Spinner.js b/vnext/src/components/Spinner.js index 10a247f9..e3d635f8 100644 --- a/vnext/src/components/Spinner.js +++ b/vnext/src/components/Spinner.js @@ -1,14 +1,29 @@ import React from 'react'; - -import Icon from './Icon'; +import ContentLoader from "react-content-loader"; export default function Spinner(props) { return ( -
+ + + + + + + + ) } const centeredStyle = { + background: '#fff', display: 'flex', justifyContent: 'center', alignItems: 'center' diff --git a/vnext/yarn.lock b/vnext/yarn.lock index fe6e7b07..08aa4f77 100644 --- a/vnext/yarn.lock +++ b/vnext/yarn.lock @@ -4095,6 +4095,10 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-content-loader@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/react-content-loader/-/react-content-loader-3.1.2.tgz#98230b4604b4b744eaa2d3fc88917dd988df6766" + react-dom@^16.4.1: version "16.4.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" -- cgit v1.2.3