Skip to content

Commit 1712def

Browse files
committed
fixes wide certificates view
1 parent d528f3c commit 1712def

File tree

4 files changed

+46
-15
lines changed

4 files changed

+46
-15
lines changed

src-ts/tools/learn/course-certificate/certificate-view/CertificateView.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
&:global(.large-container) {
5353
aspect-ratio: unset;
5454
@include socialPreviewImg;
55+
max-width: none;
5556
}
5657

5758
body:global(.canvas-clone) & {
@@ -75,6 +76,11 @@
7576
left: 0;
7677
width: 100%;
7778
}
79+
80+
.certificate-wrap:global(.large-container) & {
81+
width: 100%;
82+
height: 100%;
83+
}
7884
}
7985

8086
.share-btn:global(.button.icon) {

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
flex: 1 1 auto;
33
aspect-ratio: 1.25715;
44
position: relative;
5-
5+
66
body:global(.canvas-clone) & {
77
transform: none!important;
88
}
@@ -21,3 +21,22 @@
2121
left: 0;
2222
}
2323
}
24+
25+
26+
:global(.large-container) {
27+
.wrap {
28+
aspect-ratio: unset;
29+
width: 100%;
30+
height: 100%;
31+
transform: none!important;
32+
}
33+
34+
.inner {
35+
position: static;
36+
width: 100%;
37+
height: 100%;
38+
> * {
39+
position: relative;
40+
}
41+
}
42+
}

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
display: flex;
1212
height: 100%;
1313
color: $black-100;
14+
background-repeat: no-repeat;
15+
background-size: cover;
16+
17+
:global(.large-container) & {
18+
background-size: 100% 100%;
19+
}
1420

1521
&-dev {
16-
background: url('./assets/bg-dev.png') no-repeat;
17-
background-size: cover;
22+
background-image: url('./assets/bg-dev.png');
1823

1924
.certTitle {
2025
color: $tc-dev-track-color;
@@ -26,8 +31,7 @@
2631
}
2732

2833
&-datascience {
29-
background: url('./assets/bg-datascience.png') no-repeat;
30-
background-size: cover;
34+
background-image: url('./assets/bg-datascience.png');
3135

3236
.certTitle {
3337
color: $tc-datascience-track-color;
@@ -39,8 +43,7 @@
3943
}
4044

4145
&-design {
42-
background: url('./assets/bg-design.png') no-repeat;
43-
background-size: cover;
46+
background-image: url('./assets/bg-design.png');
4447

4548
.certTitle {
4649
color: $tc-design-track-color;
@@ -52,8 +55,7 @@
5255
}
5356

5457
&-qa {
55-
background: url('./assets/bg-qa.png') no-repeat;
56-
background-size: cover;
58+
background-image: url('./assets/bg-qa.png');
5759

5860
.certTitle {
5961
color: $tc-qa-track-color;

src-ts/tools/learn/tca-certificate/user-certificate/UserTCACertificate.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ const UserTCACertificate: FC<{}> = () => {
2525
const [profileReady, setProfileReady]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
2626

2727
const certificationParam: string = routeParams.certification ?? ''
28-
2928
const tcaCertificationPath: string = getTCACertificationPath(certificationParam)
3029

30+
function hideSiblings(el: HTMLElement): void {
31+
[].forEach.call(el.parentElement?.children ?? [], (c: HTMLElement) => {
32+
if (c !== el) {
33+
Object.assign(c.style, { display: 'none' })
34+
}
35+
})
36+
}
37+
3138
useEffect(() => {
3239
if (routeParams.memberHandle) {
3340
profileGetPublicAsync(routeParams.memberHandle)
@@ -44,11 +51,8 @@ const UserTCACertificate: FC<{}> = () => {
4451
return
4552
}
4653

47-
[].forEach.call(el.parentElement?.children ?? [], (c: HTMLElement) => {
48-
if (c !== el) {
49-
Object.assign(c.style, { display: 'none' })
50-
}
51-
})
54+
hideSiblings(el)
55+
hideSiblings(el.parentElement as HTMLElement)
5256
el.classList.add(styles['full-screen-cert'])
5357
})
5458

0 commit comments

Comments
 (0)