From 7b270dfbe96701c8f8ef786db1cea95b2264c9db Mon Sep 17 00:00:00 2001 From: Farid from Safi Date: Sun, 17 Jul 2016 21:47:23 +0200 Subject: [PATCH] license --- .gitignore | 1 + LICENSE | 21 ++++++++++++ .../src/DefaultStyles.js | 33 +------------------ .../src/components/Composer.js | 17 +++++++--- .../src/components/_ActionsShareSample.js | 21 +++++++++--- 5 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore index 9223f7d15..2817d3e8e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/ npm-debug.log TODO.md +README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..838df598f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Farid from Safi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/example/react-native-gifted-messenger/src/DefaultStyles.js b/example/react-native-gifted-messenger/src/DefaultStyles.js index 998ed964f..67478a999 100644 --- a/example/react-native-gifted-messenger/src/DefaultStyles.js +++ b/example/react-native-gifted-messenger/src/DefaultStyles.js @@ -8,37 +8,6 @@ const toolbarInputStyles = { minInputToolbarHeight: 55, minComposerHeight: 35, maxComposerHeight: 100, - - Composer: { - textInput: { - flex: 1, - marginLeft: 10, - fontSize: 17, - }, - }, }; - -/* -** Global styles -*/ -// TODO to deprecate? -const globalStyles = { - NavBar: { - statusBar: { - backgroundColor: '#FFF', - }, - navBar: { - backgroundColor: '#FFF', - }, - title: { - color: '#000', - }, - buttonText: { - color: '#000', - }, - }, -}; - - -export default Object.assign({}, toolbarInputStyles, globalStyles); +export default Object.assign({}, toolbarInputStyles); diff --git a/example/react-native-gifted-messenger/src/components/Composer.js b/example/react-native-gifted-messenger/src/components/Composer.js index a6f80b73b..851e85f5c 100644 --- a/example/react-native-gifted-messenger/src/components/Composer.js +++ b/example/react-native-gifted-messenger/src/components/Composer.js @@ -1,9 +1,10 @@ import React, { Component } from 'react'; import { + StyleSheet, TextInput, } from 'react-native'; -class Composer extends Component { +export default class Composer extends Component { render() { return ( { this.props.onChange(e); }} - style={[this.props.customStyles.Composer.textInput, { + style={[styles.textInput, this.props.textInputStyle, { height: this.props.composerHeight, marginTop: (this.props.customStyles.minInputToolbarHeight - this.props.customStyles.minComposerHeight) / 2, marginBottom: (this.props.customStyles.minInputToolbarHeight - this.props.customStyles.minComposerHeight) / 2, @@ -24,12 +25,18 @@ class Composer extends Component { } } +const styles = StyleSheet.create({ + textInput: { + flex: 1, + marginLeft: 10, + fontSize: 17, + }, +}); + Composer.defaultProps = { - customStyles: {}, + textInputStyle: {}, onChange: () => {}, composerHeight: 35, text: '', placeholder: 'Type a message...', }; - -export default Composer; diff --git a/example/react-native-gifted-messenger/src/components/_ActionsShareSample.js b/example/react-native-gifted-messenger/src/components/_ActionsShareSample.js index b6df7f9b6..efb3f5e3a 100644 --- a/example/react-native-gifted-messenger/src/components/_ActionsShareSample.js +++ b/example/react-native-gifted-messenger/src/components/_ActionsShareSample.js @@ -68,15 +68,26 @@ class Actions extends Component { renderNavBar() { return ( - + { this.setModalVisible(false); }}> - + {'Cancel'} - + {'Camera Roll'} { @@ -88,7 +99,9 @@ class Actions extends Component { }); this.props.onSend(images); }}> - + {'Send'}