Commit 4898dd5 1 parent c73deb1 commit 4898dd5 Copy full SHA for 4898dd5
File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,13 @@ import { useText } from 'jsx-dom-runtime';
2
2
3
3
import s from './styles.css' ;
4
4
5
- const getStars = ( ) : Text => {
6
- const [ stars , setStars ] = useText ( '-' ) ;
5
+ const [ stars , setStars ] = useText ( '-' ) ;
7
6
8
- if ( process . env . NODE_ENV === 'production' ) {
9
- fetch ( 'https://api.github.com/repos/shoonia/1x1' )
10
- . then ( ( response ) => response . json ( ) )
11
- . then ( ( data ) => setStars ( data . stargazers_count || '-' ) ) ;
12
- }
13
-
14
- return stars ;
15
- } ;
7
+ if ( process . env . NODE_ENV === 'production' ) {
8
+ fetch ( 'https://api.github.com/repos/shoonia/1x1' )
9
+ . then ( ( response ) => response . json ( ) )
10
+ . then ( ( data ) => setStars ( data . stargazers_count || '-' ) ) ;
11
+ }
16
12
17
13
export const Stars : JSX . FC = ( ) => (
18
14
< div class = { s . box } >
@@ -32,7 +28,7 @@ export const Stars: JSX.FC = () => (
32
28
tabIndex = { 0 }
33
29
class = { s . stars }
34
30
>
35
- { getStars ( ) }
31
+ { stars }
36
32
</ a >
37
33
</ div >
38
34
) ;
You can’t perform that action at this time.
0 commit comments