Skip to content

Commit

Permalink
[hotfix] change isLoading to CircularProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
jominjimail committed Dec 22, 2019
1 parent fd9da41 commit 836fcc6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
5 changes: 4 additions & 1 deletion client/src/components/MusicDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { IMusicContent } from '../MusicDetail/types';
import { IMusic } from '../UploadMusic/types';
import { getShortId, getTimeSimple } from '../../utils';
import Comment from '../Comment';
import { CircularProgress } from '@material-ui/core';

const MusicDetail: React.FC<MusicDetailProp> = ({
data,
Expand Down Expand Up @@ -62,7 +63,9 @@ const MusicDetail: React.FC<MusicDetailProp> = ({

return (
isLoading || data === null
? (<div>Loading...</div>)
? (<S.Progress>
<CircularProgress color="inherit" />
</S.Progress>)
: (
<S.Container>
<S.Header>
Expand Down
6 changes: 6 additions & 0 deletions client/src/components/MusicDetail/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ export const CopyRight = styled.div`
margin: 5rem 0;
color: ${theme.AMERICAN_RIVER};
`;

export const Progress = styled.div`
margin: auto auto;
margin-top: 20px;
color: ${theme.BORDER_GRAY};
`;
7 changes: 6 additions & 1 deletion client/src/components/WorksDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { WorksDetailProp } from './types';
import { UPLOAD } from '../../utils/constants';
import { RootState } from '../../modules';
import { CircularProgress } from '@material-ui/core';

const WorksDetail:React.FC<WorksDetailProp> = ({
data, inputComment, user, isLoading, isError, changeInputHandler, addNewComment,
Expand Down Expand Up @@ -69,7 +70,11 @@ const WorksDetail:React.FC<WorksDetailProp> = ({

return (
isLoading || data === null
? (<div>Loading...</div>)
? (
<S.Progress>
<CircularProgress color="inherit" />
</S.Progress>
)
: (
<S.Container>
<S.Title>{data.title}</S.Title>
Expand Down
6 changes: 6 additions & 0 deletions client/src/components/WorksDetail/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ export const ImageContent = styled.div<ImageContentProp>`
background-position: center center;
margin-top: 1rem;
`;

export const Progress = styled.div`
margin: auto auto;
margin-top: 20px;
color: ${theme.BORDER_GRAY};
`;
9 changes: 6 additions & 3 deletions server/services/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const get10Images = (skip, limit) => Image.find()
.skip(skip)
.limit(limit)
.populate('creator', 'name thumbnailUrl')
.populate('owner', 'emoji comments views title');
.populate('owner', 'emoji comments views title')
.sort({ updatedAt: -1 });

const getIdsImages = (id) => Image.find({ creator: id })
.populate('creator', 'name thumbnailUrl')
Expand All @@ -19,7 +20,8 @@ const get10Wallpapers = (skip, limit) => Wallpaper.find()
.skip(skip)
.limit(limit)
.populate('creator', 'name thumbnailUrl')
.populate('owner', 'emoji comments views title');
.populate('owner', 'emoji comments views title')
.sort({ updatedAt: -1 });

const getImageFeeds = (skip, limit) => Image.find()
.skip(skip)
Expand All @@ -31,7 +33,8 @@ const get10Musics = (skip, limit) => Music.find()
.skip(skip)
.limit(limit)
.populate('creator', 'name thumbnailUrl')
.populate('owner', 'comments views');
.populate('owner', 'comments views')
.sort({ updatedAt: -1 });

const getIdsMusics = (id) => Music.find({ creator: id })
.populate('creator', 'name thumbnailUrl')
Expand Down

0 comments on commit 836fcc6

Please sign in to comment.