-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.tsx
78 lines (70 loc) · 2.28 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
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import Layout from '@theme/Layout';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import Translate, { translate } from '@docusaurus/Translate';
import config from '@generated/docusaurus.config';
import styles from './index.module.css';
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
const [ver, setVer] = useState('latest');
useEffect(() => {
fetch(
'https://raw.githubusercontent.com/kubenetworks/kubevpn/master/plugins/stable.txt',
)
.then(res => res.ok ? res.text() : undefined)
.then(ver => ver && setVer(ver));
}, []);
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<img
style={{ width: 300, height: 100, objectFit: 'cover' }}
src={require('@site/static/img/logo.jpeg').default}
/>
<p className="hero__subtitle">
<Translate>Cloud Native Dev Environment</Translate>
</p>
<div className={styles.buttons}>
<Link
style={{width: 144, paddingRight: 0, paddingLeft: 0}}
className="button button--secondary button--lg"
to="/docs/quickstart"
>
<Translate>QuickStart</Translate>
</Link>
<Link
style={{width: 144, paddingRight: 0, paddingLeft: 0, display: "flex", justifyContent: "center", alignItems: "center"}}
className="button button--secondary button--lg"
to="https://github.com/kubenetworks/kubevpn"
>
<img
style={{ marginRight: 8}}
className={styles.githubLogo}
src="img/github.svg"
></img>
{ver}
</Link>
</div>
</div>
</header>
);
}
export default function Home(): React.JSX.Element {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={translate({
message: 'Homepage',
})}
description={config.tagline}
>
<HomepageHeader />
<main>
<HomepageFeatures />
</main>
</Layout>
);
}