Skip to content

Commit 9544644

Browse files
Merge pull request #4854 from cagdas001/fix-4755
fix(submission-management): missing `Add Submission` button
2 parents 97e3f1a + 3fecfcf commit 9544644

File tree

1 file changed

+4
-1
lines changed
  • src/shared/components/SubmissionManagement/SubmissionManagement

1 file changed

+4
-1
lines changed

src/shared/components/SubmissionManagement/SubmissionManagement/index.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import React from 'react';
1919
import PT from 'prop-types';
2020
import moment from 'moment';
2121
import { PrimaryButton } from 'topcoder-react-ui-kit';
22+
import { phaseEndDate } from 'utils/challenge-listing/helper';
2223
import SubmissionsTable from '../SubmissionsTable';
2324

2425
import style from './styles.scss';
@@ -47,6 +48,8 @@ export default function SubmissionManagement(props) {
4748
const currentPhase = challenge.phases
4849
.filter(p => p.name !== 'Registration' && p.isOpen)
4950
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
51+
const submissionPhase = challenge.phases.filter(p => p.name === 'Submission')[0];
52+
const submissionEndDate = submissionPhase && phaseEndDate(submissionPhase);
5053

5154
const now = moment();
5255
const end = moment(currentPhase.scheduledEndDate);
@@ -159,7 +162,7 @@ export default function SubmissionManagement(props) {
159162
)
160163
}
161164
</div>
162-
{now.isBefore(challenge.submissionEndDate) && (
165+
{now.isBefore(submissionEndDate) && (
163166
<div styleName="btn-wrap">
164167
<PrimaryButton
165168
theme={{

0 commit comments

Comments
 (0)