Skip to content

Commit a3c16e3

Browse files
committed
fix: show types propertly in opportunity details page
1 parent 70c8f4a commit a3c16e3

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 {
@@ -127,6 +128,21 @@ const CopilotOpportunityDetails: FC<{}> = () => {
127128
const application = copilotApplications && copilotApplications[0]
128129
const isAlreadyMemberOfTheProject = profile && opportunity?.members?.includes(profile.userId)
129130

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

0 commit comments

Comments
 (0)