├── doc └── screenshot.png ├── .gitignore ├── README.md ├── package.json ├── index.js └── LICENSE /doc/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/react-native-photo-guideline-grid/HEAD/doc/screenshot.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-photo-guideline-grid 2 | 3 | A simple component to display a guideline grid according to Rule of thirds. 4 | 5 | ![Screenshot of the guideline grid](https://raw.githubusercontent.com/bamlab/react-native-photo-guideline-grid/master/doc/screenshot.png "Screenshot of the guideline grid") 6 | 7 | ## Usage 8 | 9 | ```shell 10 | npm install react-native-photo-guideline-grid --save 11 | ``` 12 | 13 | then use it in a component: 14 | 15 | ```js 16 | import PhotoGuidelineGrid from 'react-native-photo-guideline-grid'; 17 | 18 | class MyView extends Component { 19 | //... 20 | 21 | render() { 22 | return ( 23 | // ... 24 | 25 | 26 | 27 | 28 | ); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-photo-guideline-grid", 3 | "version": "0.0.1", 4 | "description": "A simple component to display a guideline grid according to Rule of thirds", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/bamlab/react-native-photo-guideline-grid.git" 12 | }, 13 | "keywords": [ 14 | "photo", 15 | "guideline", 16 | "grid", 17 | "third", 18 | "rule" 19 | ], 20 | "author": "Florian Rival ", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/bamlab/react-native-photo-guideline-grid/issues" 24 | }, 25 | "homepage": "https://github.com/bamlab/react-native-photo-guideline-grid#readme" 26 | } 27 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {View} from 'react-native'; 3 | 4 | const absoluteFill = { 5 | position: 'absolute', 6 | top: 0, 7 | left: 0, 8 | right: 0, 9 | bottom: 0, 10 | }; 11 | 12 | export default class PhotoGrid extends Component { 13 | renderGrid = (direction) => { 14 | const blockStyle = direction === 'row' 15 | ? {borderColor: 'white', borderRightWidth: 1} 16 | : {borderColor: 'white', borderBottomWidth: 1}; 17 | 18 | return ( 19 | 26 | 27 | 28 | 29 | 30 | ); 31 | } 32 | 33 | render() { 34 | return ( 35 | 36 | {this.renderGrid('row')} 37 | {this.renderGrid('column')} 38 | 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 BAM 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------