├── .babelrc
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE
├── README.md
├── index.d.ts
├── lib
├── GithubCorner.js
├── GithubCorner.js.map
├── get-github-corner-styles.js
└── get-github-corner-styles.js.map
├── package-lock.json
├── package.json
├── src
├── __testutils__
│ └── setup.js
├── app
│ ├── components
│ │ ├── Footer.js
│ │ └── Header.js
│ ├── constants
│ │ └── ActionTypes.js
│ ├── containers
│ │ └── App.js
│ ├── favicon.ico
│ ├── helpers
│ │ └── stringToCssName.js
│ ├── images
│ │ ├── ajax-loader.gif
│ │ └── gradient_squares.png
│ ├── index.html
│ ├── index.js
│ ├── pages
│ │ ├── About.js
│ │ ├── Home.js
│ │ └── NotFound.js
│ ├── reducers
│ │ └── index.js
│ ├── routes
│ │ └── index.js
│ ├── store
│ │ └── configureStore.js
│ └── styles
│ │ ├── app.less
│ │ ├── components
│ │ ├── footer.less
│ │ └── header.less
│ │ ├── includes
│ │ ├── common.less
│ │ └── variables.less
│ │ └── pages
│ │ ├── about.less
│ │ └── home.less
├── lib
│ ├── GithubCorner.js
│ ├── GithubCorner.test.js
│ ├── __snapshots__
│ │ ├── GithubCorner.test.js.snap
│ │ └── get-github-corner-styles.test.js.snap
│ ├── get-github-corner-styles.js
│ └── get-github-corner-styles.test.js
└── plugins
│ └── remove-prop-types-import.js
└── webpack.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | presets: ['env', 'react', 'stage-0'],
3 | env: {
4 | production: {
5 | plugins: [
6 | 'transform-react-remove-prop-types',
7 | './src/plugins/remove-prop-types-import'
8 | ]
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | # ignore these files:
2 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es6: true,
5 | jest: true,
6 | node: true
7 | },
8 | extends: [
9 | 'eslint:recommended',
10 | 'plugin:react/recommended',
11 | 'plugin:jsx-a11y/recommended'
12 | ],
13 | parser: 'babel-eslint',
14 | parserOptions: {
15 | sourceType: 'module'
16 | },
17 | plugins: ['react', 'jsx-a11y'],
18 | rules: {}
19 | };
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # npm ignore
2 | npm-debug.log
3 | node_modules/*
4 |
5 | # Sublime Text
6 | *.sublime-workspace
7 |
8 | # WebStorm IDE
9 | .idea/
10 |
11 | # vim
12 | *.swp
13 |
14 | # kdiff3
15 | *.orig
16 |
17 | # OSX
18 | Thumbs.db
19 | .DS_Store
20 |
21 | # IIS logs
22 | iisnode/
23 |
24 | # TernJs
25 | .tern-port
26 |
27 | # CTags
28 | tags
29 |
30 | # Code Coverage
31 | coverage/
32 |
33 | # ignores specific to this repo
34 | build/
35 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .git*
2 | _ignore/
3 | build/
4 | coverage/
5 | src/
6 | test/
7 | .DS_Store
8 | .npm-debug.log
9 | .project
10 | .travis.yml
11 | TODO.md
12 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - node
4 | - lts/*
5 | - 10
6 | before_script:
7 | - npm install -g gulp
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 skratchdot
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-github-corner
2 |
3 | [](http://badge.fury.io/js/react-github-corner)
4 | [](https://david-dm.org/skratchdot/react-github-corner)
5 | [](https://david-dm.org/skratchdot/react-github-corner#info=devDependencies)
6 |
7 | [](https://npmjs.org/package/react-github-corner)
8 |
9 |
10 | ## Description
11 |
12 | Add a Github banner to your project page. A React version of:
13 |
14 | - [https://github.com/tholman/github-corners](https://github.com/tholman/github-corners)
15 |
16 |
17 | ## Getting Started
18 |
19 | Install the module with: `npm install --save react-github-corner`
20 |
21 |
22 | ## Usage
23 |
24 | ```javascript
25 | import React, { Component } from 'react';
26 | import GithubCorner from 'react-github-corner';
27 | export default class MyApp extends Component {
28 | render() {
29 | return (
30 |
31 |
32 |
Cool
33 |
34 |
35 |
36 | );
37 | }
38 | }
39 | ```
40 |
41 |
42 | ## Documentation
43 |
44 | Here are the props you can pass to the `GithubCorner` instance:
45 |
46 | | Property Name | Type | Default Value | Description |
47 | |:-------------:|:----:|:-------------:|-------------|
48 | | href | String | '/' | The link to your project page |
49 | | size | Number or String | 80 | The width and height of the banner |
50 | | direction | String | 'right' | Whether the banner shows up on the right or left |
51 | | octoColor | String | '#fff' | The CSS color of the Octocat |
52 | | bannerColor | String | '#151513' | The CSS color of the banner |
53 | | ariaLabel | String | 'Open GitHub project' | The aria-label for a11y support |
54 | | className | String | undefined | Additional class names to be merged with the `github-corner` default |
55 | | svgStyle | Object | undefined | Custom styles to apply to the main `svg` element |
56 |
57 | Any additional props will be added to the `` tag that is rendered.
58 | For instance, you can do:
59 | ```
60 |
61 | ```
62 | and the `style` attribute will be rendered (which will hide the element).
63 |
64 |
65 | ## Links
66 |
67 | - [Source Code](https://github.com/skratchdot/react-github-corner/)
68 | - [Project Page](http://projects.skratchdot.com/react-github-corner/)
69 | - [Project Page Source](https://github.com/skratchdot/react-github-corner/tree/gh-pages)
70 |
71 |
72 | ## License
73 | Copyright (c) 2015 [skratchdot](http://skratchdot.com/)
74 | Licensed under the [MIT license](LICENSE-MIT).
75 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { CSSProperties, AnchorHTMLAttributes } from 'react';
3 |
4 | interface GithubCornerProps extends AnchorHTMLAttributes {
5 | href?: string;
6 | size?: number | string;
7 | direction?: string;
8 | octoColor?: string;
9 | bannerColor?: string;
10 | ariaLabel?: string;
11 | className?: string;
12 | svgStyle?: CSSProperties;
13 | }
14 |
15 | export default class GithubCorner extends React.Component {
16 | }
17 |
--------------------------------------------------------------------------------
/lib/GithubCorner.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _react = require('react');
12 |
13 | var _react2 = _interopRequireDefault(_react);
14 |
15 | var _getGithubCornerStyles = require('./get-github-corner-styles.js');
16 |
17 | var _getGithubCornerStyles2 = _interopRequireDefault(_getGithubCornerStyles);
18 |
19 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20 |
21 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
22 |
23 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24 |
25 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
26 |
27 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
28 |
29 | var githubCornerStyleId = '____GITHUB_CORNER_SUPER_SECRET___';
30 | var githubCornerStyles = (0, _getGithubCornerStyles2.default)();
31 |
32 | /**
33 | * A react component based off of:
34 | * https://github.com/tholman/github-corners
35 | *
36 | * @class GithubCorner
37 | * @extends React.Component
38 | * @example
39 | *
40 | */
41 |
42 | var GithubCorner = function (_Component) {
43 | _inherits(GithubCorner, _Component);
44 |
45 | function GithubCorner() {
46 | _classCallCheck(this, GithubCorner);
47 |
48 | return _possibleConstructorReturn(this, (GithubCorner.__proto__ || Object.getPrototypeOf(GithubCorner)).apply(this, arguments));
49 | }
50 |
51 | _createClass(GithubCorner, [{
52 | key: 'componentDidMount',
53 | value: function componentDidMount() {
54 | if (!document.getElementById(githubCornerStyleId)) {
55 | var head = document.head || document.getElementsByTagName('head')[0];
56 | var style = document.createElement('style');
57 | style.type = 'text/css';
58 | style.id = githubCornerStyleId;
59 | if (style.styleSheet) {
60 | style.styleSheet.cssText = githubCornerStyles;
61 | } else {
62 | style.appendChild(document.createTextNode(githubCornerStyles));
63 | }
64 | head.appendChild(style);
65 | }
66 | }
67 | }, {
68 | key: 'render',
69 | value: function render() {
70 | var _props = this.props,
71 | href = _props.href,
72 | size = _props.size,
73 | direction = _props.direction,
74 | octoColor = _props.octoColor,
75 | bannerColor = _props.bannerColor,
76 | ariaLabel = _props.ariaLabel,
77 | className = _props.className,
78 | svgStyle = _props.svgStyle,
79 | otherProps = _objectWithoutProperties(_props, ['href', 'size', 'direction', 'octoColor', 'bannerColor', 'ariaLabel', 'className', 'svgStyle']);
80 |
81 | var mainStyle = {
82 | position: 'absolute',
83 | top: 0,
84 | fill: octoColor
85 | };
86 | var armStyle = {};
87 | var pathBanner = '';
88 | var pathArm = '';
89 | var pathBody = '';
90 | if (direction === 'left') {
91 | pathBanner = 'M250 0L135 115h-15l-12 27L0 250V0z';
92 | pathArm = 'M122 109c15-9 9-19 9-19-3-7-2-11-2-11 1-7-3-2-3-2-4 5-2 11-2 11 3 10-5 15-9 16';
93 | pathBody = 'M135 115s-4 2-5 0l-14-14c-3-2-6-3-8-3 8-11 15-24-2-41-5-5-10-7-16-7-1-2-3-7-12-11 0 0-5 3-7 16-4 2-8 5-12 9s-7 8-9 12c-14 4-17 9-17 9 4 8 9 11 11 11 0 6 2 11 7 16 16 16 30 10 41 2 0 3 1 7 5 11l12 11c1 2-1 6-1 6z';
94 | mainStyle.left = 0;
95 | armStyle.WebkitTransformOrigin = '120px 144px';
96 | armStyle.transformOrigin = '120px 144px';
97 | } else {
98 | pathBanner = 'M0 0l115 115h15l12 27 108 108V0z';
99 | pathArm = 'M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16';
100 | pathBody = 'M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z';
101 | mainStyle.right = 0;
102 | armStyle.WebkitTransformOrigin = '130px 106px';
103 | armStyle.transformOrigin = '130px 106px';
104 | }
105 | var additionalClass = typeof className === 'string' ? ' ' + className : '';
106 | return _react2.default.createElement(
107 | 'a',
108 | _extends({}, otherProps, {
109 | href: href,
110 | className: 'github-corner' + additionalClass,
111 | 'aria-label': ariaLabel
112 | }),
113 | _react2.default.createElement(
114 | 'svg',
115 | {
116 | width: size,
117 | height: size,
118 | viewBox: '0 0 250 250',
119 | style: _extends({}, mainStyle, svgStyle)
120 | },
121 | _react2.default.createElement('path', { className: 'octo-banner', d: pathBanner, fill: bannerColor }),
122 | _react2.default.createElement('path', { className: 'octo-arm', d: pathArm, style: armStyle }),
123 | _react2.default.createElement('path', { className: 'octo-body', d: pathBody })
124 | )
125 | );
126 | }
127 | }]);
128 |
129 | return GithubCorner;
130 | }(_react.Component);
131 |
132 | GithubCorner.defaultProps = {
133 | href: '/',
134 | size: 80,
135 | direction: 'right',
136 | octoColor: '#fff',
137 | bannerColor: '#151513',
138 | ariaLabel: 'Open GitHub project'
139 | };
140 | exports.default = GithubCorner;
141 | //# sourceMappingURL=GithubCorner.js.map
--------------------------------------------------------------------------------
/lib/GithubCorner.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/lib/GithubCorner.js"],"names":["githubCornerStyleId","githubCornerStyles","GithubCorner","document","getElementById","head","getElementsByTagName","style","createElement","type","id","styleSheet","cssText","appendChild","createTextNode","props","href","size","direction","octoColor","bannerColor","ariaLabel","className","svgStyle","otherProps","mainStyle","position","top","fill","armStyle","pathBanner","pathArm","pathBody","left","WebkitTransformOrigin","transformOrigin","right","additionalClass","Component","defaultProps"],"mappings":";;;;;;;;;;AAAA;;;;AAEA;;;;;;;;;;;;;;AAEA,IAAMA,sBAAsB,mCAA5B;AACA,IAAMC,qBAAqB,sCAA3B;;AAEA;;;;;;;;;;IASqBC,Y;;;;;;;;;;;wCAmBC;AAClB,UAAI,CAACC,SAASC,cAAT,CAAwBJ,mBAAxB,CAAL,EAAmD;AACjD,YAAMK,OAAOF,SAASE,IAAT,IAAiBF,SAASG,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAA9B;AACA,YAAMC,QAAQJ,SAASK,aAAT,CAAuB,OAAvB,CAAd;AACAD,cAAME,IAAN,GAAa,UAAb;AACAF,cAAMG,EAAN,GAAWV,mBAAX;AACA,YAAIO,MAAMI,UAAV,EAAsB;AACpBJ,gBAAMI,UAAN,CAAiBC,OAAjB,GAA2BX,kBAA3B;AACD,SAFD,MAEO;AACLM,gBAAMM,WAAN,CAAkBV,SAASW,cAAT,CAAwBb,kBAAxB,CAAlB;AACD;AACDI,aAAKQ,WAAL,CAAiBN,KAAjB;AACD;AACF;;;6BACQ;AAAA,mBAWH,KAAKQ,KAXF;AAAA,UAELC,IAFK,UAELA,IAFK;AAAA,UAGLC,IAHK,UAGLA,IAHK;AAAA,UAILC,SAJK,UAILA,SAJK;AAAA,UAKLC,SALK,UAKLA,SALK;AAAA,UAMLC,WANK,UAMLA,WANK;AAAA,UAOLC,SAPK,UAOLA,SAPK;AAAA,UAQLC,SARK,UAQLA,SARK;AAAA,UASLC,QATK,UASLA,QATK;AAAA,UAUFC,UAVE;;AAYP,UAAMC,YAAY;AAChBC,kBAAU,UADM;AAEhBC,aAAK,CAFW;AAGhBC,cAAMT;AAHU,OAAlB;AAKA,UAAMU,WAAW,EAAjB;AACA,UAAIC,aAAa,EAAjB;AACA,UAAIC,UAAU,EAAd;AACA,UAAIC,WAAW,EAAf;AACA,UAAId,cAAc,MAAlB,EAA0B;AACxBY,qBAAa,oCAAb;AACAC,kBACE,gFADF;AAEAC,mBACE,qNADF;AAEAP,kBAAUQ,IAAV,GAAiB,CAAjB;AACAJ,iBAASK,qBAAT,GAAiC,aAAjC;AACAL,iBAASM,eAAT,GAA2B,aAA3B;AACD,OATD,MASO;AACLL,qBAAa,kCAAb;AACAC,kBACE,iFADF;AAEAC,mBACE,kNADF;AAEAP,kBAAUW,KAAV,GAAkB,CAAlB;AACAP,iBAASK,qBAAT,GAAiC,aAAjC;AACAL,iBAASM,eAAT,GAA2B,aAA3B;AACD;AACD,UAAME,kBACJ,OAAOf,SAAP,KAAqB,QAArB,SAAoCA,SAApC,GAAkD,EADpD;AAEA,aACE;AAAA;AAAA,qBACME,UADN;AAEE,gBAAMR,IAFR;AAGE,uCAA2BqB,eAH7B;AAIE,wBAAYhB;AAJd;AAME;AAAA;AAAA;AACE,mBAAOJ,IADT;AAEE,oBAAQA,IAFV;AAGE,qBAAQ,aAHV;AAIE,gCACKQ,SADL,EAEKF,QAFL;AAJF;AASE,kDAAM,WAAU,aAAhB,EAA8B,GAAGO,UAAjC,EAA6C,MAAMV,WAAnD,GATF;AAUE,kDAAM,WAAU,UAAhB,EAA2B,GAAGW,OAA9B,EAAuC,OAAOF,QAA9C,GAVF;AAWE,kDAAM,WAAU,WAAhB,EAA4B,GAAGG,QAA/B;AAXF;AANF,OADF;AAsBD;;;;EAjGuCM,gB;;AAArBpC,Y,CAWZqC,Y,GAAe;AACpBvB,QAAM,GADc;AAEpBC,QAAM,EAFc;AAGpBC,aAAW,OAHS;AAIpBC,aAAW,MAJS;AAKpBC,eAAa,SALO;AAMpBC,aAAW;AANS,C;kBAXHnB,Y","file":"GithubCorner.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport getGithubCornerStyles from './get-github-corner-styles.js';\n\nconst githubCornerStyleId = '____GITHUB_CORNER_SUPER_SECRET___';\nconst githubCornerStyles = getGithubCornerStyles();\n\n/**\n * A react component based off of:\n * https://github.com/tholman/github-corners\n *\n * @class GithubCorner\n * @extends React.Component\n * @example\n * \n */\nexport default class GithubCorner extends Component {\n static propTypes = {\n href: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n direction: PropTypes.string,\n octoColor: PropTypes.string,\n bannerColor: PropTypes.string,\n ariaLabel: PropTypes.string,\n className: PropTypes.string,\n svgStyle: PropTypes.object\n };\n static defaultProps = {\n href: '/',\n size: 80,\n direction: 'right',\n octoColor: '#fff',\n bannerColor: '#151513',\n ariaLabel: 'Open GitHub project'\n };\n componentDidMount() {\n if (!document.getElementById(githubCornerStyleId)) {\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.type = 'text/css';\n style.id = githubCornerStyleId;\n if (style.styleSheet) {\n style.styleSheet.cssText = githubCornerStyles;\n } else {\n style.appendChild(document.createTextNode(githubCornerStyles));\n }\n head.appendChild(style);\n }\n }\n render() {\n const {\n href,\n size,\n direction,\n octoColor,\n bannerColor,\n ariaLabel,\n className,\n svgStyle,\n ...otherProps\n } = this.props;\n const mainStyle = {\n position: 'absolute',\n top: 0,\n fill: octoColor\n };\n const armStyle = {};\n let pathBanner = '';\n let pathArm = '';\n let pathBody = '';\n if (direction === 'left') {\n pathBanner = 'M250 0L135 115h-15l-12 27L0 250V0z';\n pathArm =\n 'M122 109c15-9 9-19 9-19-3-7-2-11-2-11 1-7-3-2-3-2-4 5-2 11-2 11 3 10-5 15-9 16';\n pathBody =\n 'M135 115s-4 2-5 0l-14-14c-3-2-6-3-8-3 8-11 15-24-2-41-5-5-10-7-16-7-1-2-3-7-12-11 0 0-5 3-7 16-4 2-8 5-12 9s-7 8-9 12c-14 4-17 9-17 9 4 8 9 11 11 11 0 6 2 11 7 16 16 16 30 10 41 2 0 3 1 7 5 11l12 11c1 2-1 6-1 6z';\n mainStyle.left = 0;\n armStyle.WebkitTransformOrigin = '120px 144px';\n armStyle.transformOrigin = '120px 144px';\n } else {\n pathBanner = 'M0 0l115 115h15l12 27 108 108V0z';\n pathArm =\n 'M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16';\n pathBody =\n 'M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z';\n mainStyle.right = 0;\n armStyle.WebkitTransformOrigin = '130px 106px';\n armStyle.transformOrigin = '130px 106px';\n }\n const additionalClass =\n typeof className === 'string' ? ` ${className}` : '';\n return (\n \n \n \n );\n }\n}\n"]}
--------------------------------------------------------------------------------
/lib/get-github-corner-styles.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | exports.default = function () {
8 | return "\n.github-corner:hover .octo-arm {\n animation: octocat-wave 560ms ease-in-out;\n}\n\n@keyframes octocat-wave {\n 0%, 100% {\n transform: rotate(0deg);\n }\n\n 20%, 60% {\n transform: rotate(-25deg);\n }\n\n 40%, 80% {\n transform: rotate(10deg);\n }\n}\n\n@media (max-width: 500px) {\n .github-corner:hover .octo-arm {\n animation: none;\n }\n\n .github-corner .octo-arm {\n animation: octocat-wave 560ms ease-in-out;\n }\n}\n";
9 | };
10 | //# sourceMappingURL=get-github-corner-styles.js.map
--------------------------------------------------------------------------------
/lib/get-github-corner-styles.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/lib/get-github-corner-styles.js"],"names":[],"mappings":";;;;;;kBAAe,YAAM;AACnB;AA6BD,C","file":"get-github-corner-styles.js","sourcesContent":["export default () => {\n return `\n.github-corner:hover .octo-arm {\n animation: octocat-wave 560ms ease-in-out;\n}\n\n@keyframes octocat-wave {\n 0%, 100% {\n transform: rotate(0deg);\n }\n\n 20%, 60% {\n transform: rotate(-25deg);\n }\n\n 40%, 80% {\n transform: rotate(10deg);\n }\n}\n\n@media (max-width: 500px) {\n .github-corner:hover .octo-arm {\n animation: none;\n }\n\n .github-corner .octo-arm {\n animation: octocat-wave 560ms ease-in-out;\n }\n}\n`;\n};\n"]}
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-github-corner",
3 | "description": "Add a Github banner to your project page. A React version of: https://github.com/tholman/github-corners",
4 | "version": "2.5.0",
5 | "homepage": "https://github.com/skratchdot/react-github-corner/",
6 | "files": [
7 | "lib/",
8 | "index.d.ts"
9 | ],
10 | "main": "./lib/GithubCorner.js",
11 | "author": {
12 | "name": "skratchdot",
13 | "url": "http://skratchdot.com/"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/skratchdot/react-github-corner.git"
18 | },
19 | "bugs": {
20 | "url": "https://github.com/skratchdot/react-github-corner/issues"
21 | },
22 | "engines": {
23 | "node": ">= 4.0.0"
24 | },
25 | "license": "MIT",
26 | "scripts": {
27 | "build": "npm-run-all clean format lint cover transpile webpack",
28 | "clean": "npm-run-all clean:coverage clean:lib clean:build",
29 | "clean:coverage": "rimraf coverage/",
30 | "clean:lib": "rimraf lib/",
31 | "clean:build": "rimraf build/",
32 | "cover": "jest --coverage",
33 | "predeploy": "npm run build",
34 | "deploy": "gh-pages -d build/prod",
35 | "format": "prettier --write --single-quote 'src/**/*.js' '*.js'",
36 | "lint": "eslint src",
37 | "test": "jest",
38 | "transpile": "cross-env BABEL_ENV=production babel -s true --ignore test.js -d lib src/lib ",
39 | "start": "webpack-dev-server",
40 | "webpack": "npm-run-all webpack:dev webpack:prod",
41 | "webpack:dev": "cross-env NODE_ENV=development webpack",
42 | "webpack:prod": "cross-env NODE_ENV=production webpack"
43 | },
44 | "dependencies": {},
45 | "peerDependencies": {
46 | "react": "*"
47 | },
48 | "devDependencies": {
49 | "babel-cli": "^6.26.0",
50 | "babel-core": "^6.26.3",
51 | "babel-eslint": "^9.0.0",
52 | "babel-jest": "^23.6.0",
53 | "babel-loader": "^7.1.5",
54 | "babel-plugin-transform-react-remove-prop-types": "^0.4.15",
55 | "babel-preset-env": "^1.7.0",
56 | "babel-preset-react": "^6.5.0",
57 | "babel-preset-stage-0": "^6.24.1",
58 | "bootstrap": "^3.3.6",
59 | "copy-webpack-plugin": "^4.5.2",
60 | "cross-env": "^5.2.0",
61 | "css-loader": "^1.0.0",
62 | "enzyme": "^3.6.0",
63 | "enzyme-adapter-react-16": "^1.5.0",
64 | "eslint": "^5.6.0",
65 | "eslint-plugin-jsx-a11y": "^6.1.1",
66 | "eslint-plugin-react": "^7.11.1",
67 | "extract-text-webpack-plugin": "^3.0.2",
68 | "gh-pages": "^3.1.0",
69 | "html-loader": "^0.5.5",
70 | "jest": "^23.6.0",
71 | "jsdom": "^12.0.0",
72 | "less": "^3.8.1",
73 | "less-loader": "^4.1.0",
74 | "markdown-loader": "^4.0.0",
75 | "npm-run-all": "^4.1.5",
76 | "object-path-get": "^1.0.1",
77 | "prettier": "^1.14.2",
78 | "prop-types": "^15.6.2",
79 | "react": "^16.5.1",
80 | "react-bootstrap": "^0.32.4",
81 | "react-dom": "^16.5.1",
82 | "react-redux": "^5.0.7",
83 | "react-router-dom": "^4.3.1",
84 | "react-test-renderer": "^16.5.1",
85 | "redux": "^3.5.2",
86 | "redux-devtools": "^3.4.1",
87 | "redux-thunk": "^2.3.0",
88 | "rimraf": "^2.6.2",
89 | "url-loader": "^1.1.1",
90 | "webpack": "^3.10.0",
91 | "webpack-dev-server": "^2.10.0"
92 | },
93 | "jest": {
94 | "verbose": true,
95 | "collectCoverageFrom": [
96 | "src/lib/**/*.js"
97 | ],
98 | "coverageReporters": [
99 | "text-summary",
100 | "html",
101 | "json",
102 | "lcovonly"
103 | ],
104 | "setupTestFrameworkScriptFile": "/src/__testutils__/setup.js"
105 | },
106 | "keywords": [
107 | "react",
108 | "react-component",
109 | "github",
110 | "banner",
111 | "corner",
112 | "flag",
113 | "header",
114 | "href",
115 | "link"
116 | ]
117 | }
118 |
--------------------------------------------------------------------------------
/src/__testutils__/setup.js:
--------------------------------------------------------------------------------
1 | import Enzyme from 'enzyme';
2 | import Adapter from 'enzyme-adapter-react-16';
3 |
4 | Enzyme.configure({ adapter: new Adapter() });
5 |
--------------------------------------------------------------------------------
/src/app/components/Footer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Row, Col } from 'react-bootstrap';
3 | import { connect } from 'react-redux';
4 |
5 | class Footer extends Component {
6 | render() {
7 | return (
8 |
23 | );
24 | }
25 | }
26 |
27 | export default connect()(Footer);
28 |
--------------------------------------------------------------------------------
/src/app/components/Header.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Link, withRouter } from 'react-router-dom';
3 | import { Row, Col, Nav } from 'react-bootstrap';
4 | import PropTypes from 'prop-types';
5 | import { connect } from 'react-redux';
6 | const packageInfo = require('../../../package.json');
7 |
8 | class Header extends Component {
9 | static propTypes = {
10 | match: PropTypes.object.isRequired
11 | };
12 | getActiveClass(pathname) {
13 | const { match } = this.props;
14 | return pathname === match.path ? 'active' : '';
15 | }
16 | render() {
17 | return (
18 |
19 |
20 |
21 |
22 |
23 | react-github-corner
24 | version {packageInfo.version}
25 |
26 |
27 |
28 |
29 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | );
55 | }
56 | }
57 |
58 | export default withRouter(connect()(Header));
59 |
--------------------------------------------------------------------------------
/src/app/constants/ActionTypes.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skratchdot/react-github-corner/28cc81c7c20e3b6f1a95e4297e6e7d5d6e18063c/src/app/constants/ActionTypes.js
--------------------------------------------------------------------------------
/src/app/containers/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Grid } from 'react-bootstrap';
3 | import pathGet from 'object-path-get';
4 | import Header from '../components/Header';
5 | import Footer from '../components/Footer';
6 | import GithubCorner from '../../lib/GithubCorner';
7 | import PropTypes from 'prop-types';
8 | import stringToCssName from '../helpers/stringToCssName';
9 | import { connect } from 'react-redux';
10 | import { withRouter } from 'react-router';
11 |
12 | class App extends Component {
13 | static propTypes = {
14 | children: PropTypes.node,
15 | match: PropTypes.object.isRequired
16 | };
17 | render() {
18 | const path = pathGet(this, 'props.match.path', '');
19 | const githubUrl = 'https://github.com/skratchdot/react-github-corner';
20 | return (
21 |
22 |
23 |
24 | {this.props.children}
25 |
26 |
27 |
28 |
29 | );
30 | }
31 | }
32 |
33 | export default withRouter(connect()(App));
34 |
--------------------------------------------------------------------------------
/src/app/helpers/stringToCssName.js:
--------------------------------------------------------------------------------
1 | export default name => {
2 | return name.toLowerCase().replace(/[^a-z0-9]/gi, '-');
3 | };
4 |
--------------------------------------------------------------------------------
/src/app/images/ajax-loader.gif:
--------------------------------------------------------------------------------
1 | GIF89a � ���� ���億ﶶꚚ�66�VV����������� !�NETSCAPE2.0 !�Created with ajaxload.info !�
2 | , ��Iia����bK�$�F�RA�T�,�2S�*05//�m�p!z���0;$�0C�.I*!�HC(A@o�!39T5�\�8)�
��`�dwxG=Y
3 | g�wHb�vA=�0 V\�\�; ����;���H��������0��t%�Hs��rY