Skip to content

Commit 6ba998a

Browse files
authored
Merge pull request #522 from topcoder-platform/TCA-1024_fixes-on-cert-details
TCA-1024 fixes breadcrumbs on mobile & optimizes cert bg
2 parents 06f796f + 18b1e57 commit 6ba998a

File tree

11 files changed

+103
-10
lines changed

11 files changed

+103
-10
lines changed

src-ts/lib/breadcrumb/Breadcrumb.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
display: inline-flex;
3939
align-items: center;
4040
padding: 0;
41-
41+
@include ltesm {
42+
flex: 0 1 auto;
43+
&:first-child {
44+
flex: 1 0 auto;
45+
}
46+
}
4247
a {
4348
@extend .overline;
4449
display: block;

src-ts/tools/learn/learn-lib/tca-certificate-preview/tca-certificate/TCACertificate.module.scss

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
.wrap {
55
background-color: $tc-white;
66
height: 100%;
7+
position: relative;
8+
z-index: 1;
9+
}
10+
11+
.background {
12+
position: absolute;
13+
top: 0;
14+
left: 0;
15+
right: 0;
16+
bottom: 0;
17+
z-index: -1;
718
}
819

920
// TODO: add cross track theme
@@ -19,8 +30,6 @@
1930
}
2031

2132
&-dev {
22-
background-image: url('./assets/bg-dev.png');
23-
2433
.certTitle {
2534
color: $tc-dev-track-color;
2635
}
@@ -31,8 +40,6 @@
3140
}
3241

3342
&-datascience {
34-
background-image: url('./assets/bg-datascience.png');
35-
3643
.certTitle {
3744
color: $tc-datascience-track-color;
3845
}
@@ -43,8 +50,6 @@
4350
}
4451

4552
&-design {
46-
background-image: url('./assets/bg-design.png');
47-
4853
.certTitle {
4954
color: $tc-design-track-color;
5055
}
@@ -55,8 +60,6 @@
5560
}
5661

5762
&-qa {
58-
background-image: url('./assets/bg-qa.png');
59-
6063
.certTitle {
6164
color: $tc-qa-track-color;
6265
}

src-ts/tools/learn/learn-lib/tca-certificate-preview/tca-certificate/TCACertificate.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { TCACertificateType, TCACertification } from '../../data-providers'
99
import { CertificateBadgeIcon } from '../../dynamic-icons'
1010
import { DougSigSvg } from '../../svgs'
1111

12+
import { CertificateBackground } from './certificate-background'
1213
import styles from './TCACertificate.module.scss'
1314

1415
interface TCACertificateProps {
@@ -47,7 +48,8 @@ const TCACertificate: FC<TCACertificateProps> = (props: TCACertificateProps) =>
4748
className={classNames(styles.wrap, props.viewStyle)}
4849
ref={props.elRef}
4950
>
50-
<div className={classNames(styles.theme, styles[`theme-${certificateType.toLowerCase()}`])}>
51+
<div className={styles.theme}>
52+
<CertificateBackground className={styles.background} certType={certificateType} />
5153
<div className={classNames(styles.details)}>
5254
<div className={styles.headerWrap}>
5355
<CertificateBadgeIcon
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@import '../../../../../../lib/styles/includes';
2+
3+
.bg {
4+
path:global(#tca-cert-bg_grad-el) {
5+
fill: url(#tca-cert-bg--default);
6+
}
7+
&:global(.dev) {
8+
path:global(#tca-cert-bg_grad-el) {
9+
fill: url(#tca-cert-bg--dev);
10+
}
11+
}
12+
&:global(.datascience) {
13+
path:global(#tca-cert-bg_grad-el) {
14+
fill: url(#tca-cert-bg--datascience);
15+
}
16+
}
17+
&:global(.design) {
18+
path:global(#tca-cert-bg_grad-el) {
19+
fill: url(#tca-cert-bg--design);
20+
}
21+
}
22+
&:global(.qa) {
23+
path:global(#tca-cert-bg_grad-el) {
24+
fill: url(#tca-cert-bg--qa);
25+
}
26+
}
27+
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { FC } from 'react'
2+
import classNames from 'classnames'
3+
4+
import { TCACertificateType } from '../../../data-providers'
5+
6+
import { ReactComponent as BackgroundSvg } from './certificate-bg.svg'
7+
import styles from './CertificateBackground.module.scss'
8+
9+
interface CertificateBackgroundProps {
10+
className?: string
11+
certType: TCACertificateType
12+
}
13+
14+
const CertificateBackground: FC<CertificateBackgroundProps> = (props: CertificateBackgroundProps) => (
15+
<BackgroundSvg
16+
className={classNames(props.className, styles.bg, (props.certType ?? '').toLowerCase())}
17+
/>
18+
)
19+
20+
export default CertificateBackground
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as CertificateBackground } from './CertificateBackground'

0 commit comments

Comments
 (0)