Repository: SaraVieira/react-social-sharing
Branch: master
Commit: 3cd8ea11823c
Files: 91
Total size: 1.4 MB
Directory structure:
gitextract_5n3bp_xz/
├── .babelrc
├── .editorconfig
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .npmignore
├── .prettierignore
├── .prettierrc
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE
├── License.md
├── README.md
├── __tests__/
│ ├── __snapshots__/
│ │ ├── facebook.js.snap
│ │ ├── google.js.snap
│ │ ├── hacker.js.snap
│ │ ├── linkedin.js.snap
│ │ ├── mail.js.snap
│ │ ├── pinterest.js.snap
│ │ ├── reddit.js.snap
│ │ ├── telegram.js.snap
│ │ ├── tumblr.js.snap
│ │ ├── twitter.js.snap
│ │ ├── vk.js.snap
│ │ ├── whatsapp.js.snap
│ │ └── xing.js.snap
│ ├── facebook.js
│ ├── google.js
│ ├── hacker.js
│ ├── linkedin.js
│ ├── mail.js
│ ├── pinterest.js
│ ├── reddit.js
│ ├── telegram.js
│ ├── tumblr.js
│ ├── twitter.js
│ ├── vk.js
│ ├── whatsapp.js
│ └── xing.js
├── docs/
│ ├── facebook.md
│ ├── google.md
│ ├── hacker.md
│ ├── index.html
│ ├── index.js
│ ├── linkedin.md
│ ├── mail.md
│ ├── main.css
│ ├── pinterest.md
│ ├── reddit.md
│ ├── telegram.md
│ ├── tumblr.md
│ ├── twitter.md
│ ├── vk.md
│ ├── whatsapp.md
│ ├── x.md
│ └── xing.md
├── lib/
│ └── jestsetup.js
├── package.json
└── src/
├── buttons/
│ ├── facebook.js
│ ├── factory.js
│ ├── google.js
│ ├── hacker.js
│ ├── linkedin.js
│ ├── mail.js
│ ├── pinterest.js
│ ├── reddit.js
│ ├── telegram.js
│ ├── tumblr.js
│ ├── twitter.js
│ ├── vk.js
│ ├── whatsapp.js
│ ├── wrapper.js
│ ├── x.js
│ └── xing.js
├── common.js
├── consts.js
├── index.js
└── svg/
├── X.js
├── facebook.js
├── google.js
├── hacker.js
├── linkedin.js
├── mail.js
├── pinterest.js
├── reddit.js
├── telegram.js
├── tumblr.js
├── twitter.js
├── vk.js
├── whatsapp.js
└── xing.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": [
"env",
"react"
],
"plugins": [
"syntax-dynamic-import",
[
"transform-object-rest-spread",
"transform-react-remove-prop-types",
{
"mode": "wrap"
}
]
]
}
================================================
FILE: .editorconfig
================================================
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .eslintrc.js
================================================
module.exports = {
extends: 'plugin:prettier/recommended',
parser: 'babel-eslint',
env: {
browser: true,
jasmine: true,
node: true
},
plugins: ['react', 'jsx-a11y'],
rules: {
'comma-dangle': ['error', 'never'],
'global-require': 0,
'prefer-arrow-callback': 0,
'func-names': 0,
'import/no-extraneous-dependencies': 0,
'no-underscore-dangle': 0,
'no-unused-expressions': 0,
'no-use-before-define': 0,
'react/jsx-filename-extension': 0,
'react/sort-comp': 0,
'react/no-multi-comp': 0,
'react/require-extension': 0
}
}
================================================
FILE: .gitattributes
================================================
* text=auto
bin/* eol=lf
================================================
FILE: .gitignore
================================================
docs/build/
dist-es6/
dist-modules/
node_modules/
coverage/
npm-debug.log
.eslintcache
# Logs
*.log
================================================
FILE: .npmignore
================================================
demo/
dist/
tests/
src/
docs/
coverage/
__tests__/
.*
================================================
FILE: .prettierignore
================================================
docs
coverage
dist-es6
dist-modules
================================================
FILE: .prettierrc
================================================
{
"semi": false,
"singleQuote": true,
"overrides": [
{
"files": "*.md",
"options": {
"printWidth": 70,
"useTabs": false,
"trailingComma": "none",
"proseWrap": "never"
}
}
]
}
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- "8"
- "10"
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s
- export PATH="$HOME/.yarn/bin:$PATH"
before_script:
- npm run dist
script:
- npm run test:lint
- npm run test:coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
## Set up instructions
First of all, this is a JavaScript project that's distributed on [npmjs.org](https://npmjs.org) and therefore uses JavaScript tooling based on [Node.js](https://nodejs.org/) with dependencies from npm. You're going to need to have those things installed to contribute to this project.
1. Fork the repo
2. Clone your fork
3. Create a branch
4. Run `npm install`
5. Run `npm start`. If everything works, then you're ready to make changes.
6. Make your changes and try to make the tests pass. If you can't or need help then commit what you have with `--no-verify` and make a PR
7. If you get things working, add your changed files with `git add` and run `npm run commit` to get an interactive prompt for creating a commit message that follows [our standards](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md). You'll notice that there are git hooks in place which will run testing, linting, etc. (unless you commit with `--no-verify`).
8. Push your changes to your fork with `git push`
9. Create a pull request.
10. Iterate on the solution.
11. Get merged! 🎉 🎊
================================================
FILE: LICENSE
================================================
Copyright (c) 2016 Juho Vepsalainen
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.
================================================
FILE: License.md
================================================
# The MIT License
Copyright 2018 Sara Vieira, contributors
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.
================================================
FILE: README.md
================================================
[](https://www.npmjs.com/package/react-social-sharing)
# React Sharing Buttons
React Implementation of @mxstbr [sharingbuttons.io](http://sharingbuttons.io/) No Extra Javascript Imports. No Tracking. Just Links, SVG and CSS
## Basic Usage
```
yarn add react-social-sharing
```
```js
import React from 'react'
import { Twitter } from 'react-social-sharing'
export default () =>
```
## Localization
To any button for localization of the `aria-label` you can pass a function like so:
```js
localise('share_label', { serviceName })}
/>
```
This function receives the name of the service and the return value is the `aria-label` and `title` used in the anchor.
This name is automatically filled by the package but you can override this with the name prop.
## License
react-social-sharing is available under MIT. See LICENSE for more details.
## Acknowledgements
- Thank you to [bebraw](https://github.com/bebraw) for creating [react-component-boilerplate](https://github.com/survivejs/react-component-boilerplate)
- Thank you to [mxstbr](https://github.com/mxstbr) for creating [sharingbuttons.io](https://github.com/mxstbr/sharingbuttons.io)
- Icons by [Streamline](http://streamlineicons.com/).
================================================
FILE: __tests__/__snapshots__/facebook.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Facebook 1 1`] = `
.c0 {
-webkit-text-decoration: none;
text-decoration: none;
color: #fff;
margin: 0.5em;
display: inline-block;
}
.c0 svg {
width: 1em;
height: 1em;
vertical-align: top;
}
.c0 svg:not(:only-child) {
margin-right: 0.4em;
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
fill: #fff;
stroke: none;
fill: #fff;
stroke: none;
}
.c1 {
border-radius: 5px;
-webkit-transition: 25ms ease-out;
transition: 25ms ease-out;
padding: 0.5em 0.75em;
font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
background-color: #3b5998;
border-color: #3b5998;
}
.c1 svg path {
fill: #3b5998;
}
.c1:hover,
.c1:active {
background-color: #2d4373;
border-color: #2d4373;
}