Newer
Older
import React, { ReactElement } from "react";
import { graphql, PageProps, Link } from "gatsby";
import { Content } from "@onegeo/gatsby-theme-onegeo";
import { Hero } from "@onegeo/gatsby-theme-onegeo";
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
function hero({ data }: PageProps): ReactElement {
// @ts-ignore
const site = data.site.siteMetadata;
return (
<Content>
<div className="prose">
<Link to="/doc/core">Retour</Link>
<h1>Hero</h1>
<h2>Props</h2>
<div className="mockup-code">
<pre>
<code>
{`
interface Service {
title: string;
subtitle: string;
icon: string;
}
interface Action {
title: string;
to: string;
}
interface Props {
title: string;
subtitle: string;
description: string;
action: Action;
services: Array<Service>;
}
GraphQL query
query {
site {
siteMetadata {
title
subtitle
description
}
}
}
`}
</code>
</pre>
</div>
<h2>Example</h2>
</div>
<Hero {...site} />
</Content>
);
}
export default hero;
export const query = graphql`
query {
site {
siteMetadata {
title
subtitle
description
}
}
}
`;