From 3bc8c5912bf727cc8631e64bc88cddb72a9393a4 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 6 Oct 2017 12:04:35 +0200 Subject: [PATCH] Loader for what pages is to be displayed based on the state of cookie: logged_in. Either displays login page or fetchrequested. --- client/app/components/Admin.jsx | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 client/app/components/Admin.jsx diff --git a/client/app/components/Admin.jsx b/client/app/components/Admin.jsx new file mode 100644 index 0000000..96d36af --- /dev/null +++ b/client/app/components/Admin.jsx @@ -0,0 +1,35 @@ +/* + ./app/components/App.jsx + + +*/ +import React from 'react'; +import { Link } from 'react-router-dom' + +import FetchData from './FetchData.js'; +import ListStrays from './ListStrays.jsx'; + +import FetchRequested from './FetchRequested.jsx'; + +import LoginForm from './LoginForm/LoginForm.jsx'; +import { Provider } from 'react-redux'; +import store from './redux/store.jsx'; + +import { getCookie } from './Cookie.jsx'; + + +function getLoginStatus() { + const logged_in = getCookie('logged_in'); + if (logged_in) { + return + } + return +} + +const Admin = () => ( + + { getLoginStatus() } + +) + +export default Admin \ No newline at end of file