Skip to content

Commit f1dc670

Browse files
committed
KTL-1241 fix: eliminated eslint&typescipt errors, formatted code
1 parent 95e7b11 commit f1dc670

File tree

86 files changed

+3149
-2805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3149
-2805
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.br {
2-
@media (--ktl-mm) {
3-
display: none;
4-
}
2+
@media (--ktl-mm) {
3+
display: none;
4+
}
55
}

src/components/ContactUs/index.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
import { CtaBlock } from "@jetbrains/kotlin-web-site-ui/out/components/cta-block-v2";
1+
import { CtaBlock } from '@jetbrains/kotlin-web-site-ui/out/components/cta-block-v2';
22

3-
import {Link} from "../Link";
3+
import { Link } from '../Link';
44

5-
import * as styles from "./contactUs.module.css";
5+
import * as styles from './contactUs.module.css';
66

77
const contactEmail = '[email protected]';
88

99
export function ContactUs() {
10-
return (
11-
<CtaBlock
12-
topTitle={<>Still have questions? <br className={styles.br}/>Contact us!</>}
13-
classMainTitle="ktf-h2 ktf-h3--ts"
14-
mainTitle={
15-
<Link href={`mailto:${contactEmail}`} mode="clear">
16-
{contactEmail}
17-
</Link>
18-
}
19-
/>
20-
);
10+
return (
11+
<CtaBlock
12+
topTitle={
13+
<>
14+
Still have questions? <br className={styles.br} />
15+
Contact us!
16+
</>
17+
}
18+
classMainTitle="ktf-h2 ktf-h3--ts"
19+
mainTitle={
20+
<Link href={`mailto:${contactEmail}`} mode="clear">
21+
{contactEmail}
22+
</Link>
23+
}
24+
/>
25+
);
2126
}

src/components/FAQ/faq.module.css

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
.faq {
2-
padding-left: 0;
3-
padding-right: 0;
2+
padding-left: 0;
3+
padding-right: 0;
44

5-
margin-left: 0;
6-
margin-right: 0;
5+
margin-left: 0;
6+
margin-right: 0;
77
}
88

99
@media (--ktl-tl-min) {
10-
.faq {
11-
display: grid;
12-
grid-template-columns: 4fr 7fr;
13-
gap: var(--ktl-box-section-m);
14-
}
10+
.faq {
11+
display: grid;
12+
grid-template-columns: 4fr 7fr;
13+
gap: var(--ktl-box-section-m);
14+
}
1515

16-
.question, .answer {
17-
margin-bottom: 0;
18-
}
16+
.question,
17+
.answer {
18+
margin-bottom: 0;
19+
}
1920

20-
.question {
21-
padding-right: var(--ktl-box-block-l);
22-
}
21+
.question {
22+
padding-right: var(--ktl-box-block-l);
23+
}
2324
}

src/components/FAQ/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import {HTMLAttributes} from "react";
2-
import {useTextStyles} from "@jetbrains/kotlin-web-site-ui/out/components/typography";
3-
import {cls} from "../../utlis";
1+
import { useTextStyles } from '@jetbrains/kotlin-web-site-ui/out/components/typography';
2+
import { HTMLAttributes } from 'react';
3+
import { cls } from '../../utlis';
44

5-
import * as style from "./faq.module.css";
5+
import * as style from './faq.module.css';
66

77
export function Question(props: HTMLAttributes<HTMLDListElement>) {
8-
return <dt {...cls(props, style.question, 'ktl-h3 ktl-offset-bottom-s')}/>;
8+
return <dt {...cls(props, style.question, 'ktl-h3 ktl-offset-bottom-s')} />;
99
}
1010

1111
export function Answer(props: HTMLAttributes<HTMLDListElement>) {
12-
const textCn = useTextStyles();
13-
return <dd {...cls(props, style.answer, textCn('ktl-text-1'), 'ktl-offset-bottom-l')}/>;
12+
const textCn = useTextStyles();
13+
return <dd {...cls(props, style.answer, textCn('ktl-text-1'), 'ktl-offset-bottom-l')} />;
1414
}
1515

1616
export function FAQ(props: HTMLAttributes<HTMLDListElement>) {
17-
return <dl {...cls(props, style.faq)}/>;
17+
return <dl {...cls(props, style.faq)} />;
1818
}
Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,85 @@
11
.outer {
2-
background: var(--ktf-bg-dark);
3-
padding: var(--ktl-box-section-l) 0;
2+
background: var(--ktf-bg-dark);
3+
padding: var(--ktl-box-section-l) 0;
44

5-
@media (--ktl-mm) {
6-
padding-bottom: var(--ktl-box-section-s);
7-
}
5+
@media (--ktl-mm) {
6+
padding-bottom: var(--ktl-box-section-s);
7+
}
88
}
99

1010
.footer {
11-
display: flex;
12-
margin-top: calc(-1 * var(--ktl-box-section-l));
11+
display: flex;
12+
margin-top: calc(-1 * var(--ktl-box-section-l));
1313
}
1414

1515
.nav {
16-
list-style: none;
17-
margin: 0;
18-
padding: 0;
16+
list-style: none;
17+
margin: 0;
18+
padding: 0;
1919
}
2020

21-
.nav, .support {
22-
margin-top: var(--ktl-box-section-l);
21+
.nav,
22+
.support {
23+
margin-top: var(--ktl-box-section-l);
2324
}
2425

2526
@media (--ktl-tl-min) {
26-
.footer {
27-
flex-wrap: wrap;
28-
align-items: center;
29-
justify-content: space-between;
30-
}
31-
32-
.nav {
33-
display: flex;
34-
}
35-
36-
.nav-item {
37-
display: flex;
38-
align-items: center;
39-
}
40-
41-
.nav-item::after {
42-
display: inline-block;
43-
content: '';
44-
background: rgba(255, 255, 255, 0.3);
45-
height: 1.5em;
46-
margin: 0 1ex;
47-
width: 1px;
48-
}
49-
50-
.nav-item:last-of-type::after {
51-
display: none;
52-
}
27+
.footer {
28+
flex-wrap: wrap;
29+
align-items: center;
30+
justify-content: space-between;
31+
}
32+
33+
.nav {
34+
display: flex;
35+
}
36+
37+
.navItem {
38+
display: flex;
39+
align-items: center;
40+
}
41+
42+
.navItem:after {
43+
display: inline-block;
44+
content: '';
45+
background: rgba(255, 255, 255, 0.3);
46+
height: 1.5em;
47+
margin: 0 1ex;
48+
width: 1px;
49+
}
50+
51+
.navItem:last-of-type:after {
52+
display: none;
53+
}
5354
}
5455

5556
@media (--ktl-tl) {
56-
.footer {
57-
flex-direction: column;
58-
}
57+
.footer {
58+
flex-direction: column;
59+
}
5960

60-
.nav-item {
61-
margin-top: var(--ktl-box-block-l);
62-
}
61+
.navItem {
62+
margin-top: var(--ktl-box-block-l);
63+
}
6364

64-
.nav-item:first-of-type {
65-
margin-top: 0;
66-
}
65+
.navItem:first-of-type {
66+
margin-top: 0;
67+
}
6768
}
6869

6970
.support {
70-
margin-left: auto;
71+
margin-left: auto;
7172

72-
display: flex;
73-
align-items: center;
73+
display: flex;
74+
align-items: center;
7475
}
7576

76-
.support-label {
77-
margin: 0 var(--ktl-box-block-m) 0 0;
78-
text-align: right;
77+
.supportLabel {
78+
margin: 0 var(--ktl-box-block-m) 0 0;
79+
text-align: right;
7980
}
8081

81-
.support-link {
82-
font-size: 0;
83-
line-height: 0;
84-
}
82+
.supportLink {
83+
font-size: 0;
84+
line-height: 0;
85+
}

src/components/Footer/index.tsx

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,54 @@
1-
import cn from "classnames";
1+
import { useTextStyles } from '@jetbrains/kotlin-web-site-ui/out/components/typography';
22
import { ThemeProvider } from '@rescui/ui-contexts';
3-
import {useTextStyles} from "@jetbrains/kotlin-web-site-ui/out/components/typography";
3+
import cn from 'classnames';
4+
import svgLogo from '../../images/jb.svg';
5+
import { Link } from '../Link';
46

5-
import {Link} from "../Link";
6-
import svgLogo from "../../images/jb.svg";
7-
8-
import * as styles from "./footer.module.css";
7+
import * as styles from './footer.module.css';
98

109
const FOOTER_LINKS = [
11-
{ name: 'Language committee guidelines', url: '/language-committee-guidelines/'},
12-
{ name: 'Submitting incompatible changes', url: '/submitting-incompatible-changes/'},
13-
{ name: 'Brand usage', url: '/guidelines/'},
14-
{ name: 'Kotlin website', url: 'https://kotlinlang.org'},
10+
{ name: 'Language committee guidelines', url: '/language-committee-guidelines/' },
11+
{ name: 'Submitting incompatible changes', url: '/submitting-incompatible-changes/' },
12+
{ name: 'Brand usage', url: '/guidelines/' },
13+
{ name: 'Kotlin website', url: 'https://kotlinlang.org' },
1514
];
1615

1716
const FooterMarkup = () => {
18-
const textCn = useTextStyles();
19-
return (
20-
<footer className={styles.outer}>
21-
<div className={cn('ktl-layout ktl-layout--center', styles.footer)}>
22-
<ul className={cn(styles.nav, textCn('ktl-text-2'))}>
23-
{FOOTER_LINKS.map(({name, url}) => (
24-
<li key={name} className={styles.navItem}>
25-
<Link mode="clear" external={false} href={url} hardness="average">{name}</Link>
26-
</li>
27-
))}
28-
</ul>
29-
<div className={cn(textCn('ktl-text-3'), styles.support)}>
30-
<p className={styles.supportLabel}>Supported and developed<br/>by JetBrains</p>
31-
<a className={styles.supportLink} href="https://jetbrains.com" target="_blank" rel="noreferrer noopener">
32-
<img alt="JetBrains Logo" src={svgLogo}/>
33-
</a>
34-
</div>
35-
</div>
36-
</footer>
37-
);
17+
const textCn = useTextStyles();
18+
return (
19+
<footer className={styles.outer}>
20+
<div className={cn('ktl-layout ktl-layout--center', styles.footer)}>
21+
<ul className={cn(styles.nav, textCn('ktl-text-2'))}>
22+
{FOOTER_LINKS.map(({ name, url }) => (
23+
<li key={name} className={styles.navItem}>
24+
<Link mode="clear" external={false} href={url} hardness="average">
25+
{name}
26+
</Link>
27+
</li>
28+
))}
29+
</ul>
30+
<div className={cn(textCn('ktl-text-3'), styles.support)}>
31+
<p className={styles.supportLabel}>
32+
Supported and developed
33+
<br />
34+
by JetBrains
35+
</p>
36+
<a className={styles.supportLink} href="https://jetbrains.com" target="_blank" rel="noreferrer noopener">
37+
<img alt="JetBrains Logo" src={svgLogo} />
38+
</a>
39+
</div>
40+
</div>
41+
</footer>
42+
);
3843
};
3944

4045
export function Footer() {
41-
return (
42-
<ThemeProvider theme="dark">
43-
<FooterMarkup/>
44-
</ThemeProvider>
45-
)
46+
return (
47+
// this ignore is needed because we can't modify ThemeProvider props and declare `children` prop explicitly as required in react 18
48+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
49+
// @ts-ignore
50+
<ThemeProvider theme="dark">
51+
<FooterMarkup />
52+
</ThemeProvider>
53+
);
4654
}

0 commit comments

Comments
 (0)