From f6fb3a7753d79f2c301741a901915619663460ba Mon Sep 17 00:00:00 2001
From: JiPai <3956400+PaiJi@users.noreply.github.com>
Date: Sun, 28 Jan 2024 02:58:17 +0800
Subject: [PATCH] feat(everything): tiny issues (#143)
---
next.config.js | 2 +-
src/components/eventCard/index.tsx | 8 ++---
src/components/layout/footer.tsx | 12 ++++----
src/components/layout/header.tsx | 2 +-
src/constants/staticConfig.ts | 47 +++++++++++++++++++-----------
src/pages/_document.tsx | 6 ----
src/pages/city.tsx | 2 +-
src/pages/years.tsx | 1 -
src/utils/imageLoader.ts | 7 ++++-
src/utils/track.ts | 2 --
10 files changed, 49 insertions(+), 40 deletions(-)
diff --git a/next.config.js b/next.config.js
index 00c9937..99c1a79 100644
--- a/next.config.js
+++ b/next.config.js
@@ -44,7 +44,7 @@ const nextConfig = {
config.plugins.push(
new webpack.DefinePlugin({
VERSION: JSON.stringify(gitRevisionPlugin.version()),
- COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()),
+ COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash().slice(0, 7)),
BRANCH: JSON.stringify(gitRevisionPlugin.branch()),
LASTCOMMITDATETIME: JSON.stringify(
gitRevisionPlugin.lastcommitdatetime()
diff --git a/src/components/eventCard/index.tsx b/src/components/eventCard/index.tsx
index c616cf1..f33737e 100644
--- a/src/components/eventCard/index.tsx
+++ b/src/components/eventCard/index.tsx
@@ -7,6 +7,7 @@ import { BsCalendar2DateFill } from "react-icons/bs";
import Image from "@/components/image";
import clsx from "clsx";
import { sendTrack } from "@/utils/track";
+import { getEventCoverUrl } from "@/utils/imageLoader";
export default function EventCard({
event,
@@ -17,10 +18,7 @@ export default function EventCard({
}) {
const [isWiderImage, setIsWiderImage] = useState(true);
- const finalEventCoverImage =
- event.coverUrl ||
- event.posterUrl?.[0] ||
- `https://images.furrycons.cn/fec-event-default-cover.png`;
+ const finalEventCoverImage = getEventCoverUrl(event);
const isDefaultCover = finalEventCoverImage.includes(
"fec-event-default-cover"
);
@@ -116,7 +114,7 @@ export default function EventCard({
- {event.address}
+ {event.address || "尚未公布"}
diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx
index 05003ee..81a60f0 100644
--- a/src/components/layout/footer.tsx
+++ b/src/components/layout/footer.tsx
@@ -9,9 +9,10 @@ export default function Footer({ isCNRegion }: { isCNRegion: boolean }) {
return (