From 03645f8363e1f2590a99dd2c304e04ae876271eb Mon Sep 17 00:00:00 2001 From: Arrofi Reza Satria Date: Fri, 9 Dec 2022 18:31:12 +0700 Subject: [PATCH] feat: pwa --- src/components/AppsBar.tsx | 16 ++-------------- src/pages/_document.tsx | 27 +++++++++++++++++++++++++++ src/pages/blog/[slug].tsx | 4 ++-- src/pages/index.tsx | 4 +++- 4 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 src/pages/_document.tsx diff --git a/src/components/AppsBar.tsx b/src/components/AppsBar.tsx index 591a4c6..822219e 100644 --- a/src/components/AppsBar.tsx +++ b/src/components/AppsBar.tsx @@ -1,12 +1,4 @@ -import { - AppBar, - Box, - Button, - Container, - IconButton, - Toolbar, - Typography, -} from "@mui/material"; +import { AppBar, Box, Container, IconButton, Toolbar } from "@mui/material"; import React from "react"; import { useThemeContext } from "@modules/components/ThemeContext"; import Brightness4Icon from "@mui/icons-material/Brightness4"; @@ -18,10 +10,6 @@ const link = [ { title: "blog", link: "/blog" }, ]; -const CustomLink = (params: { url: string; title: string }) => { - return {params.title}; -}; - export default function AppsBar() { const { toggleDarkMode, darkMode } = useThemeContext(); @@ -34,7 +22,7 @@ export default function AppsBar() { {link.map((item, index) => { return (
  • - + {item.title}
  • ); })} diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx new file mode 100644 index 0000000..73d9c0f --- /dev/null +++ b/src/pages/_document.tsx @@ -0,0 +1,27 @@ +import { Html, Head, Main, NextScript } from "next/document"; + +export default function Document() { + return ( + + + {/* for manifest PWA */} + + {/* PWA primary color */} + + + + +
    + + + + ); +} diff --git a/src/pages/blog/[slug].tsx b/src/pages/blog/[slug].tsx index 6a73c07..5448891 100644 --- a/src/pages/blog/[slug].tsx +++ b/src/pages/blog/[slug].tsx @@ -21,9 +21,9 @@ export default function BlogPost() {

    Your Title

    subtitle

    - +
    article body
    - +
    ); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 97850ad..561ca38 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -10,7 +10,9 @@ export default function Home() { return ( -
    title
    +
    +

    title

    +
    a
    b