Skip to content

Commit af07ce6

Browse files
authored
chore: Add FAB Playground (#116)
1 parent bae9c73 commit af07ce6

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

Diff for: src/containers/Navigation/index.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import CheckBox from "../../content/CheckBox";
4040
import BottomSheet from "../../content/BottomSheet";
4141
import ButtonGroup from "../../content/ButtonGroup";
4242
import Divider from "../../content/Divider";
43+
import FAB from "../../content/FAB";
4344
import SwitchComponent from "../../content/Switch";
4445

4546
export const Components_Index = [
@@ -84,6 +85,11 @@ export const Components_Index = [
8485
component: Divider,
8586
path: "/divider",
8687
},
88+
{
89+
name: "FAB",
90+
component: FAB,
91+
path: "/fab",
92+
},
8793

8894
{
8995
name: "Header",

Diff for: src/content/FAB/fab.playground.jsx

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import * as React from "react";
2+
import { FAB } from "react-native-elements";
3+
4+
import Playground from "../../components/playground";
5+
import { useView, PropTypes } from "react-view";
6+
7+
const FabPlayground = () => {
8+
const params = useView({
9+
componentName: "FAB",
10+
props: {
11+
style: {
12+
type: PropTypes.Object,
13+
value: `{width:"80%",margin:20}`,
14+
},
15+
placement: {
16+
type: PropTypes.Enum,
17+
options: { left: "left", right: "right" },
18+
value: "left",
19+
},
20+
color: {
21+
type: PropTypes.String,
22+
value: "",
23+
},
24+
size: {
25+
type: PropTypes.Enum,
26+
options: { small: "small", large: "large" },
27+
value: "small",
28+
},
29+
visible: {
30+
type: PropTypes.Boolean,
31+
value: false,
32+
},
33+
upperCase: {
34+
type: PropTypes.Boolean,
35+
value: false,
36+
},
37+
overlayColor: {
38+
type: PropTypes.String,
39+
value: "#454545",
40+
},
41+
title: {
42+
type: PropTypes.String,
43+
value: "Create",
44+
},
45+
icon: {
46+
type: PropTypes.Object,
47+
value: `{ name: 'edit', color: '#fff' }`,
48+
},
49+
},
50+
scope: {
51+
FAB,
52+
},
53+
imports: {
54+
"react-native-elements": {
55+
named: ["FAB"],
56+
},
57+
},
58+
});
59+
60+
return (
61+
<React.Fragment>
62+
<Playground params={params} />
63+
</React.Fragment>
64+
);
65+
};
66+
67+
export default FabPlayground;

Diff for: src/content/FAB/index.jsx

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, { lazy, Suspense } from "react";
2+
import { importMDX } from "mdx.macro";
3+
4+
import PropDrawer from "../../components/PropDrawer";
5+
import Playground from "./fab.playground";
6+
7+
const Content = lazy(() => importMDX("../Props/fab.md"));
8+
9+
export default function FabPlayground() {
10+
return (
11+
<div>
12+
<Playground />
13+
<Suspense fallback={<div>Loading...</div>}>
14+
<PropDrawer>
15+
<Content />
16+
</PropDrawer>
17+
</Suspense>
18+
</div>
19+
);
20+
}

0 commit comments

Comments
 (0)