Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion injectLatestProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ exec(
console.log(`stderr: ${stderr}`);
}
);
exec("cp -r ./react-native-elements/website/docs/props ./src/content/Props"),
exec(
"cp -r ./react-native-elements/website/docs/main/props ./src/content/Props"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"cp -r ./react-native-elements/website/docs/main/props ./src/content/Props"
"cp -r ./react-native-elements/website/docs/props ./src/content/Props"

Copy link
Contributor

@jugshaurya jugshaurya Jun 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pranshuchittora this file has some substantial changes in #97 please look there and this thing isn't a problem there! Please look at the PRs available. those PRs have to be merged before the latest ones. Otherwise, there will be conflicts. @pranshuchittora

),
(err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
Expand Down
6 changes: 6 additions & 0 deletions src/containers/Navigation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import CheckBox from "../../content/CheckBox";
import BottomSheet from "../../content/BottomSheet";
import ButtonGroup from "../../content/ButtonGroup";
import Divider from "../../content/Divider";
import SwitchComponent from "../../content/Switch";

export const Components_Index = [
{
Expand Down Expand Up @@ -151,6 +152,11 @@ export const Components_Index = [
component: SocialIcon,
path: "/social-icon",
},
{
name: "Switch",
component: SwitchComponent,
path: "/switch",
},
{
name: "Text",
component: Text,
Expand Down
2 changes: 1 addition & 1 deletion src/content/AirbnbRating/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { importMDX } from "mdx.macro";

import PropDrawer from "../../components/PropDrawer";

import Playground from "./searchbar.playground.jsx";
import Playground from "./airbnbrating.playground.jsx";
const Content = lazy(() => importMDX("../Props/rating.md"));

export default function AirbnbPlayground() {
Expand Down
40 changes: 39 additions & 1 deletion src/content/Divider/divider.playground.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,54 @@
import * as React from "react";
import { Divider } from "react-native-elements";
import { Divider, useTheme } from "react-native-elements";

import Playground from "../../components/playground";
import { useView, PropTypes } from "react-view";

const DividerPlayground = () => {
const { theme } = useTheme();
const params = useView({
componentName: "Divider",
props: {
style: {
type: PropTypes.Object,
value: `{width:"80%",margin:20}`,
description: "Apply style to the divider.",
},
color: {
type: PropTypes.String,
value: theme.colors.primary,
description: "Apply color to the divider.",
},
inset: {
type: PropTypes.Boolean,
value: false,
description: "Applies inset to the divider if true. Default is left.",
},
insetType: {
type: PropTypes.String,
value: "left",
description:
"Add inset to the divider in left, right, or in both direction. Choose among left, right, or middle.",
},
subHeader: {
type: PropTypes.String,
value: "React native elements",
description: "Adds a sub-header next to divider.",
},
subHeaderStyle: {
type: PropTypes.Object,
value: `{}`,
description: "Adds styles to the sub header of divider.",
},
width: {
type: PropTypes.Number,
value: 1,
description: "Add width to the divider.",
},
orientation: {
type: PropTypes.String,
value: "horizontal",
description: "Adds orientation to the divider.",
},
},
scope: {
Expand Down
19 changes: 19 additions & 0 deletions src/content/Switch/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { lazy, Suspense } from "react";
import { importMDX } from "mdx.macro";

import PropDrawer from "../../components/PropDrawer";
import Playground from "./switch.playground.jsx";
const Content = lazy(() => importMDX("../Props/switch.md"));

export default function SwitchPlayground() {
return (
<div>
<Playground />
<Suspense fallback={<div>Loading...</div>}>
<PropDrawer>
<Content />
</PropDrawer>
</Suspense>
</div>
);
}
49 changes: 49 additions & 0 deletions src/content/Switch/switch.playground.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import * as React from "react";
import { Switch, useTheme } from "react-native-elements";
import Playground from "../../components/playground";
import { useView, PropTypes } from "react-view";

const SwitchPlayground = () => {
const { theme } = useTheme();
const params = useView({
componentName: "Switch",
props: {
color: {
value: theme.colors.primary,
type: PropTypes.String,
description: "Color",
},
value: {
value: false,
type: PropTypes.Boolean,
description: "Value",
stateful: true,
},
onValueChange: {
value: "() => setValue(!value)",
propHook: {
what: "!value",
into: "value",
},
type: PropTypes.Function,
description: "Function called when switch state is changed.",
},
},
scope: {
Switch,
},
imports: {
"react-native-elements": {
named: ["Switch"],
},
},
});

return (
<React.Fragment>
<Playground params={params} />
</React.Fragment>
);
};

export default SwitchPlayground;
2 changes: 1 addition & 1 deletion src/content/Text/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { lazy, Suspense } from "react";
import { importMDX } from "mdx.macro";

import PropDrawer from "../../components/PropDrawer";
import Playground from "./tooltip.playground.jsx";
import Playground from "./text.playground.jsx";

const Content = lazy(() => importMDX("../Props/text.md"));

Expand Down