From 1b2e85bfd7cee38d11f793ab08551819c919b071 Mon Sep 17 00:00:00 2001 From: JiPai <3956400+PaiJi@users.noreply.github.com> Date: Thu, 9 May 2024 16:18:27 +0800 Subject: [PATCH] feat: opti (#179) * feat: add posthog * feat: remove posthog * style: use next/font * feat: use Fluent emoji * feat: use fluent emoji in footer * fix: fix typo * fix: fix image too large * fix: kick out addDynamicIconSelectors * chore: remove dependency * chore: test no font import bundle size * fix: enable next/font * feat: enable sentry source upload & new 404 * feat: enable autoformat for logo --- next.config.js | 8 +-- package.json | 1 + public/svgs/lion.svg | 1 + public/svgs/smiling-face-with-hearts.svg | 1 + public/svgs/steaming-bowl.svg | 1 + public/svgs/tiger-face.svg | 1 + public/svgs/wolf.svg | 1 + src/components/eventCard/index.tsx | 1 + src/components/layout/footer.tsx | 14 ++++- src/components/layout/header.tsx | 72 +++++++++++++++++++++++- src/components/layout/index.tsx | 10 +--- src/pages/404.tsx | 27 +++++++-- src/pages/[organization]/[slug].tsx | 1 + src/pages/[organization]/index.tsx | 1 + src/pages/_app.tsx | 41 ++++++++++++-- src/pages/_document.tsx | 48 ++-------------- src/pages/index.tsx | 8 +-- src/pages/organization.tsx | 1 + src/styles/globals.css | 6 +- tailwind.config.js | 1 + yarn.lock | 20 +++++++ 21 files changed, 188 insertions(+), 77 deletions(-) create mode 100644 public/svgs/lion.svg create mode 100644 public/svgs/smiling-face-with-hearts.svg create mode 100644 public/svgs/steaming-bowl.svg create mode 100644 public/svgs/tiger-face.svg create mode 100644 public/svgs/wolf.svg diff --git a/next.config.js b/next.config.js index 860680f..f6e7d98 100644 --- a/next.config.js +++ b/next.config.js @@ -20,13 +20,13 @@ const gitRevisionPlugin = new GitRevisionPlugin(); /** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", + poweredByHeader: false, reactStrictMode: true, images: { unoptimized: false, loader: "custom", loaderFile: "./src/utils/imageLoader.ts", }, - optimizeFonts: false, assetPrefix: isProd && STATIC_CDN_URL ? STATIC_CDN_URL : undefined, experimental: { swcPlugins: [ @@ -38,11 +38,11 @@ const nextConfig = { ], ], }, - trailingSlash: true, sentry: { - disableClientWebpackPlugin: true, - disableServerWebpackPlugin: true, + // disableClientWebpackPlugin: true, + // disableServerWebpackPlugin: true, hideSourcemaps: true, + disableLogger: true, }, webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { config.plugins.push( diff --git a/package.json b/package.json index b78fd24..dfce09a 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@headlessui/react": "^2.0.1", + "@next/third-parties": "^14.2.3", "@radix-ui/react-collapsible": "^1.0.3", "@sentry/nextjs": "^7.113.0", "@xata.io/client": "^0.29.4", diff --git a/public/svgs/lion.svg b/public/svgs/lion.svg new file mode 100644 index 0000000..e0de005 --- /dev/null +++ b/public/svgs/lion.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svgs/smiling-face-with-hearts.svg b/public/svgs/smiling-face-with-hearts.svg new file mode 100644 index 0000000..caef819 --- /dev/null +++ b/public/svgs/smiling-face-with-hearts.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svgs/steaming-bowl.svg b/public/svgs/steaming-bowl.svg new file mode 100644 index 0000000..d89d6a7 --- /dev/null +++ b/public/svgs/steaming-bowl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svgs/tiger-face.svg b/public/svgs/tiger-face.svg new file mode 100644 index 0000000..8372226 --- /dev/null +++ b/public/svgs/tiger-face.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svgs/wolf.svg b/public/svgs/wolf.svg new file mode 100644 index 0000000..13518ba --- /dev/null +++ b/public/svgs/wolf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/eventCard/index.tsx b/src/components/eventCard/index.tsx index 221387a..b2378a6 100644 --- a/src/components/eventCard/index.tsx +++ b/src/components/eventCard/index.tsx @@ -88,6 +88,7 @@ export default function EventCard({ height={100} sizes="100px" aria-label="organization's logo" + autoFormat /> )} diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx index 8a36cf4..3864c35 100644 --- a/src/components/layout/footer.tsx +++ b/src/components/layout/footer.tsx @@ -1,7 +1,6 @@ import { AboutUsLinks, FriendSiteLinks } from "@/constants/staticConfig"; import { sendTrack } from "@/utils/track"; import Link from "next/link"; -import { FaKissWinkHeart } from "react-icons/fa"; import { format } from "date-fns"; import { zhCN } from "date-fns/locale"; @@ -58,8 +57,17 @@ export default function Footer({ isCNRegion }: { isCNRegion: boolean }) {