forked from JetBrains/kotlin-web-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
247 lines (214 loc) · 9.77 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
import React, { useEffect } from 'react';
import Link from 'next/link';
import { ThemeProvider } from '@rescui/ui-contexts';
import { ArrowTopRightIcon } from '@rescui/icons';
import { Button } from '@rescui/button';
import { useTS } from '@jetbrains/kotlin-web-site-ui/out/components/breakpoints';
import '@jetbrains/kotlin-web-site-ui/out/components/layout';
import GlobalHeader from '@jetbrains/kotlin-web-site-ui/out/components/header';
import { CtaBlock } from '@jetbrains/kotlin-web-site-ui/out/components/cta-block-v2';
import YoutubePlayer from '@jetbrains/kotlin-web-site-ui/out/components/youtube-player';
import GlobalFooter from '@jetbrains/kotlin-web-site-ui/out/components/footer';
import { Layout } from '../components/layout/layout';
import { HeroSection } from '../blocks/main/hero/hero';
import { LatestNews } from '../blocks/main/latest-news';
import { KotlinUsageHighlights } from '../blocks/main/kotlin-usage-highlights/kotlin-usage-highlights';
import { InfoBlock } from '../blocks/main/info-block/info-block';
import { DividerLine } from '../blocks/main/divider-line/divider-line';
import { FoundationPreview } from '../blocks/main/foundation-preview/foundation-preview';
import { WhyKotlin } from '../blocks/main/why-kotlin/why-kotlin';
import { StickyHeader } from '../components/sticky-header/sticky-header';
import MultiplatformPreviewImage from '../public/images/main/multiplatform-preview.svg';
import GradleLogo from '../public/images/companies/gradle.svg';
import CordaLogo from '../public/images/companies/corda.svg';
import EvernoteLogo from '../public/images/companies/evernote.svg';
import CourseraLogo from '../public/images/companies/coursera.svg';
import SpringLogo from '../public/images/companies/spring.svg';
import AtlassianLogo from '../public/images/companies/atlassian.svg';
import GoogleLogo from '../public/images/companies/google.svg';
import JetbrainsLogo from '../public/images/companies/jetbrains.svg';
import ShopifyLogo from '../public/images/companies/shopify.svg';
import TouchlabLogo from '../public/images/companies/touchlab.svg';
import styles from './index.module.css';
import searchConfig from '../search-config.json';
import releasesDataRaw from '../data/releases.yml';
const releasesData: ReleasesData = releasesDataRaw as ReleasesData;
const kotlinUsageHighlightsCases = [
{
company: 'Gradle',
url: 'https://blog.gradle.org/kotlin-meets-gradle',
text: 'Gradle is introducing Kotlin as a language for writing build scripts',
logo: GradleLogo,
},
{
company: 'Corda',
url: 'https://www.corda.net/2017/01/10/kotlin/',
text: 'Corda is an open-source distributed ledger platform, supported by major banks, and built entirely in Kotlin',
logo: CordaLogo,
},
{
company: 'Evernote',
url: 'https://blog.evernote.com/tech/2017/01/26/android-state-library/',
text: 'Evernote recently integrated Kotlin into their Android client',
logo: EvernoteLogo,
},
{
company: 'Coursera',
url: 'https://building.coursera.org/blog/2016/03/16/becoming-bilingual-coursera/',
text: 'Coursera Android app is partially written in Kotlin',
logo: CourseraLogo,
},
{
company: 'Spring',
url: 'https://spring.io/blog/2017/01/04/introducing-kotlin-support-in-spring-framework-5-0',
text: "Spring makes use of Kotlin's language features to offer more concise APIs",
logo: SpringLogo,
},
{
company: 'Atlassian',
url: 'https://twitter.com/danlew42/status/809065097339564032',
text: 'All new code in the Trello Android app is in Kotlin',
logo: AtlassianLogo,
},
];
const kotlinFoundationCompanies = [
{
name: 'JetBrains',
logo: JetbrainsLogo,
link: 'https://www.jetbrains.com/',
},
{
name: 'Google',
logo: GoogleLogo,
link: 'https://about.google/',
},
{
name: 'Gradle',
logo: GradleLogo,
link: 'https://gradle.org/',
},
{
name: 'Shopify',
logo: ShopifyLogo,
link: 'https://shopify.engineering/',
},
{
name: 'Touchlab',
logo: TouchlabLogo,
link: 'https://touchlab.co/',
},
];
export async function getStaticProps() {
return { props: { isDarkTheme: true } };
}
function Index() {
const isTS = useTS();
return (
<Layout
title={'Kotlin Programming Language'}
ogImageName={'general.png'}
description={
'Kotlin is a programming language that makes coding concise, cross-platform, and fun. It is Google’s preferred language for Android app development.'
}
>
<ThemeProvider theme="dark">
<StickyHeader>
<GlobalHeader
productWebUrl={releasesData.latest.url}
hasSearch={true}
searchConfig={searchConfig}
darkHeader
></GlobalHeader>
</StickyHeader>
<HeroSection title={'Kotlin'}>
Concise. Multiplatform. Fun.
</HeroSection>
<div className={'ktl-layout ktl-layout--center'}>
<LatestNews />
</div>
<WhyKotlin />
</ThemeProvider>
<ThemeProvider theme="light">
<div className={styles.evenSection}>
<div className={'ktl-layout ktl-layout--center'}>
<InfoBlock
title={<>Share code on your terms and for different platforms</>}
text={
<>
Simplify the development of cross-platform projects with Kotlin Multiplatform. It
reduces time spent writing and maintaining the same code for different platforms
while retaining the flexibility and benefits of native programming. Kotlin
applications will work on different operating systems, such as iOS, Android, macOS,
Windows, Linux, watchOS, and others.
</>
}
button={
<Button href="/lp/multiplatform/" size="l" mode="rock" theme="light">
{isTS ? 'Learn more' : 'Learn about Kotlin Multiplatform'}
</Button>
}
media={<img src={MultiplatformPreviewImage.src} alt="" />}
/>
<DividerLine />
<InfoBlock
title={'Big, friendly and helpful community'}
text={
<>
Kotlin has great support and many contributors in its fast-growing global community.
Enjoy the benefits of a rich ecosystem with a wide range of community libraries.
Help is never far away — consult extensive community resources or ask the Kotlin
team directly.
</>
}
button={
<Link href={'community'}>
<Button size="l" mode="rock" theme="light">
Join the community
</Button>
</Link>
}
media={
<div className={styles.videoWrapper}>
<YoutubePlayer playButtonMode={3} id="JGvk4M0Rfxo" className={styles.videoPlayer} />
</div>
}
/>
<DividerLine />
<FoundationPreview
title={'Kotlin Foundation'}
description={'Actively supports community efforts in developing the Kotlin ecosystem.'}
button={
<Button
href="https://kotlinfoundation.org/"
size="l"
mode="rock"
theme="light"
icon={<ArrowTopRightIcon />}
iconPosition="right"
>
Learn more
</Button>
}
companies={kotlinFoundationCompanies}
/>
{/*<DividerLine />*/}
{/*<KotlinUsageHighlights title="Kotlin usage highlights" items={kotlinUsageHighlightsCases} />*/}
</div>
<CtaBlock
className={styles.ctaBlock}
mainTitle={<>Start using{isTS && <br />} Kotlin today!</>}
buttons={
<Button href="/docs/getting-started.html" size="l" mode="rock" theme="light">
Get started
</Button>
}
/>
</div>
</ThemeProvider>
<ThemeProvider theme={'dark'}>
<GlobalFooter />
</ThemeProvider>
</Layout>
);
}
export default Index;