File tree 5 files changed +6223
-19
lines changed
5 files changed +6223
-19
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
const React = require ( 'react' )
9
+ const GitHubStarButton = require ( './GitHubStarButton' )
9
10
10
11
class Footer extends React . Component {
11
- docUrl ( doc , language ) {
12
+ docUrl ( doc , language ) {
12
13
const baseUrl = this . props . config . baseUrl
13
14
return baseUrl + 'docs/' + ( language ? language + '/' : '' ) + doc
14
15
}
15
16
16
- pageUrl ( doc , language ) {
17
+ pageUrl ( doc , language ) {
17
18
const baseUrl = this . props . config . baseUrl
18
19
return baseUrl + ( language ? language + '/' : '' ) + doc
19
20
}
20
21
21
- render ( ) {
22
+ render ( ) {
22
23
const currentYear = new Date ( ) . getFullYear ( )
23
24
return (
24
25
< footer className = 'nav-footer' id = 'footer' >
@@ -47,17 +48,7 @@ class Footer extends React.Component {
47
48
User Showcase
48
49
</ a >
49
50
< a href = 'https://gitter.im/isomorphic-git/Lobby' > Project Chat</ a >
50
- < a
51
- className = 'github-button'
52
- href = { this . props . config . repoUrl }
53
- data-icon = 'octicon-star'
54
- data-count-href = '/isomorphic-git/isomorphic-git/stargazers'
55
- data-show-count
56
- data-count-aria-label = '# stargazers on GitHub'
57
- aria-label = 'Star this project on GitHub'
58
- >
59
- Github
60
- </ a >
51
+ < GitHubStarButton />
61
52
</ div >
62
53
< div >
63
54
< h5 > More</ h5 >
Original file line number Diff line number Diff line change
1
+ const React = require ( 'react' )
2
+
3
+ const script = `
4
+ void async function() {
5
+ const response = await fetch('https://api.github.com/repos/isomorphic-git/isomorphic-git', {
6
+ headers: { accept: 'application/vnd.github.v3+json' }
7
+ })
8
+ const data = await response.json()
9
+ document.querySelector('#gitHubStars').textContent = '(' + data.stargazers_count + '⭐)'
10
+ }()
11
+ `
12
+
13
+ class GitHubStarButton extends React . Component {
14
+ render ( ) {
15
+ // "Server-side" rendered, so `componentDidMount` wouldn't be called
16
+ return (
17
+ < div >
18
+ < a href = "https://github.com/isomorphic-git/isomorphic-git" > GitHub < span id = "gitHubStars" /> </ a >
19
+ < script dangerouslySetInnerHTML = { { __html : script } } />
20
+ </ div >
21
+ ) ;
22
+ }
23
+ }
24
+
25
+ module . exports = GitHubStarButton
Original file line number Diff line number Diff line change 13
13
"checkout" : " checkout" ,
14
14
"clone" : " clone" ,
15
15
"commit" : " commit" ,
16
- "compare" : " How does it compare with X?" ,
17
- "Compare with X" : " Compare with X" ,
18
16
"config" : " config" ,
19
17
"currentBranch" : " currentBranch" ,
20
18
"dir-vs-gitdir" : " `dir` vs `gitdir`" ,
21
19
"dir vs gitdir" : " dir vs gitdir" ,
22
- "faq" : " Frequently Asked Questions" ,
23
- "FAQ" : " FAQ" ,
24
20
"fetch" : " fetch" ,
25
21
"findRoot" : " findRoot" ,
26
22
"getRemoteInfo" : " getRemoteInfo" ,
You can’t perform that action at this time.
0 commit comments