Skip to content

Commit a1fd449

Browse files
authored
docs: Add logo to README and automate its export (react-dropzone#412)
- Exclude logo/ from npm package - Remove text version of the logo - Remove symbols and simplify SVG - Add PNG version of logo - Use imagemin and lint-staged to optimize images - Add export script
1 parent e3a109c commit a1fd449

File tree

8 files changed

+1166
-171
lines changed

8 files changed

+1166
-171
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.npmignore
2+
logo/

README.md

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
# react-dropzone [![Build Status](https://travis-ci.org/okonet/react-dropzone.svg?branch=master)](https://travis-ci.org/okonet/rect-dropzone) [![npm version](https://badge.fury.io/js/react-dropzone.svg)](https://badge.fury.io/js/react-dropzone) [![codecov](https://codecov.io/gh/okonet/react-dropzone/branch/master/graph/badge.svg)](https://codecov.io/gh/okonet/react-dropzone) [![OpenCollective](https://opencollective.com/react-dropzone/backers/badge.svg)](#backers)
1+
<div align="center">
2+
3+
![react-dropzone logo](logo/logo.png)
4+
5+
# react-dropzone
6+
7+
[![Build Status](https://travis-ci.org/okonet/react-dropzone.svg?branch=master)](https://travis-ci.org/okonet/rect-dropzone) [![npm version](https://badge.fury.io/js/react-dropzone.svg)](https://badge.fury.io/js/react-dropzone) [![codecov](https://codecov.io/gh/okonet/react-dropzone/branch/master/graph/badge.svg)](https://codecov.io/gh/okonet/react-dropzone) [![OpenCollective](https://opencollective.com/react-dropzone/backers/badge.svg)](#backers)
28
[![OpenCollective](https://opencollective.com/react-dropzone/sponsors/badge.svg)](#sponsors)
39

10+
411
Simple HTML5 drag-drop zone for files with React.js.
512

6-
Try it out here: http://okonet.ru/react-dropzone/
13+
Demo: http://okonet.ru/react-dropzone/
14+
</div>
15+
16+
---
717

8-
Installation
9-
============
18+
## Installation
1019

1120
The easiest way to use react-dropzone is to install it from npm and include it in your React build process (using [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/), etc).
1221

@@ -20,24 +29,21 @@ Create a standalone module using *WebPack*:
2029
> webpack
2130
```
2231

23-
React 0.13 users
24-
=====
32+
### React 0.13 users
2533

2634
Vesion 3.x is not compatible with React 0.13. If you can't upgrade to React 0.14 right now, you should use v 2.x of this package.
2735

2836
```
2937
npm install --save [email protected]
3038
```
3139

32-
Usage
33-
=====
40+
## Usage
3441

3542
Simply `require('react-dropzone')` and specify an `onDrop` method which accepts two arguments. The first argument represents the accepted files and the second argument the rejected files.
3643

3744
The `onDrop` method gets always called if a file was uploaded, regardless if it was accepted or rejected. The library provides two additional methods named `onDropAccepted` and `onDropRejected`. The `onDropAccepted` method will be called if all dropped files were accepted and the `onDropRejected` method will be called if any of the dropped files was rejected.
3845

39-
Example
40-
=====
46+
## Example
4147

4248
```jsx
4349

@@ -65,8 +71,7 @@ var DropzoneDemo = React.createClass({
6571
React.render(<DropzoneDemo />, document.body);
6672
```
6773

68-
Reacting to user input
69-
=====
74+
### Reacting to user input
7075

7176
By default, the component picks up some default styling to get you started. You can customize `<Dropzone>` by specifying a `style`, `activeStyle` or `rejectStyle` which is applied when a file is dragged over the zone. You can also specify `className`, `activeClassName` or `rejectClassName` if you would rather style using CSS.
7277

@@ -88,8 +93,7 @@ You have a third option : providing a function that returns the component's chil
8893
</Dropzone>
8994
```
9095

91-
Features
92-
========
96+
## Features
9397

9498
- `preventDropOnDocument` `[Boolean | **true**]` — When a file is dropped outside of any `<Dropzone>` instance, whether to prevent the browser from navigating to it.
9599
- `disableClick` `[Boolean | **false**]` — Clicking the `<Dropzone>` brings up the browser file picker.
@@ -103,7 +107,7 @@ Features
103107
To show a preview of the dropped file while it uploads, use the `file.preview` property. Use `<img src={file.preview} />` to display a preview of the image dropped.
104108
You can disable the creation of the preview (for example if you drop big files) by setting the `disablePreview` prop to `true`.
105109

106-
#### Manual Upload
110+
### Manual Upload
107111
* To trigger the dropzone manually (open the file prompt), call the component's `open` function.
108112
* The completion handler for the `open` function is also the `onDrop` function.
109113

@@ -150,8 +154,7 @@ var DropzoneDemo = React.createClass({
150154
React.render(<DropzoneDemo />, document.body);
151155
```
152156

153-
Uploads
154-
=======
157+
## Uploads
155158

156159
Using `react-dropzone` is similar to using a file form field, but instead of getting the `files` property from the field, you listen to the `onDrop` callback to handle the files. Simple explanation here: http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax
157160

@@ -167,8 +170,8 @@ Specifying the `onDrop` method, provides you with an array of [Files](https://de
167170
}
168171
```
169172

170-
Support
171-
=======
173+
## Support
174+
172175
### Backers
173176
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/react-dropzone#backer)]
174177

@@ -238,7 +241,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
238241
<a href="https://opencollective.com/react-dropzone/sponsor/28/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/28/avatar.svg"></a>
239242
<a href="https://opencollective.com/react-dropzone/sponsor/29/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/29/avatar.svg"></a>
240243

241-
License
242-
=======
244+
## License
243245

244246
MIT

logo/logo-text.svg

-17
This file was deleted.

logo/logo.png

3.06 KB
Loading

logo/logo.sketch

-117 KB
Binary file not shown.

logo/logo.svg

+1-16
Loading

package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@
1313
"lint-staged": "lint-staged",
1414
"deps": "npm-check -s",
1515
"deps:update": "npm-check -u",
16-
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
16+
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
17+
"logo": "cd logo && sketchtool export artboards logo.sketch",
18+
"imagemin": "imagemin --out-dir=logo --plugin=pngquant --plugin=svgo"
1719
},
1820
"lint-staged": {
1921
"*.js": [
2022
"eslint:fix",
2123
"git:add"
24+
],
25+
"*.{svg,png}": [
26+
"imagemin",
27+
"git add"
2228
]
2329
},
2430
"pre-commit": [
@@ -74,6 +80,8 @@
7480
"eslint-plugin-import": "^2.2.0",
7581
"eslint-plugin-jsx-a11y": "^2.2.3",
7682
"eslint-plugin-react": "^6.7.1",
83+
"imagemin-cli": "^3.0.0",
84+
"imagemin-pngquant": "^5.0.0",
7785
"jest": "^18.0.0",
7886
"lint-staged": "^3.2.1",
7987
"npm-check": "^5.2.1",

0 commit comments

Comments
 (0)