Skip to content

Commit d6c3659

Browse files
authored
Merge pull request #175 from PNUops/feat/award-result-setting
feat: 프로젝트 별 수상 표시 설정 및 커스텀 정렬 지원
2 parents 02c91ff + 95fbeb2 commit d6c3659

18 files changed

Lines changed: 971 additions & 44 deletions

package-lock.json

Lines changed: 171 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@dnd-kit/utilities": "^3.2.2",
1616
"@radix-ui/react-label": "^2.1.7",
1717
"@radix-ui/react-popover": "^1.1.15",
18+
"@radix-ui/react-select": "^2.2.6",
1819
"@radix-ui/react-slot": "^1.2.3",
1920
"@radix-ui/react-tooltip": "^1.2.7",
2021
"@react-hookz/web": "^25.1.1",

src/apis/teams.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { TeamListItemResponseDto } from '../types/DTO/teams/teamListDto';
22
import { SubmissionStatusResponseDto } from '../types/DTO/teams/submissionStatusDto';
3+
import { PatchAwardRequestDto, PatchCustomOrderRequestDto } from 'types/DTO';
4+
35
import apiClient from './apiClient';
46
import { SortOption } from '@pages/admin/ProjectSortToggle';
57

@@ -44,3 +46,13 @@ export const getSortStatus = async (): Promise<SortOption> => {
4446
const res = await apiClient.get('/teams/sort');
4547
return res.data.currentMode as SortOption;
4648
};
49+
50+
export const patchTeamAward = async (teamId: number, payload: PatchAwardRequestDto) => {
51+
const res = await apiClient.patch(`admin/teams/${teamId}/award`, payload);
52+
return res.data;
53+
};
54+
55+
export const patchCustomSortTeam = async (contestId: number, payload: PatchCustomOrderRequestDto) => {
56+
const res = await apiClient.patch('/teams/sort/custom', payload);
57+
return res.data;
58+
};

src/components/AwardTag.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { FaAward } from 'react-icons/fa6';
2+
3+
interface AwardTagProps {
4+
awardName: string;
5+
awardColor: string;
6+
}
7+
8+
const AwardTag = ({ awardName, awardColor }: AwardTagProps) => {
9+
return (
10+
<span
11+
className="award-tag relative inline-flex max-w-full min-w-0 items-center justify-center overflow-hidden rounded-full border px-4 py-0.5 text-sm font-medium text-white"
12+
style={{
13+
backgroundColor: awardColor,
14+
borderColor: awardColor,
15+
boxShadow: `0 0 8px 2px ${awardColor}88, 0 0 24px 4px ${awardColor}44`,
16+
}}
17+
>
18+
<span className="award-shimmer" />
19+
<FaAward className="relative z-10 mr-1 shrink-0" />
20+
<span
21+
className="relative z-10 max-w-full min-w-0 truncate overflow-hidden text-ellipsis whitespace-nowrap"
22+
style={{ display: 'inline-block', minWidth: 0, maxWidth: '100%' }}
23+
>
24+
{awardName}
25+
</span>
26+
</span>
27+
);
28+
};
29+
30+
export default AwardTag;

0 commit comments

Comments
 (0)