File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,16 @@ import React from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import { Query } from 'react-apollo'
4
4
import gql from 'graphql-tag'
5
+ import classNames from 'classnames'
6
+ import Odometer from 'react-odometerjs'
5
7
6
8
const StarCount = ( { githubStars, loading } ) => {
7
9
return (
8
- < a className = "StarCount" href = "https://github.com/GraphQLGuide/guide" >
9
- { githubStars }
10
+ < a
11
+ className = { classNames ( 'StarCount' , { loading } ) }
12
+ href = "https://github.com/GraphQLGuide/guide"
13
+ >
14
+ { githubStars && < Odometer value = { githubStars } /> }
10
15
</ a >
11
16
)
12
17
}
@@ -23,7 +28,7 @@ const STARS_QUERY = gql`
23
28
`
24
29
25
30
export default ( ) => (
26
- < Query query = { STARS_QUERY } >
31
+ < Query query = { STARS_QUERY } pollInterval = { 5 * 1000 } >
27
32
{ ( { data : { githubStars } , loading } ) => (
28
33
< StarCount githubStars = { githubStars } loading = { loading } />
29
34
) }
You can’t perform that action at this time.
0 commit comments