Skip to content

Commit 7f9e1ca

Browse files
committed
improvement(reskin): mm submissions
1 parent dfb002e commit 7f9e1ca

File tree

13 files changed

+957
-415
lines changed

13 files changed

+957
-415
lines changed
Lines changed: 3 additions & 0 deletions
Loading

src/shared/components/challenge-detail/Header/TabSelector/index.jsx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,53 @@ export default function ChallengeViewSelector(props) {
7373
{ field: 'Submitted Date', sort: 'asc', name: 'Submitted Date: Old to New' },
7474
];
7575

76+
const MarathonSortOptions = [
77+
{ field: 'Final Rank', sort: 'desc', name: 'Final Rank: High to Low' },
78+
{ field: 'Final Rank', sort: 'asc', name: 'Final Rank: Low to High' },
79+
{ field: 'Provisional Rank', sort: 'desc', name: 'Provisional Rank: High to Low' },
80+
{ field: 'Provisional Rank', sort: 'asc', name: 'Provisional Rank: Low to High' },
81+
{ field: 'Rating', sort: 'desc', name: 'Rating: High to Low' },
82+
{ field: 'Rating', sort: 'asc', name: 'Rating: Low to High' },
83+
{ field: 'Username', sort: 'asc', name: 'Username' },
84+
{ field: 'Final Score', sort: 'desc', name: 'Final Score: High to Low' },
85+
{ field: 'Final Score', sort: 'asc', name: 'Final Score: Low to High' },
86+
{ field: 'Provisional Score', sort: 'desc', name: 'Provisional Score: High to Low' },
87+
{ field: 'Provisional Score', sort: 'asc', name: 'Provisional Score: Low to High' },
88+
{ field: 'Submission Date', sort: 'desc', name: 'Submission Date: New to Old' },
89+
{ field: 'Submission Date', sort: 'asc', name: 'Submission Date: Old to New' },
90+
];
91+
92+
const MySubmissionsSortOptions = [
93+
{ field: 'Submission ID', sort: 'desc', name: 'Submission ID: High to Low' },
94+
{ field: 'Submission ID', sort: 'asc', name: 'Submission ID: Low to High' },
95+
{ field: 'Status', sort: 'desc', name: 'Status: High to Low' },
96+
{ field: 'Status', sort: 'asc', name: 'Status: Low to High' },
97+
{ field: 'Final', sort: 'desc', name: 'Final Score: High to Low' },
98+
{ field: 'Final', sort: 'asc', name: 'Final Score: Low to High' },
99+
{ field: 'Provision', sort: 'desc', name: 'Provisional Score: High to Low' },
100+
{ field: 'Provision', sort: 'asc', name: 'Provisional Score: Low to High' },
101+
{ field: 'Time', sort: 'desc', name: 'Time: New to Old' },
102+
{ field: 'Time', sort: 'asc', name: 'Time: Old to New' },
103+
];
104+
76105
if (isF2F || isBugHunt) {
77106
SubmissionSortOptions = SubmissionSortOptions.slice(2);
78107
}
79108

109+
if (isMM) {
110+
SubmissionSortOptions = MarathonSortOptions;
111+
}
112+
80113
if (isDesign) {
81114
RegistrationSortOptions = RegistrationSortOptions.slice(2);
82115
}
83116

84-
const sortOptions = currentSelected === 'submissions' ? SubmissionSortOptions : RegistrationSortOptions;
117+
let sortOptions = currentSelected === DETAIL_TABS.SUBMISSIONS
118+
? SubmissionSortOptions : RegistrationSortOptions;
119+
120+
if (currentSelected === DETAIL_TABS.MY_SUBMISSIONS) {
121+
sortOptions = MySubmissionsSortOptions;
122+
}
85123

86124
const numOfSub = numOfSubmissions + (numOfCheckpointSubmissions || 0);
87125
const forumId = _.get(challenge, 'legacy.forumId') || 0;
@@ -277,8 +315,10 @@ export default function ChallengeViewSelector(props) {
277315
</React.Fragment>
278316
);
279317

280-
const isSubmissionTabSelected = (isDesign && !(challenge.submissionViewable === 'true')) ? currentSelected === 'registrants'
281-
: currentSelected === 'submissions' || currentSelected === 'registrants';
318+
const isSubmissionTabSelected = (isDesign && !(challenge.submissionViewable === 'true')) ? currentSelected === DETAIL_TABS.REGISTRANTS
319+
: currentSelected === DETAIL_TABS.SUBMISSIONS
320+
|| currentSelected === DETAIL_TABS.REGISTRANTS
321+
|| currentSelected === DETAIL_TABS.MY_SUBMISSIONS;
282322

283323
return (
284324
<div

src/shared/components/challenge-detail/Header/TabSelector/style.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
position: relative;
137137
padding-bottom: 10px;
138138
border-bottom: silver solid 1px;
139+
gap: 16px;
139140

140141
@include xs-to-sm {
141142
flex-wrap: nowrap;
@@ -149,7 +150,7 @@
149150
font-weight: 700;
150151
line-height: 20px;
151152
font-size: 14px;
152-
margin: 10px 20px 0;
153+
margin: 10px 10px 0;
153154
cursor: pointer;
154155
white-space: nowrap;
155156
position: relative;

0 commit comments

Comments
 (0)