11import { useContext } from 'react' ;
2- import { Platform , StyleSheet , View } from 'react-native' ;
2+ import { Platform , StyleSheet , View , Text } from 'react-native' ;
33
44import { colors , A , P , Caption , darkColors } from '~/common/styleguide' ;
55import Tooltip from '~/components/Tooltip' ;
66import CustomAppearanceContext from '~/context/CustomAppearanceContext' ;
77import { type LibraryType , MetadataEntryType } from '~/types' ;
88import { partition } from '~/util/arrays' ;
99import { formatBytes } from '~/util/formatBytes' ;
10+ import { pluralize } from '~/util/strings' ;
1011
1112import { DirectoryScore } from './DirectoryScore' ;
1213import {
@@ -74,7 +75,7 @@ function generateData(
7475 < A
7576 href = { `https://www.npmjs.com/package/${ npmPkg } ?activeTab=dependencies` }
7677 style = { styles . link } >
77- { `${ github . stats . dependencies } ${ github . stats . dependencies === 1 ? 'dependency' : 'dependencies' } ` }
78+ { `${ github . stats . dependencies } ${ pluralize ( 'dependency' , github . stats . dependencies ) } ` }
7879 </ A >
7980 ) ,
8081 } ,
@@ -94,7 +95,7 @@ function generateData(
9495 id : 'forks' ,
9596 icon : < Fork fill = { iconColor } width = { 16 } height = { 17 } /> ,
9697 content : (
97- < A href = { `${ github . urls . repo } /network/members` } style = { styles . link } >
98+ < A href = { `${ github . urls . repo } /network/members` } style = { styles . link } aria-label = "Forks" >
9899 { `${ github . stats . forks . toLocaleString ( ) } ` }
99100 </ A >
100101 ) ,
@@ -106,7 +107,7 @@ function generateData(
106107 id : 'subscribers' ,
107108 icon : < Eye fill = { iconColor } /> ,
108109 content : (
109- < A href = { `${ github . urls . repo } /watchers` } style = { styles . link } >
110+ < A href = { `${ github . urls . repo } /watchers` } style = { styles . link } aria-label = "Watchers" >
110111 { `${ github . stats . subscribers . toLocaleString ( ) } ` }
111112 </ A >
112113 ) ,
@@ -118,7 +119,7 @@ function generateData(
118119 id : 'issues' ,
119120 icon : < Issue fill = { iconColor } /> ,
120121 content : (
121- < A href = { `${ github . urls . repo } /issues` } style = { styles . link } >
122+ < A href = { `${ github . urls . repo } /issues` } style = { styles . link } aria-label = "Issues" >
122123 { `${ github . stats . issues . toLocaleString ( ) } ` }
123124 </ A >
124125 ) ,
@@ -135,10 +136,10 @@ function generateSecondaryData({ github, examples }: LibraryType, isDark: boolea
135136 const iconColor = isDark ? darkColors . pewter : colors . secondary ;
136137 const paragraphStyles = [ styles . secondaryText , secondaryTextColor ] ;
137138 const linkStyles = [ ...paragraphStyles , styles . mutedLink ] ;
138- const hoverStyle = [
139- { textDecorationColor : isDark ? colors . gray6 : colors . gray4 } ,
140- isDark && { color : colors . primaryDark } ,
141- ] ;
139+ const hoverStyle = {
140+ textDecorationColor : colors . gray4 ,
141+ color : isDark ? colors . gray3 : colors . gray5 ,
142+ } ;
142143
143144 return [
144145 github . urls . homepage
@@ -246,7 +247,11 @@ export function MetaData({ library, secondary }: Props) {
246247 key = { id }
247248 sideOffset = { 2 }
248249 delayDuration = { 100 }
249- trigger = { < View style = { styles . iconContainer } > { icon } </ View > } >
250+ trigger = {
251+ < View style = { styles . iconContainer } >
252+ { icon }
253+ </ View >
254+ } >
250255 { tooltip }
251256 </ Tooltip >
252257 { content }
0 commit comments