From 48c8d5d82b44759e3bf95f379f0ad169e876cedc Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Sat, 29 Feb 2020 13:15:36 +0300 Subject: [PATCH] added SSR --- backend/.tmp/data.db | Bin 110592 -> 110592 bytes frontend/components/Articles.js | 7 +- frontend/components/Layout.js | 27 ++++++ frontend/components/nav.js | 5 +- frontend/next.config.js | 6 +- frontend/package-lock.json | 36 +++++++ frontend/package.json | 2 + frontend/pages/_app.js | 39 -------- frontend/pages/articles/[id].js | 62 ++++++------ frontend/pages/categories/[id].js | 37 ++++---- frontend/pages/index.js | 26 ++--- frontend/utils/apollo.js | 152 +++++++++++++++++++++++++++--- package.json | 2 +- 13 files changed, 285 insertions(+), 116 deletions(-) create mode 100644 frontend/components/Layout.js delete mode 100644 frontend/pages/_app.js diff --git a/backend/.tmp/data.db b/backend/.tmp/data.db index 5c35fa5c317481bd50999638e6e5866be44c6270..0a4b27a3f0c0f4ca9ff3ad0ca1701dae261bc92a 100644 GIT binary patch delta 27 jcmZp8z}E19ZGtqT#6%fqMv2CRtqF{C*0W5Acr_mYh^q=w delta 27 jcmZp8z}E19ZGtqT*hCp;MzO|(tqF{C*0b~~XN3U(hIt80 diff --git a/frontend/components/Articles.js b/frontend/components/Articles.js index 9cdfc2b..41d6a74 100644 --- a/frontend/components/Articles.js +++ b/frontend/components/Articles.js @@ -1,21 +1,20 @@ -import Card from "./card"; +import Card from "./Card"; const Articles = ({ articles }) => { - console.log(articles) const leftArticlesCount = Math.ceil(articles.length / 5); const leftArticles = articles.slice(0, leftArticlesCount); const rightArticles = articles.slice(leftArticlesCount, articles.length); return (
-
+
{leftArticles.map((article, i) => { return ; })}
-
+
{rightArticles.map((article, i) => { return ; })} diff --git a/frontend/components/Layout.js b/frontend/components/Layout.js new file mode 100644 index 0000000..df359d1 --- /dev/null +++ b/frontend/components/Layout.js @@ -0,0 +1,27 @@ +import Head from 'next/head' +import Nav from './Nav' + +const Layout = props => { + return( + <> + + {props.titlePage} + + +