Skip to content

Commit 86575bb

Browse files
authored
Merge pull request #1113 from topcoder-platform/pm-1310
fix(PM-1310): show types propertly in opportunity details page
2 parents 26ee3b3 + a3c16e3 commit 86575bb

File tree

1 file changed

+21
-1
lines changed
  • src/apps/copilots/src/pages/copilot-opportunity-details

1 file changed

+21
-1
lines changed

src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
} from '../../services/copilot-opportunities'
3636
import { FormattedMembers, useMembers } from '../../services/members'
3737
import { copilotRoutesMap } from '../../copilots.routes'
38+
import { ProjectType } from '../../constants'
3839

3940
import { ApplyOpportunityModal } from './apply-opportunity-modal'
4041
import {
@@ -126,6 +127,21 @@ const CopilotOpportunityDetails: FC<{}> = () => {
126127

127128
const application = copilotApplications && copilotApplications[0]
128129

130+
const getOpportunityType = (type: string): ProjectType => {
131+
switch (type) {
132+
case 'ai':
133+
return ProjectType.ai
134+
case 'datascience':
135+
return ProjectType.datascience
136+
case 'dev':
137+
return ProjectType.developement
138+
case 'design':
139+
return ProjectType.design
140+
default:
141+
return ProjectType.qa
142+
}
143+
}
144+
129145
return (
130146
<ContentLayout
131147
title='Copilot Opportunity'
@@ -203,7 +219,11 @@ const CopilotOpportunityDetails: FC<{}> = () => {
203219
<IconOutline.CogIcon className={styles.icon} />
204220
<div className={styles.infoText}>
205221
<span className={styles.infoHeading}>Type</span>
206-
<span className={styles.infoValue}>{opportunity?.type}</span>
222+
<span
223+
className={styles.infoValue}
224+
>
225+
{opportunity?.type && getOpportunityType(opportunity?.type)}
226+
</span>
207227
</div>
208228
</div>
209229
<div className={styles.infoColumn}>

0 commit comments

Comments
 (0)