fix: data display for volunteers#43
fix: data display for volunteers#43Nliver merged 1 commit intokaiyuanshe:mainfrom Nliver:feat-update-info
Conversation
annual outstanding volunteers and COSCon stars
There was a problem hiding this comment.
Pull request overview
This pull request aims to fix data display issues for annual outstanding volunteers and COSCon stars by updating default selected years and adding new volunteer data for 2025.
Changes:
- Updated default selected year from '2023' to '2025' in COSCon stars and cooperation pages
- Added 12 new volunteer entries with 2025 award dates
- Added 2025 cooperation stars data to the yearly array
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/pages/community/coscon/index.tsx | Updated default selected year to '2025' to display most recent COSCon stars |
| src/pages/community/cooperation/index.tsx | Updated default year to '2025' and added 2025 cooperation stars to yearlyStars array |
| src/data/volunteers.ts | Added 12 new annual outstanding volunteer entries for 2025 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| export default function CooperationPage() { | ||
| const [selectedYear, setSelectedYear] = useState('2023') | ||
| const [selectedYear, setSelectedYear] = useState('2025') |
There was a problem hiding this comment.
The selectedYear is initialized to '2025', but due to the bug in line 108 where year '2025' data is incorrectly labeled as '2023', this year won't exist in uniqueYears and the selectedStars fallback logic will incorrectly default to cooperationStars2023 instead of showing the 2025 data. This needs to be coordinated with fixing line 108.
| ] | ||
|
|
||
| const yearlyStars = [ | ||
| { year: '2023', stars: cooperationStars2025 }, |
There was a problem hiding this comment.
There are now two entries in the yearlyStars array with year '2023'. Line 108 should have year '2025' to avoid duplicate year entries. This will cause issues with year selection logic since uniqueYears will contain duplicate '2023' entries and year '2025' will not be selectable despite having data.
| { year: '2023', stars: cooperationStars2025 }, | |
| { year: '2025', stars: cooperationStars2025 }, |
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '丁欣', | ||
| nickname: '小丁', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '刘天栋', | ||
| nickname: 'Ted', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '刘智杰', | ||
| nickname: '小符', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '廖敬仪', | ||
| nickname: '', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '李佳欣', | ||
| nickname: '', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '李思颖', | ||
| nickname: 'Mable', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '李楠', | ||
| nickname: '楠楠', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '段延星', | ||
| nickname: '', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '王勇杰', | ||
| nickname: '大黄', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '臧鹏', | ||
| nickname: '大鹏', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, | ||
| { | ||
| name: '赵文涵', | ||
| nickname: '文涵', | ||
| avatar: '/img//cblecker.png', | ||
| awardDate: '2025-12-06', | ||
| recommendation: | ||
| '年度优秀志愿者' | ||
| }, |
There was a problem hiding this comment.
All new volunteer entries have double slashes in the avatar path '/img//cblecker.png'. This should be '/img/cblecker.png' with a single slash to match the pattern used in existing volunteer entries.
fix: data display for annual outstanding volunteers and COSCon stars