Browse Source

update home page

AykutSarac 3 years ago
parent
commit
208e776e41
1 changed files with 30 additions and 20 deletions
  1. 30 20
      src/pages/index.tsx

+ 30 - 20
src/pages/index.tsx

@@ -1,11 +1,12 @@
 import Image from "next/image";
 import Image from "next/image";
-import { useRouter } from "next/router";
 import React from "react";
 import React from "react";
 import { Button } from "src/components/Button";
 import { Button } from "src/components/Button";
 import { Container } from "src/components/Container";
 import { Container } from "src/components/Container";
 import { Navbar } from "src/components/Navbar";
 import { Navbar } from "src/components/Navbar";
 import styled from "styled-components";
 import styled from "styled-components";
 import { AiFillGithub } from "react-icons/ai";
 import { AiFillGithub } from "react-icons/ai";
+import { Footer } from "src/components/Footer";
+import Link from "next/link";
 
 
 const StyledHome = styled.div`
 const StyledHome = styled.div`
   padding: 24px;
   padding: 24px;
@@ -31,6 +32,10 @@ const StyledContent = styled.div`
 const StyledHeader = styled.h2`
 const StyledHeader = styled.h2`
   font-size: 54px;
   font-size: 54px;
   color: ${({ theme }) => theme.FULL_WHITE};
   color: ${({ theme }) => theme.FULL_WHITE};
+
+  @media only screen and (max-width: 768px) {
+    font-size: 36px;
+  }
 `;
 `;
 
 
 const StyledSubContent = styled.div`
 const StyledSubContent = styled.div`
@@ -42,8 +47,6 @@ const StyledText = styled.span<{ white?: boolean }>`
 `;
 `;
 
 
 const Home: React.FC = () => {
 const Home: React.FC = () => {
-  const route = useRouter();
-
   return (
   return (
     <StyledHome>
     <StyledHome>
       <Navbar />
       <Navbar />
@@ -56,9 +59,11 @@ const Home: React.FC = () => {
             Simple visualization tool for your JSON data. No forced structure,
             Simple visualization tool for your JSON data. No forced structure,
             paste your JSON data and view it instantly.
             paste your JSON data and view it instantly.
           </StyledSubContent>
           </StyledSubContent>
-          <Button onClick={() => route.push("/editor")} status="SECONDARY">
-            Start Generating
-          </Button>
+          <Link href="/editor" passHref>
+            <a>
+              <Button status="SECONDARY">Start Generating</Button>
+            </a>
+          </Link>
         </StyledContent>
         </StyledContent>
         <Image src="/graphs.svg" width={500} height={400} alt="graphs" />
         <Image src="/graphs.svg" width={500} height={400} alt="graphs" />
       </Container>
       </Container>
@@ -71,9 +76,11 @@ const Home: React.FC = () => {
             it into graphs. We&apos;ve done it at our side, so you can just
             it into graphs. We&apos;ve done it at our side, so you can just
             paste your JSON.
             paste your JSON.
           </StyledSubContent>
           </StyledSubContent>
-          <Button onClick={() => route.push("/editor")} status="SUCCESS">
-            Paste It!
-          </Button>
+          <Link href="/editor" passHref>
+            <a>
+              <Button status="SUCCESS">Paste It!</Button>
+            </a>
+          </Link>
         </StyledContent>
         </StyledContent>
         <Image src="/graphs3.svg" width={500} height={400} alt="preview" />
         <Image src="/graphs3.svg" width={500} height={400} alt="preview" />
       </Container>
       </Container>
@@ -85,9 +92,11 @@ const Home: React.FC = () => {
             Have an existing file for your data? No worries, directly import it
             Have an existing file for your data? No worries, directly import it
             into our editor without having to scroll through all of it!
             into our editor without having to scroll through all of it!
           </StyledSubContent>
           </StyledSubContent>
-          <Button onClick={() => route.push("/editor")} status="SUCCESS">
-            Import JSON
-          </Button>
+          <Link href="/editor" passHref>
+            <a>
+              <Button status="SUCCESS">Import JSON</Button>
+            </a>
+          </Link>
         </StyledContent>
         </StyledContent>
         <Image src="/graphs4.svg" width={500} height={400} alt="preview" />
         <Image src="/graphs4.svg" width={500} height={400} alt="preview" />
       </Container>
       </Container>
@@ -100,17 +109,18 @@ const Home: React.FC = () => {
             <StyledText> JSON</StyledText>
             <StyledText> JSON</StyledText>
             <StyledText white> Visio</StyledText> at GitHub!
             <StyledText white> Visio</StyledText> at GitHub!
           </StyledSubContent>
           </StyledSubContent>
-          <Button
-            onClick={() =>
-              route.push("https://github.com/AykutSarac/jsonvisio.com")
-            }
-          >
-            <AiFillGithub size={20} />
-            Check GitHub
-          </Button>
+          <Link href="https://github.com/AykutSarac/jsonvisio.com" passHref>
+            <a rel="me" target="_blank">
+              <Button>
+                <AiFillGithub size={20} />
+                Check GitHub
+              </Button>
+            </a>
+          </Link>
         </StyledContent>
         </StyledContent>
         <Image src="/graphs5.svg" width={500} height={400} alt="preview" />
         <Image src="/graphs5.svg" width={500} height={400} alt="preview" />
       </Container>
       </Container>
+      <Footer />
     </StyledHome>
     </StyledHome>
   );
   );
 };
 };