From 3f76de5737b7d5cd2f9473608d5fe5e6679fd0ed Mon Sep 17 00:00:00 2001 From: mitulsavani Date: Sat, 8 Feb 2020 01:17:03 -0800 Subject: [PATCH 1/2] View Style Props - Added Snack Example --- docs/view-style-props.md | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/view-style-props.md b/docs/view-style-props.md index abf36d91331..836b9b583e7 100644 --- a/docs/view-style-props.md +++ b/docs/view-style-props.md @@ -3,6 +3,61 @@ id: view-style-props title: View Style Props --- +### Example + +```SnackPlayer name=ViewStyleProps&supportedPlatforms=ios,android +import React, { Component } from 'react'; +import { View, StyleSheet } from 'react-native'; + +export default class ViewStyleProps extends Component { + render() { + return ( + + + + + + ); + } +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'space-between', + backgroundColor: '#fff', + padding: 20, + margin: 10, + }, + top: { + flex: 0.3, + backgroundColor: 'grey', + borderWidth: 5, + borderTopLeftRadius: 20, + borderTopRightRadius: 20, + }, + middle: { + flex: 0.3, + backgroundColor: 'beige', + borderWidth: 5, + borderColor: 'black', + }, + bottom: { + flex: 0.3, + backgroundColor: 'pink', + borderWidth: 5, + borderBottomLeftRadius: 20, + borderBottomRightRadius: 20, + }, +}); +``` + # Reference ## Props From 4224b0cd0669fa44c5748b902b2cb117f4eb8dfe Mon Sep 17 00:00:00 2001 From: Rachel Nabors Date: Mon, 17 Feb 2020 14:24:00 +0000 Subject: [PATCH 2/2] Update view-style-props.md Prettifying code --- docs/view-style-props.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/docs/view-style-props.md b/docs/view-style-props.md index 836b9b583e7..8ffe89fdea0 100644 --- a/docs/view-style-props.md +++ b/docs/view-style-props.md @@ -5,56 +5,48 @@ title: View Style Props ### Example -```SnackPlayer name=ViewStyleProps&supportedPlatforms=ios,android -import React, { Component } from 'react'; -import { View, StyleSheet } from 'react-native'; - +```SnackPlayer name=ViewStyleProps +import React, { Component } from "react"; +import { View, StyleSheet } from "react-native"; export default class ViewStyleProps extends Component { render() { return ( - - - + + + ); } } - const styles = StyleSheet.create({ container: { flex: 1, - justifyContent: 'space-between', - backgroundColor: '#fff', + justifyContent: "space-between", + backgroundColor: "#fff", padding: 20, - margin: 10, + margin: 10 }, top: { flex: 0.3, - backgroundColor: 'grey', + backgroundColor: "grey", borderWidth: 5, borderTopLeftRadius: 20, - borderTopRightRadius: 20, + borderTopRightRadius: 20 }, middle: { flex: 0.3, - backgroundColor: 'beige', + backgroundColor: "beige", borderWidth: 5, - borderColor: 'black', + borderColor: "black" }, bottom: { flex: 0.3, - backgroundColor: 'pink', + backgroundColor: "pink", borderWidth: 5, borderBottomLeftRadius: 20, - borderBottomRightRadius: 20, - }, + borderBottomRightRadius: 20 + } }); ```