From f4f10d5eb690a33dd1c112358457a2b987297f26 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 5 Apr 2018 13:54:22 -0400 Subject: work --- frontend/components/PleaseSignIn.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 frontend/components/PleaseSignIn.js (limited to 'frontend/components/PleaseSignIn.js') diff --git a/frontend/components/PleaseSignIn.js b/frontend/components/PleaseSignIn.js new file mode 100644 index 0000000..bd96842 --- /dev/null +++ b/frontend/components/PleaseSignIn.js @@ -0,0 +1,21 @@ +import { Query } from 'react-apollo'; +import { CURRENT_USER_QUERY } from '../queries/index'; +import Signin from './Signin'; + +const PleaseSignIn = props => ( + + {({ data }) => { + if (data.me) { + return props.children; + } + return ( +
+

Please sign in before continuing!

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