Skip to content

Commit 7087c70

Browse files
committed
PROD-2643 #comment Wrong icon shown for bug hunt self-service
1 parent 1ba8b6b commit 7087c70

File tree

7 files changed

+74
-33
lines changed

7 files changed

+74
-33
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import '../styles/includes';
2+
3+
.iconWrapper {
4+
height: 48px;
5+
width: 48px;
6+
margin: 0 $space-lg $space-lg $space-lg;
7+
background: $tc-grad12;
8+
border-radius: 24px;
9+
display: flex;
10+
align-items: center;
11+
justify-content: center;
12+
13+
svg {
14+
@include icon-xl;
15+
color: $tc-white;
16+
}
17+
}
18+

src-ts/lib/icon-wrapper/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC } from 'react'
2+
import classNames from 'classnames'
3+
4+
import styles from './IconWrapper.module.scss'
5+
6+
interface IconWrapperProps {
7+
className?: string
8+
icon: JSX.Element
9+
}
10+
11+
const IconWrapper: FC<IconWrapperProps> = ({ className, icon }: IconWrapperProps) => (
12+
<div className={classNames(styles.iconWrapper, className)}>
13+
<>{icon}</>
14+
</div>
15+
)
16+
17+
export default IconWrapper

src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,10 @@ function getTypeCategory(type: WorkType): WorkTypeCategory {
694694
case WorkType.designLegacy:
695695
return WorkTypeCategory.design
696696

697-
// TOOD: other categories: qa and dev
697+
case WorkType.bugHunt:
698+
return WorkTypeCategory.qa
699+
700+
// TOOD: other categories: dev
698701
default:
699702
return WorkTypeCategory.unknown
700703
}

src-ts/tools/work/work-service-price/WorkServicePrice.module.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@
44

55
margin-top: $space-xl;
66

7-
.iconWrapper {
8-
height: 48;
9-
width: 48;
10-
margin: 0 $space-lg $space-lg $space-lg;
11-
background: $tc-grad12;
12-
border-radius: 24px;
13-
14-
svg {
15-
@include icon-xl;
16-
margin: $space-md;
17-
color: $tc-white;
18-
}
19-
}
20-
217
.inline {
228
display: flex;
239
flex-direction: row;

src-ts/tools/work/work-service-price/WorkServicePrice.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC } from 'react'
22

33
import { IconOutline, textFormatMoneyLocaleString, Tooltip } from '../../../lib'
4+
import IconWrapper from '../../../lib/icon-wrapper'
45

56
import styles from './WorkServicePrice.module.scss'
67

@@ -20,11 +21,9 @@ const ServicePrice: FC<WorkServicePriceProps> = (props: WorkServicePriceProps) =
2021
return (
2122
<div className={styles.container}>
2223
<div className={styles.inline}>
23-
<div className={styles.iconWrapper}>
24-
{!!showIcon && !!icon && (
25-
<>{icon}</>
26-
)}
27-
</div>
24+
{!!showIcon && !!icon && (
25+
<IconWrapper icon={icon} />
26+
)}
2827
<div>
2928
{!hideTitle && (
3029
<p><h3 className={styles.serviceTitle}>

src-ts/tools/work/work-table/work-table-title-renderer/WorkTableTitleRenderer.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,13 @@
2727
margin-top: 6px;
2828
@include text-clamp(3);
2929
}
30+
31+
.qa-icon {
32+
margin: 0px 12px 0px 0px;
33+
34+
svg {
35+
min-width: unset;
36+
margin: 0px;
37+
}
38+
}
3039
}

src-ts/tools/work/work-table/work-table-title-renderer/WorkTableTitleRenderer.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1-
import { FC, SVGProps } from 'react'
2-
1+
import { IconOutline } from '../../../../lib'
2+
import IconWrapper from '../../../../lib/icon-wrapper'
33
import {
4-
Work,
5-
WorkTypeCategory,
6-
WorkTypeCategoryDataIcon,
7-
WorkTypeCategoryDesignIcon,
8-
WorkTypeCategoryUnknownIcon,
4+
Work,
5+
WorkTypeCategory,
6+
WorkTypeCategoryDataIcon,
7+
WorkTypeCategoryDesignIcon,
8+
WorkTypeCategoryUnknownIcon,
99
} from '../../work-lib'
1010

1111
import styles from './WorkTableTitleRenderer.module.scss'
1212

1313
function WorkTableTitleRenderer(data: Work): JSX.Element {
1414

15-
let Icon: FC<SVGProps<SVGSVGElement>>
15+
let Icon: JSX.Element
1616
switch (data.typeCategory) {
1717

1818
case WorkTypeCategory.data:
19-
Icon = WorkTypeCategoryDataIcon
19+
Icon = <WorkTypeCategoryDataIcon />
2020
break
2121

2222
case WorkTypeCategory.design:
23-
Icon = WorkTypeCategoryDesignIcon
23+
Icon = <WorkTypeCategoryDesignIcon />
2424
break
2525

26-
// TODO: qa and dev work categories
26+
case WorkTypeCategory.qa:
27+
Icon = (
28+
<IconWrapper
29+
className={styles['qa-icon']}
30+
icon={<IconOutline.BadgeCheckIcon width={48} height={48} />}
31+
/>
32+
)
33+
break
34+
35+
// TODO: dev work categories
2736
default:
28-
Icon = WorkTypeCategoryUnknownIcon
37+
Icon = <WorkTypeCategoryUnknownIcon />
2938
break
3039
}
3140

3241
return (
3342
<div className={styles['work-table-title-container']}>
34-
<Icon />
43+
{Icon}
3544
<div className={styles['work-table-title']}>
3645
<div className={styles.title}>
3746
{data.title}

0 commit comments

Comments
 (0)