From de84658b48985e24b0f92a1690387f6d59d0bc16 Mon Sep 17 00:00:00 2001 From: sct Date: Fri, 18 Sep 2020 01:28:21 +0000 Subject: [PATCH] feat(frontend): loading spinner --- .../Common/LoadingSpinner/index.tsx | 32 +++++++++++++++++++ src/components/MovieDetails/index.tsx | 6 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/components/Common/LoadingSpinner/index.tsx diff --git a/src/components/Common/LoadingSpinner/index.tsx b/src/components/Common/LoadingSpinner/index.tsx new file mode 100644 index 000000000..570de01a4 --- /dev/null +++ b/src/components/Common/LoadingSpinner/index.tsx @@ -0,0 +1,32 @@ +import React from 'react'; + +const LoadingSpinner: React.FC = () => { + return ( +
+ + + + + + + + + + +
+ ); +}; + +export default LoadingSpinner; diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index 3f9053de5..ee2dd525a 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -19,6 +19,7 @@ import Slider from '../Slider'; import TitleCard from '../TitleCard'; import PersonCard from '../PersonCard'; import { LanguageContext } from '../../context/LanguageContext'; +import LoadingSpinner from '../Common/LoadingSpinner'; const messages = defineMessages({ releasedate: 'Release Date', @@ -99,12 +100,13 @@ const MovieDetails: React.FC = ({ movie }) => { }; if (!data && !error) { - return
loading!
; + return ; } if (!data) { - return
Unknwon?
; + return
Broken?
; } + return (