From 1499c0126d1a7a2377b0267b761479100c636ee9 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Tue, 30 Jun 2020 00:41:09 +0300
Subject: feat!: create useNavigate hook

---
 src/pages/Page.tsx | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 src/pages/Page.tsx

(limited to 'src/pages/Page.tsx')

diff --git a/src/pages/Page.tsx b/src/pages/Page.tsx
new file mode 100644
index 0000000..6d4315e
--- /dev/null
+++ b/src/pages/Page.tsx
@@ -0,0 +1,31 @@
+import React from 'react';
+import { makeStyles } from '@material-ui/core/styles';
+import ProfilePage from './ProfilePage/ProfilePage';
+import FeedPage from './FeedPage/FeedPage';
+import AuthPage from './AuthPage/AuthPage';
+import { useNavigate } from '../hooks/useNavigate';
+
+const useStyles = makeStyles(theme => ({
+  root: {
+    width: theme.spacing(75),
+    marginTop: theme.spacing(15),
+    margin: '0 auto'
+  }
+}));
+
+const Page: React.FC = () => {
+  const { page } = useNavigate();
+  const classes = useStyles();
+
+  return (
+    <div className={classes.root}>
+      { page.prefix === 'profile' && <ProfilePage />}
+      { page.prefix === 'feed' && <FeedPage /> }
+      { page.prefix === 'auth' && <AuthPage /> }
+    </div>
+  );
+};
+
+
+export default Page;
+
-- 
cgit v1.2.3

