-
Notifications
You must be signed in to change notification settings - Fork 38
新增活动浮窗 #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
app/components/ActivityTicker.tsx
Outdated
| function resolveCoverUrl(coverUrl: string): string { | ||
| if (coverUrl.startsWith("http")) { | ||
| return coverUrl; | ||
| } | ||
|
|
||
| if (coverUrl.startsWith("./assets/")) { | ||
| const filename = coverUrl.replace("./assets/", ""); | ||
| return `/event-assets/${filename}`; | ||
| } | ||
|
|
||
| return coverUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalize local event image paths
The new ticker reads coverUrl strings from data/event.json such as "./event/mockInterview.png", but resolveCoverUrl returns those values unchanged. next/image rejects non-remote sources that don’t start with /, so the first render will throw Invalid src prop (./event/mockInterview.png) and no image is displayed. Either the JSON should use absolute /event/... paths or the resolver needs to strip the ./ prefix before passing the value into Image.
Useful? React with 👍 / 👎.

实现了轮播我们的活动,会显示discord和回放按钮(如果活动还没结束则只会显示discord按钮);
轮播图没有体积,在手机上不会显示;
重要feature‼️ 为了方便Mira配置,设置了新的文件夹data:event.json,以后我们的配置类型的东西可以都放在这个文件夹里面,不看代码就可以直接修改配置。