olahol / react-social

Simple React components for social buttons (Facebook, Twitter and Pinterest) and social counts.
177 stars 60 forks source link

Structuring and ES6 #22

Open dstuecken opened 8 years ago

dstuecken commented 8 years ago

How about structuring the components into separate files?

I'd go with this directory structure:

- index.js
- lib
| jsonp.js
| - Components
| | - Facebook
| | | - FacebookButton
| | | | - facebookbutton.js
| | | | - index.js
| | | - FacebookCount
| | | | - facebookcount.js
| | | | - index.js
| | - Xing
| | | - XingButton
| | | | - xingbutton.js
| | | | - index.js

.. and so on. What do you think?

The more buttons and functions, the more unmaintainable it will be with one single file in future.

It would also be nice to have different example styles for the buttons (with optional FontAwesome icons for instance). This would lead to an easier integration for new react users.

I'd also propose to switch to ES6 syntax in that step.

olahol commented 8 years ago

Yep, this is something that should be done in version 2, the original component is really old and not fun to modify.