/
index.tsx
72 lines (67 loc) · 2.47 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
import '@site/src/css/animate.css';
import Layout from '@theme/Layout';
import React, { useEffect, useMemo } from 'react';
import { Helmet } from 'react-helmet';
import { PC_MIN_WIDTH } from '../constants/platform';
import useWindow from '../hooks/useWindow';
import Banner from './components/Banner';
import Capability from './components/Capability';
import Community from './components/Community';
import HomeFooter from './components/Footer';
import HomeHeader from './components/Header';
import Introduce from './components/Introduce';
import HomeUserBy from './components/UserBy';
import './index.scss';
const Home = () => {
const { screenWidth, currentLanguage, cloudUrl } = useWindow();
const isPc = useMemo(() => screenWidth > PC_MIN_WIDTH, [screenWidth]);
useEffect(() => {
const loadUmamiScript = () => {
const hostname = window.location.hostname;
if (hostname === 'sealos.run') {
const script1 = document.createElement('script');
script1.src = 'https://umami.cloud.sealos.io/oishii';
script1.setAttribute('data-website-id', 'e5a8009f-7cb6-4841-9522-d23b96216b7a');
script1.async = true;
document.head.appendChild(script1);
} else {
const script2 = document.createElement('script');
script2.src = 'https://umami.cloud.sealos.io/oishii';
script2.setAttribute('data-website-id', 'a1c29ace-b288-431a-a2eb-8617d1d5b5ed');
script2.async = true;
document.head.appendChild(script2);
}
};
loadUmamiScript();
}, []);
const HomeRender = (
<div id="sealos-layout-wrap-home-page">
<Banner />
<Helmet>
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-786053845" />
<script async>
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-786053845');
gtag('event', 'conversion', {'send_to': 'AW-786053845/LpbTCJ-8-coYENX16PYC'});
`}
</script>
<meta name="baidu-site-verification" content="codeva-gAHDaifnOq" />
</Helmet>
<Layout>
<div className="home">
<HomeHeader isPc={isPc} />
<Capability isPc={isPc} />
<Introduce isPc={isPc} />
<Community isPc={isPc} />
<HomeUserBy isPc={isPc} />
<HomeFooter isPc={isPc} />
</div>
</Layout>
</div>
);
return HomeRender;
};
export default Home;