From dc85e1343f6c07ee0c52ab7210495fb8e900aee3 Mon Sep 17 00:00:00 2001 From: suu3 Date: Fri, 1 Mar 2024 00:27:11 +0900 Subject: [PATCH] =?UTF-8?q?[style]=20pagination=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gatsby-browser.tsx | 24 +-- package.json | 2 +- pnpm-lock.yaml | 32 ---- src/components/@core/layout.tsx | 21 ++- src/components/@layout/footer.module.css | 9 ++ src/components/@layout/footer.tsx | 14 ++ src/components/@layout/post-list-template.tsx | 13 +- src/components/pagination.module.css | 66 ++++++++ src/components/pagination.tsx | 152 ++++++++++++++++++ 9 files changed, 273 insertions(+), 60 deletions(-) create mode 100644 src/components/@layout/footer.module.css create mode 100644 src/components/@layout/footer.tsx create mode 100644 src/components/pagination.module.css create mode 100644 src/components/pagination.tsx diff --git a/gatsby-browser.tsx b/gatsby-browser.tsx index ad3857e5..3a5dd6dd 100644 --- a/gatsby-browser.tsx +++ b/gatsby-browser.tsx @@ -36,24 +36,24 @@ export const shouldUpdateScroll = ({ getSavedScrollPosition, }) => { // transition duration from `layout.js` * 1000 to get time in ms - const TRANSITION_DELAY = 0.3 * 1000 * 2 + // const TRANSITION_DELAY = 0.3 * 1000 * 2 // if it's a "normal" route - if (location.action === "PUSH") { - window.setTimeout(() => window.scrollTo(0, 0), TRANSITION_DELAY) - } + // if (location.action === "PUSH") { + // window.setTimeout(() => window.scrollTo(0, 0), TRANSITION_DELAY) + // } // if we used the browser's forwards or back button - else { - // breaking change in shouldUpdateScroll browser API hook: - // https://github.com/gatsbyjs/gatsby/issues/23842 - // looks like they fixed it in Gatsby v. 2.28.1 - // https://github.com/gatsbyjs/gatsby/pull/27384 + // else { + // // breaking change in shouldUpdateScroll browser API hook: + // // https://github.com/gatsbyjs/gatsby/issues/23842 + // // looks like they fixed it in Gatsby v. 2.28.1 + // // https://github.com/gatsbyjs/gatsby/pull/27384 - const savedPosition = getSavedScrollPosition(location) || [0, 0] + // const savedPosition = getSavedScrollPosition(location) || [0, 0] - window.setTimeout(() => window.scrollTo(...savedPosition), TRANSITION_DELAY) - } + // window.setTimeout(() => window.scrollTo(...savedPosition), TRANSITION_DELAY) + // } return false } diff --git a/package.json b/package.json index c9d78ee2..074c4db2 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,4 @@ + { "name": "gatsby-blog", "private": true, @@ -28,7 +29,6 @@ "lodash": "^4.17.21", "postcss": "^8.4.30", "prismjs": "^1.29.0", - "rc-pagination": "^3.6.1", "react": "^18.1.0", "react-dom": "^18.1.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 371829e0..9b700ecd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,9 +74,6 @@ dependencies: prismjs: specifier: ^1.29.0 version: 1.29.0 - rc-pagination: - specifier: ^3.6.1 - version: 3.6.1(react-dom@18.1.0)(react@18.1.0) react: specifier: ^18.1.0 version: 18.1.0 @@ -3877,10 +3874,6 @@ packages: /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} - /classnames@2.3.2: - resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} - dev: false - /cli-boxes@2.2.1: resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} engines: {node: '>=6'} @@ -9032,31 +9025,6 @@ packages: schema-utils: 3.3.0 webpack: 5.88.2 - /rc-pagination@3.6.1(react-dom@18.1.0)(react@18.1.0): - resolution: {integrity: sha512-R/sUnKKXx1Nm4kZfUKS3YKa7yEPF1ZkVB/AynQaHt+nMER7h9wPTfliDJFdYo+RM/nk2JD4Yc5QpUq8fIQHeug==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@babel/runtime': 7.22.6 - classnames: 2.3.2 - rc-util: 5.37.0(react-dom@18.1.0)(react@18.1.0) - react: 18.1.0 - react-dom: 18.1.0(react@18.1.0) - dev: false - - /rc-util@5.37.0(react-dom@18.1.0)(react@18.1.0): - resolution: {integrity: sha512-cPMV8DzaHI1KDaS7XPRXAf4J7mtBqjvjikLpQieaeOO7+cEbqY2j7Kso/T0R0OiEZTNcLS/8Zl9YrlXiO9UbjQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@babel/runtime': 7.22.6 - react: 18.1.0 - react-dom: 18.1.0(react@18.1.0) - react-is: 16.13.1 - dev: false - /rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true diff --git a/src/components/@core/layout.tsx b/src/components/@core/layout.tsx index 98294c29..0d014be0 100644 --- a/src/components/@core/layout.tsx +++ b/src/components/@core/layout.tsx @@ -1,22 +1,21 @@ import * as React from "react" import Navigation from "../@layout/navigation" +import Footer from "../@layout/footer" const Layout = ({ location, children }) => { const rootPath = `${__PATH_PREFIX__}` const isRootPath = location.pathname === rootPath return ( -
-
- -
- {children} -
- © {new Date().getFullYear()}, Built with - {` `} - Gatsby -
-
+ <> +
+
+ +
+ {children} +
+