add spinner to related content

This commit is contained in:
Sean Yesmunt 2018-08-28 11:35:24 -04:00
parent 857ab8d207
commit 52f3fab3a6
4 changed files with 19 additions and 2 deletions

View file

@ -2,6 +2,7 @@
import React from 'react'; import React from 'react';
import FileTile from 'component/fileTile'; import FileTile from 'component/fileTile';
import type { Claim } from 'types/claim'; import type { Claim } from 'types/claim';
import Spinner from 'component/spinner';
type Props = { type Props = {
uri: string, uri: string,
@ -65,6 +66,7 @@ export default class RecommendedContent extends React.PureComponent<Props> {
{recommendedContent && {recommendedContent &&
!recommendedContent.length && !recommendedContent.length &&
!isSearching && <div className="card__subtitle">No related content found</div>} !isSearching && <div className="card__subtitle">No related content found</div>}
{isSearching && <Spinner type="small" />}
</section> </section>
); );
} }

View file

@ -19,6 +19,7 @@ const Spinner = (props: Props) => {
'spinner--dark': !light && (dark || theme === LIGHT_THEME), 'spinner--dark': !light && (dark || theme === LIGHT_THEME),
'spinner--light': !dark && (light || theme === DARK_THEME), 'spinner--light': !dark && (light || theme === DARK_THEME),
'spinner--splash': type === 'splash', 'spinner--splash': type === 'splash',
'spinner--small': type === 'small',
})} })}
> >
<div className="rect rect1" /> <div className="rect rect1" />

View file

@ -50,6 +50,20 @@
} }
} }
.spinner--small {
margin: $spacing-vertical * 1/3 0;
width: 40px;
height: 32px;
text-align: center;
font-size: 10px;
.rect {
height: 100%;
width: 3px;
margin: 0 2px;
}
}
@keyframes sk-stretchdelay { @keyframes sk-stretchdelay {
0%, 0%,
40%, 40%,

View file

@ -5655,9 +5655,9 @@ lazy-val@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc" resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
lbry-redux@lbryio/lbry-redux#ccda4117ee503e30abae355c77d3783a141e9492: lbry-redux@lbryio/lbry-redux#eae0d134d92d83f733b85a8ecebf529a6e9799cf:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/ccda4117ee503e30abae355c77d3783a141e9492" resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/eae0d134d92d83f733b85a8ecebf529a6e9799cf"
dependencies: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"