diff --git a/components/Common/AlertModal.jsx b/components/Common/AlertModal.jsx new file mode 100644 index 0000000..00925e8 --- /dev/null +++ b/components/Common/AlertModal.jsx @@ -0,0 +1,41 @@ +import React from 'react' + +const AlertModal = () => { + return ( +
+
+ +
+ +
+
+ +
+
+
+
+ +
+
+ +
+

Please check this website on desktop for now. Responsive design is currently in progress. Thanks for your understanding.

+
+
+
+
+
+ +
+
+
+
+
+ +
+ ) +} + +export default AlertModal \ No newline at end of file diff --git a/components/Layout/Footer.jsx b/components/Layout/Footer.jsx index 209f6c8..cb2a798 100644 --- a/components/Layout/Footer.jsx +++ b/components/Layout/Footer.jsx @@ -3,7 +3,7 @@ import Image from 'next/image' const Footer = () => { return ( -
+
diff --git a/pages/article/[id].jsx b/pages/article/[id].jsx index d236b31..a194a23 100644 --- a/pages/article/[id].jsx +++ b/pages/article/[id].jsx @@ -156,11 +156,8 @@ export const getStaticProps = async(context) => { } export const getStaticPaths = async(context) => { - const id = context.param.id return { - paths: [ - { params: { id: id}}, - ], - fallback: true + paths: [], //indicates that no page needs be created at build time + fallback: 'blocking' //indicates the type of fallback } -} \ No newline at end of file +} diff --git a/pages/index.jsx b/pages/index.jsx index 2b60341..5bde279 100644 --- a/pages/index.jsx +++ b/pages/index.jsx @@ -3,6 +3,7 @@ import Image from "next/image" import axios from 'axios' import Footer from '../components/Layout/Footer' import CreatedPost from "../components/Post/CreatedPost" +import AlertModal from "../components/Common/AlertModal" export default function Home() { @@ -12,6 +13,19 @@ export default function Home() { state: "latest", keyword: search }) + const [isMobile, setIsMobile] = useState(false); + + const handleResize = () => { + if (window.innerWidth < 640) { + setIsMobile(true) + } else { + setIsMobile(false) + } + } + + useEffect(() => { + window.addEventListener("resize", handleResize) + }) useEffect(() => { getArticles(queryState.state, queryState.keyword) @@ -61,12 +75,14 @@ export default function Home() { } return ( -
- Hello - {/*
+
+ { + (isMobile) && + } +
Get started with Up-road
What are you looking up-to?
-
+
-
+
-
+
{ articles.map((article, index) => { return (