This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
index.js
162 lines (156 loc) · 4.93 KB
/
index.js
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
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import classnames from 'classnames';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';
const features = [
{
title: <>What is Flux?</>,
imageUrl: 'img/undraw_building_blocks.svg',
description: (
<>
Flux is the application architecture that Facebook uses for building
client-side web applications.
</>
),
},
{
title: <>What does it do?</>,
imageUrl: 'img/undraw_react.svg',
description: (
<>
It complements React's composable view components by utilizing a
unidirectional data flow.
</>
),
},
{
title: <>How do I use it?</>,
imageUrl: 'img/undraw_programming.svg',
description: (
<>
It's more of a pattern rather than a formal framework, and you can start
using Flux immediately without a lot of new code.
</>
),
},
];
function VideoContainer() {
return (
<div className="container text--center">
<div className="row">
<div className="col">
<h2>Brief Introduction into Flux</h2>
<div>
<iframe
width="100%"
height="315"
src="https://www.youtube.com/embed/pR4A9YONzuo"
title="Explain Like I'm 5: Flux"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
/>
</div>
</div>
<div className="col">
<h2>Closer Look at Flux</h2>
<div>
<iframe
width="100%"
height="315"
src="https://www.youtube.com/embed/nYkdrAPrdcw"
title="Hacker Way: Rethinking Web App Development at Facebook"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
/>
</div>
</div>
</div>
</div>
);
}
function Home() {
const context = useDocusaurusContext();
const {siteConfig = {}} = context;
return (
<Layout title={siteConfig.title} description={siteConfig.tagline}>
<header className={classnames('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className={classnames(
'button button--secondary button--lg',
styles.getStarted,
)}
to={useBaseUrl('docs/overview')}>
Get Started
</Link>
</div>
</div>
</header>
<main>
<div className={styles.deprecationBanner}>
<div className="container">
<div className="row">
<div className="col col--8 col--offset-2">
<div className="margin-vert--xl text--center">
<h2>
The Flux project has been archived and no further changes
will be made. We recommend using modern alternatives like
Redux, MobX, Recoil, Zustand, or Jotai instead.
</h2>
</div>
</div>
</div>
</div>
</div>
{features && features.length && (
<section className={styles.features}>
<div className="container">
<div className="row">
{features.map(({imageUrl, title, description}, idx) => (
<div
key={idx}
className={classnames('col col--4', styles.feature)}>
{imageUrl && (
<div className="text--center">
<img
className={styles.featureImage}
src={useBaseUrl(imageUrl)}
alt={title}
/>
</div>
)}
<h3>{title}</h3>
<p>{description}</p>
</div>
))}
</div>
</div>
</section>
)}
<VideoContainer />
<div className="text--center padding-vert--xl">
<Link
className="button button--primary button--lg"
to={useBaseUrl('docs/overview')}>
Learn more about Flux!
</Link>
</div>
</main>
</Layout>
);
}
export default Home;