11/**
22 * @function GithubButton
33 */
4- import * as PropTypes from " prop-types" ;
5- import * as React from " react" ;
4+ import * as PropTypes from ' prop-types' ;
5+ import * as React from ' react' ;
66
7- import classes from " ../styles.css" ;
7+ import classes from ' ../styles.css' ;
88
9- import ForkIcon from " ./icons/forkIcon" ;
10- import StarIcon from " ./icons/starIcon" ;
11- import WatchIcon from " ./icons/watchIcon" ;
9+ import ForkIcon from ' ./icons/forkIcon' ;
10+ import StarIcon from ' ./icons/starIcon' ;
11+ import WatchIcon from ' ./icons/watchIcon' ;
1212import UsedByIcon from './icons/usedByIcon' ;
1313import SponsorIcon from './icons/sponsorIcon' ;
1414
@@ -28,38 +28,38 @@ function getDataForVariant(
2828 let btnTitle : string ;
2929 let label : string ;
3030 let countUrl : string ;
31- if ( variant === " star" ) {
32- title = " Star" ;
31+ if ( variant === ' star' ) {
32+ title = ' Star' ;
3333 btnTitle = `Star ${ owner } /${ repo } ` ;
3434 label = `${ count } users starred this repository` ;
3535 countUrl = `https://github.com/${ owner } /${ repo } /stargazers` ;
3636 return { title, btnTitle, label, countUrl, Icon : StarIcon } ;
37- } else if ( variant === " fork" ) {
38- title = " Fork" ;
37+ } else if ( variant === ' fork' ) {
38+ title = ' Fork' ;
3939 btnTitle = `Fork your own copy of ${ owner } /${ repo } to your account` ;
4040 label = `${ count } users forked this repository` ;
4141 countUrl = `https://github.com/${ owner } /${ repo } /network/members` ;
4242 return { title, btnTitle, label, countUrl, Icon : ForkIcon } ;
43- } else if ( variant === " watch" ) {
44- title = " Watch" ;
45- btnTitle = "" ;
43+ } else if ( variant === ' watch' ) {
44+ title = ' Watch' ;
45+ btnTitle = '' ;
4646 label = `${ count } users are watching this repository` ;
4747 countUrl = `https://github.com/${ owner } /${ repo } /watchers` ;
4848 return { title, btnTitle, label, countUrl, Icon : WatchIcon } ;
49- } else if ( variant === " usedby" ) {
50- title = " Used by" ;
51- btnTitle = "" ;
49+ } else if ( variant === ' usedby' ) {
50+ title = ' Used by' ;
51+ btnTitle = '' ;
5252 label = `${ count } repositories depend on this package` ;
5353 countUrl = `https://github.com/${ owner } /${ repo } /network/dependents` ;
5454 return { title, btnTitle, label, countUrl, Icon : UsedByIcon } ;
55- } else if ( variant === " sponsor" ) {
56- title = " Sponsor" ;
55+ } else if ( variant === ' sponsor' ) {
56+ title = ' Sponsor' ;
5757 btnTitle = `Sponsor ${ owner } /${ repo } ` ;
58- label = "" ;
59- countUrl = "" ;
58+ label = '' ;
59+ countUrl = '' ;
6060 return { title, btnTitle, label, countUrl, Icon : SponsorIcon } ;
6161 }
62- throw new Error ( " Invalid Variant, supply one of [star, fork, watch, usedby, sponsor]" ) ;
62+ throw new Error ( ' Invalid Variant, supply one of [star, fork, watch, usedby, sponsor]' ) ;
6363}
6464
6565export interface IPropTypes {
@@ -74,7 +74,7 @@ export default function GithubButton(props: IPropTypes) {
7474 const { owner, repo, variant, count, showCount } = props ;
7575 const { title, btnTitle, label, countUrl, Icon } = getDataForVariant ( variant , count , owner , repo ) ;
7676
77- const inlineStyle = showCount ? { } : { borderRadius : " .25em" } ;
77+ const inlineStyle = showCount ? { } : { borderRadius : ' .25em' } ;
7878
7979 return (
8080 < div className = { classes . root } >
@@ -99,7 +99,7 @@ GithubButton.propTypes = {
9999 count : PropTypes . number ,
100100 owner : PropTypes . string . isRequired ,
101101 repo : PropTypes . string . isRequired ,
102- variant : PropTypes . oneOf ( [ " star" , " fork" , " watch" , " usedby" , " sponsor" ] ) ,
102+ variant : PropTypes . oneOf ( [ ' star' , ' fork' , ' watch' , ' usedby' , ' sponsor' ] ) ,
103103 showCount : PropTypes . bool ,
104104} ;
105105
0 commit comments