@@ -14,6 +14,7 @@ import starIcon from '../../assets/icons/star.svg';
1414import storybookIcon from '../../assets/icons/storybook.svg' ;
1515import versionIcon from '../../assets/icons/version.svg' ;
1616import { ContributorList } from '../../components/ContributorList' ;
17+ import { GitHubStarButton } from '../../components/GitHubStarButton' ;
1718import { Link } from '../../components/Link' ;
1819import { useLocale } from '../../hooks/useLocale' ;
1920import { availablePlaygrounds } from '../../pages/libraries/[libId]/playground' ;
@@ -60,7 +61,6 @@ export const Library: React.FC<Props> = ({lib}) => {
6061 {
6162 id : 'stars' ,
6263 title : t ( 'library:stars' ) ,
63- value : lib . metadata . stars ,
6464 icon : starIcon ,
6565 } ,
6666 {
@@ -258,6 +258,18 @@ export const Library: React.FC<Props> = ({lib}) => {
258258 } }
259259 >
260260 < div className = { b ( 'info-title-text' ) } > { t ( 'library:about' ) } </ div >
261+
262+ < div
263+ className = { b ( 'github-star-mobile' , {
264+ 'mobile-invisible' : isVisibleInfoListMobile ,
265+ } ) }
266+ >
267+ < GitHubStarButton
268+ githubId = { lib . config . githubId }
269+ starCount = { lib . metadata . stars }
270+ />
271+ </ div >
272+
261273 < div
262274 className = { b ( 'info-title-icon' , {
263275 'mobile-visible' : isVisibleInfoListMobile ,
@@ -310,6 +322,27 @@ export const Library: React.FC<Props> = ({lib}) => {
310322 ) ;
311323 }
312324
325+ if ( item . id === 'stars' ) {
326+ return (
327+ < div
328+ key = { item . id }
329+ className = { b ( 'info-item' , {
330+ 'github-star' : true ,
331+ } ) }
332+ >
333+ < div className = { b ( 'github-star-content' ) } >
334+ < div className = { b ( 'github-star-text' ) } >
335+ { content }
336+ </ div >
337+ < GitHubStarButton
338+ githubId = { lib . config . githubId }
339+ starCount = { lib . metadata . stars }
340+ />
341+ </ div >
342+ </ div >
343+ ) ;
344+ }
345+
313346 return (
314347 < div key = { item . id } className = { b ( 'info-item' ) } >
315348 { content }
0 commit comments