@@ -4,6 +4,7 @@ import { Linkify } from 'react-easy-linkify';
44import { Platform , StyleSheet , View } from 'react-native' ;
55
66import { colors , useLayout , A , darkColors , Headline } from '~/common/styleguide' ;
7+ import UpdatedAtView from '~/components/Library/UpdateAtView' ;
78import CustomAppearanceContext from '~/context/CustomAppearanceContext' ;
89import { Library as LibraryType } from '~/types' ;
910
@@ -46,25 +47,47 @@ const Library = ({ library, skipMetadata, showTrendingMark }: Props) => {
4647 library . unmaintained && styles . unmaintained ,
4748 ] } >
4849 < View style = { styles . columnOne } >
49- { library . unmaintained && < UnmaintainedLabel alternatives = { library . alternatives } /> }
50+ { library . unmaintained && (
51+ < View
52+ style = {
53+ isSmallScreen
54+ ? [
55+ styles . containerColumn ,
56+ styles . updatedAtContainerSmall ,
57+ { marginBottom : 6 , gap : 0 } ,
58+ ]
59+ : [ styles . updatedAtContainer , styles . trendingMarkContainer ]
60+ } >
61+ < UnmaintainedLabel alternatives = { library . alternatives } />
62+ < UpdatedAtView library = { library } />
63+ </ View >
64+ ) }
5065 { showTrendingMark && library . popularity && (
51- < Tooltip
52- sideOffset = { 8 }
53- trigger = {
54- < View style = { styles . trendingMarkContainer } >
55- < TrendingMark library = { library } />
56- </ View >
66+ < View
67+ style = {
68+ isSmallScreen
69+ ? [ styles . containerColumn , styles . updatedAtContainerSmall ]
70+ : [ styles . updatedAtContainer , { marginBottom : 4 } ]
5771 } >
58- Trending Score is based on the last week to last month download rate.
59- </ Tooltip >
72+ < Tooltip sideOffset = { 8 } trigger = { < TrendingMark library = { library } /> } >
73+ Trending Score is based on the last week to last month download rate.
74+ </ Tooltip >
75+ { ! library . unmaintained && < UpdatedAtView library = { library } /> }
76+ </ View >
6077 ) }
61- < View style = { isSmallScreen ? styles . containerColumn : styles . displayHorizontal } >
78+ < View
79+ style = {
80+ isSmallScreen
81+ ? [ styles . containerColumn , styles . updatedAtContainerSmall ]
82+ : styles . updatedAtContainer
83+ } >
6284 < A
6385 href = { library . githubUrl || github . urls . repo }
6486 style = { styles . name }
6587 hoverStyle = { { color : isDark ? colors . gray3 : colors . gray5 } } >
6688 { libName }
6789 </ A >
90+ { ! showTrendingMark && ! library . unmaintained && < UpdatedAtView library = { library } /> }
6891 </ View >
6992 < View style = { styles . verticalMargin } >
7093 < CompatibilityTags library = { library } />
@@ -74,11 +97,7 @@ const Library = ({ library, skipMetadata, showTrendingMark }: Props) => {
7497 < Headline numberOfLines = { skipMetadata && 3 } style = { { fontWeight : 300 , lineHeight : 23 } } >
7598 < Linkify
7699 options = { {
77- linkWrapper : ( { children, key, ...rest } ) => (
78- < A { ...rest } key = { key } >
79- { children }
80- </ A >
81- ) ,
100+ linkWrapper : ( { children, ...rest } ) => < A { ...rest } > { children } </ A > ,
82101 } } >
83102 { emoji . emojify ( github . description ) }
84103 </ Linkify >
@@ -195,7 +214,7 @@ const styles = StyleSheet.create({
195214 } ,
196215 imagesContainer : {
197216 flexWrap : 'wrap' ,
198- marginTop : 12 ,
217+ marginTop : 8 ,
199218 } ,
200219 secondaryStats : {
201220 marginTop : 6 ,
@@ -240,6 +259,23 @@ const styles = StyleSheet.create({
240259 opacity : 0.88 ,
241260 } ,
242261 trendingMarkContainer : {
262+ justifyContent : 'space-between' ,
263+ marginBottom : 4 ,
264+ } ,
265+ link : {
266+ fontSize : 13 ,
267+ fontWeight : 300 ,
268+ backgroundColor : 'transparent' ,
269+ } ,
270+ updatedAtContainer : {
271+ gap : 8 ,
272+ flexDirection : 'row' ,
273+ alignItems : 'flex-start' ,
274+ justifyContent : 'space-between' ,
275+ } ,
276+ updatedAtContainerSmall : {
277+ gap : 8 ,
278+ justifyContent : 'flex-start' ,
243279 alignSelf : 'flex-start' ,
244280 } ,
245281} ) ;
0 commit comments