-
Notifications
You must be signed in to change notification settings - Fork 2
/
Row.js
58 lines (53 loc) · 1.4 KB
/
Row.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
require("prismjs");
require("prismjs/components/prism-ruby");
require("prismjs/components/prism-elixir");
import React from "react";
import Box from "grommet/components/Box";
import Card from "grommet/components/Card";
import Heading from "grommet/components/Heading";
import Columns from "grommet/components/Columns";
import Markdown from "grommet/components/Markdown";
import Value from "grommet/components/Value";
import PrismCode from "react-prism";
export default ({ rowContent }) => {
let { active_record, ecto, key, title } = rowContent;
console.log(key);
let description = (
<Box>
<Box>
<small
style={{
marginRight: "0.8rem",
flex: 1
}}
>
ActiveRecord
</small>
<PrismCode className="language-ruby" component="pre">
{active_record.childMarkdownRemark.fields.contents}
</PrismCode>
</Box>
<Box>
<small
style={{
marginRight: "0.8rem",
flex: 1
}}
>
Ecto
</small>
<PrismCode className="language-elixir" component="pre">
{ecto.childMarkdownRemark.fields.contents}
</PrismCode>
</Box>
</Box>
);
return (
<Card
colorIndex="light-1"
heading={title.childMarkdownRemark.fields.contents}
headingStrong={false}
description={description}
/>
);
};