diff --git a/docs/src/content/components/divider/Demos/InsetLeftDemo.js b/docs/src/content/components/divider/Demos/InsetLeftDemo.js new file mode 100644 index 00000000..8ee51f12 --- /dev/null +++ b/docs/src/content/components/divider/Demos/InsetLeftDemo.js @@ -0,0 +1,88 @@ +import React from 'react'; +import { View } from 'react-native'; +import { ComponentDemo, CodeInline } from '@components'; +import { Divider, List, ListItem, Avatar } from '../../../../../../src/index'; + +export const code = `class DialogPage extends React.Component { + constructor(props) { + super(props) + } + render() { + return ( + + + } + /> + + + } + /> + + + } + /> + + } + /> + + + ); + } +} +`; + +const SubtitleDemo = ({ pageHref }) => ( + + shortens the width of the + divider by the provided amount and moves the{' '} + to the right by that + amount. This is useful for keeping the{' '} + inline with other elements. + + } + scope={{ View, Divider, List, ListItem, Avatar }} + /> +); +export default SubtitleDemo; diff --git a/docs/src/content/components/divider/Demos/index.js b/docs/src/content/components/divider/Demos/index.js index f281d43b..f5836c6f 100644 --- a/docs/src/content/components/divider/Demos/index.js +++ b/docs/src/content/components/divider/Demos/index.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { ComponentDemoHeader } from '@components'; import SubheaderDemo from './SubheaderDemo'; +import InsetLeftDemo from './InsetLeftDemo'; export default class Demos extends Component { static propTypes = { @@ -10,11 +11,13 @@ export default class Demos extends Component { }; render() { const { pageHref } = this.props; + return (
+
); } diff --git a/docs/src/content/components/divider/index.js b/docs/src/content/components/divider/index.js index f857217e..04d3e2a3 100644 --- a/docs/src/content/components/divider/index.js +++ b/docs/src/content/components/divider/index.js @@ -11,6 +11,7 @@ const sections = [ { name: 'Props' }, { name: 'Demos' }, { name: 'subheader', sub: true }, + { name: 'insetLeft', sub: true }, ]; export default class DividerPage extends Component { diff --git a/docs/src/content/components/divider/propData.js b/docs/src/content/components/divider/propData.js index a4015caf..2cc9ab48 100644 --- a/docs/src/content/components/divider/propData.js +++ b/docs/src/content/components/divider/propData.js @@ -1,6 +1,7 @@ import { createTableData } from '../../../utils/createPropData'; const propData = [ ['insetHeader', 'Subheader inset number ', 'number', ''], + ['insetLeft', 'Inset of Divider from left ', 'number', ''], ['marginVertical', 'Adds magin on top and bottom for spacing', 'number', ''], ['style', 'Styles root element', 'object', ''], ['subheader', 'Displays under a divider as text ', 'string', ''], diff --git a/src/Components/Divider/__snapshots__/Divider.test.js.snap b/src/Components/Divider/__snapshots__/Divider.test.js.snap index bde5c5b3..5c6a2ea4 100644 --- a/src/Components/Divider/__snapshots__/Divider.test.js.snap +++ b/src/Components/Divider/__snapshots__/Divider.test.js.snap @@ -10,7 +10,9 @@ exports[`Divider Renders 1`] = ` }, Object { "height": 0.5, + "marginLeft": 0, "marginVertical": 8, + "width": "100%", }, undefined, ] diff --git a/src/Components/Icon/Icon.js b/src/Components/Icon/Icon.js index cd2fc425..f64b4962 100644 --- a/src/Components/Icon/Icon.js +++ b/src/Components/Icon/Icon.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import MaterialIcons from 'react-native-vector-icons/dist/MaterialIcons'; +import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; import withTheme from '../../Theme/withTheme'; class Icon extends Component {