From 2d145b026cfdf54a63bef0b9d6324b6785390307 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 14 Sep 2018 12:18:12 -0400 Subject: move finished folder --- .../frontend/components/PleaseSignIn.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 finished-application/frontend/components/PleaseSignIn.js (limited to 'finished-application/frontend/components/PleaseSignIn.js') diff --git a/finished-application/frontend/components/PleaseSignIn.js b/finished-application/frontend/components/PleaseSignIn.js new file mode 100644 index 0000000..80cfdbf --- /dev/null +++ b/finished-application/frontend/components/PleaseSignIn.js @@ -0,0 +1,22 @@ +import { Query } from 'react-apollo'; +import { CURRENT_USER_QUERY } from './User'; +import Signin from './Signin'; + +const PleaseSignIn = props => ( + + {({ data, loading }) => { + if (loading) return

Loading...

; + if (!data.me) { + return ( +
+

Please Sign In before Continuing

+ +
+ ); + } + return props.children; + }} +
+); + +export default PleaseSignIn; -- cgit v1.3