|
| 1 | +import * as React from "react"; |
| 2 | + |
| 3 | +import PresentationCell from "../components/presentation-cell"; |
| 4 | +import CodeState from "../components/code-state"; |
| 5 | + |
1 | 6 | import { Kernel } from "@mybinder/host-cache";
|
2 | 7 | import { CodeArea } from "../components/code-area";
|
3 | 8 | const { WideLogo } = require("@nteract/logos");
|
4 | 9 |
|
5 |
| -const myCode = `import pandas as pd |
6 |
| -import numpy as np |
7 |
| -df = pd.DataFrame(np.random.random((100,10))) |
8 |
| -df.head() |
9 |
| -`; |
10 |
| - |
11 | 10 | const Index = () => {
|
12 | 11 | return (
|
13 | 12 | <div className="app">
|
14 |
| - <center> |
15 |
| - <WideLogo height={80} theme="light" /> |
16 |
| - <br /> |
17 |
| - Welcome to nteract! |
18 |
| - <br /> |
19 |
| - To get started, edit <code>pages/index.js</code>. |
20 |
| - </center> |
21 |
| - <hr /> |
| 13 | + <header> |
| 14 | + <WideLogo height={40} theme="light" /> |
| 15 | + |
| 16 | + <p> |
| 17 | + This <i>nteraction</i> brought to you in part by binder, jupyter, and |
| 18 | + nteract. |
| 19 | + </p> |
| 20 | + <p> |
| 21 | + A binder server is being launched in the background now. You'll see a |
| 22 | + cell below when its ready. |
| 23 | + </p> |
| 24 | + <p> |
| 25 | + To get started, edit <code>pages/index.js</code>. |
| 26 | + </p> |
| 27 | + </header> |
| 28 | + |
22 | 29 | <Kernel repo="binder-examples/requirements" kernelName="python3">
|
23 | 30 | <Kernel.Consumer>
|
24 | 31 | {kernel =>
|
25 | 32 | kernel ? (
|
26 |
| - <CodeArea kernel={kernel}>{myCode}</CodeArea> |
| 33 | + <CodeState kernel={kernel}> |
| 34 | + <PresentationCell key={"the-cell"} /> |
| 35 | + </CodeState> |
27 | 36 | ) : (
|
28 |
| - <pre>Loading...</pre> |
| 37 | + <PresentationCell key={"the-cell"} /> |
29 | 38 | )
|
30 | 39 | }
|
31 | 40 | </Kernel.Consumer>
|
32 | 41 | </Kernel>
|
33 | 42 | <style jsx>{`
|
34 | 43 | .app {
|
35 | 44 | padding: 30px;
|
| 45 | + font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, |
| 46 | + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; |
| 47 | + } |
| 48 | +
|
| 49 | + header { |
| 50 | + font-size: 1em; |
| 51 | + padding-bottom: 20px; |
| 52 | + } |
| 53 | + code { |
| 54 | + font-size: 1.3em; |
| 55 | + background-color: hsl(10, 0%, 90%); |
| 56 | + padding: 2px; |
36 | 57 | }
|
37 | 58 | `}</style>
|
38 | 59 | </div>
|
|
0 commit comments