Skip to content

Commit 1de3b18

Browse files
committed
Embed content into home template
1 parent bea8fa0 commit 1de3b18

File tree

2 files changed

+72
-80
lines changed

2 files changed

+72
-80
lines changed

content/index.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/templates/home.js

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,78 @@ class Home extends Component {
141141
</header>
142142

143143
<Container>
144-
<div
145-
css={[sharedStyles.markdown, markdownStyles]}
146-
dangerouslySetInnerHTML={{__html: data.markdownRemark.html}}
147-
/>
144+
<div css={[sharedStyles.markdown, markdownStyles]}>
145+
<section class="light home-section">
146+
<div class="marketing-row">
147+
<div class="marketing-col">
148+
<h3>Declarative</h3>
149+
<p>React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.</p>
150+
<p>Declarative views make your code more predictable and easier to debug.</p>
151+
</div>
152+
<div class="marketing-col">
153+
<h3>Component-Based</h3>
154+
<p>Build encapsulated components that manage their own state, then compose them to make complex UIs.</p>
155+
<p>Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.</p>
156+
</div>
157+
<div class="marketing-col">
158+
<h3>Learn Once, Write Anywhere</h3>
159+
<p>We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.</p>
160+
<p>React can also render on the server using Node and power mobile apps using <a href="https://facebook.github.io/react-native/">React Native</a>.</p>
161+
</div>
162+
</div>
163+
</section>
164+
<hr class="home-divider" />
165+
<section class="home-section">
166+
<div id="examples">
167+
<div class="example">
168+
<h3>A Simple Component</h3>
169+
<p>
170+
React components implement a `render()` method that takes input data and
171+
returns what to display. This example uses an XML-like syntax called
172+
JSX. Input data that is passed into the component can be accessed by
173+
`render()` via `this.props`.
174+
</p>
175+
<p>
176+
<strong>JSX is optional and not required to use React.</strong>
177+
Try the
178+
<a href="http://babeljs.io/repl#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAEASCmIQHsCy8pgOb2vAHgC7wB2AJjAErxjCEB0AwsgLYAOyJph0A3gFABIAE6ky8YQAoAlHyEj4hAK7CS0ADxkAlgDcAfAiTI-hABZaI9NsORtLJMC3gBfdQHpt-gNxDn_P_zUtIQAIgDyqPSi5BKS6oYo6Jg40A5OALwARCHwOlokmdBuegA00CzISiSEAHLI4tJeQA&debug=false&circleciRepo=&evaluate=false&lineWrap=false&presets=react&prettier=true&targets=&version=6.26.0">Babel REPL</a>
179+
to see the raw JavaScript code produced by the JSX compilation step.
180+
</p>
181+
<div id="helloExample"></div>
182+
</div>
183+
<div class="example">
184+
<h3>A Stateful Component</h3>
185+
<p>
186+
In addition to taking input data (accessed via `this.props`), a
187+
component can maintain internal state data (accessed via `this.state`).
188+
When a component's state data changes, the rendered markup will be
189+
updated by re-invoking `render()`.
190+
</p>
191+
<div id="timerExample"></div>
192+
</div>
193+
<div class="example">
194+
<h3>An Application</h3>
195+
<p>
196+
Using `props` and `state`, we can put together a small Todo application.
197+
This example uses `state` to track the current list of items as well as
198+
the text that the user has entered. Although event handlers appear to be
199+
rendered inline, they will be collected and implemented using event
200+
delegation.
201+
</p>
202+
<div id="todoExample"></div>
203+
</div>
204+
<div class="example">
205+
<h3>A Component Using External Plugins</h3>
206+
<p>
207+
React is flexible and provides hooks that allow you to interface with
208+
other libraries and frameworks. This example uses <strong>remarkable</strong>, an
209+
external Markdown library, to convert the textarea's value in real time.
210+
</p>
211+
<div id="markdownExample"></div>
212+
</div>
213+
</div>
214+
</section>
215+
</div>
148216
</Container>
149217

150218
<section

0 commit comments

Comments
 (0)