forked from layer5io/layer5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
74 lines (67 loc) · 1.88 KB
/
code.js
File metadata and controls
74 lines (67 loc) · 1.88 KB
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
import React from "react";
import { navigate } from "gatsby";
import { useLocation } from "@reach/router";
import { CodeBlock } from "../button/code-block";
import { SistentLayout } from "../../sistent-layout";
import TabButton from "../../../../../reusecore/Button";
const exampleCode = `
<SistentThemeProvider>
<FormGroup>
<FormControlLabel
control={<Checkbox />}
label="Option 1"
/>
<FormControlLabel
control={<Checkbox />}
label="Option 2"
/>
</FormGroup>
</SistentThemeProvider>
`;
const FormGroupCode = () => {
const location = useLocation();
return (
<SistentLayout title="FormGroup">
<div className="content">
<h2>FormGroup</h2>
<div className="filterBtns">
<TabButton
className={
location.pathname === "/projects/sistent/components/formgroup"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/formgroup")}
title="Overview"
/>
<TabButton
className={
location.pathname ===
"/projects/sistent/components/formgroup/guidance"
? "active"
: ""
}
onClick={() =>
navigate("/projects/sistent/components/formgroup/guidance")
}
title="Guidance"
/>
<TabButton
className={
location.pathname ===
"/projects/sistent/components/formgroup/code"
? "active"
: ""
}
onClick={() =>
navigate("/projects/sistent/components/formgroup/code")
}
title="Code"
/>
</div>
<CodeBlock name="formgroup-example" code={exampleCode} />
</div>
</SistentLayout>
);
};
export default FormGroupCode;