11import { View } from 'react-native' ;
22
3- import { A } from '~/common/styleguide' ;
3+ import { A , useLayout } from '~/common/styleguide' ;
44import { type LibraryType } from '~/types' ;
55import tw from '~/util/tailwind' ;
66
@@ -11,9 +11,12 @@ import Tooltip from './Tooltip';
1111
1212type Props = {
1313 library : LibraryType ;
14+ small ?: boolean ;
1415} ;
1516
16- export default function CompatibilityTags ( { library } : Props ) {
17+ export default function CompatibilityTags ( { library, small } : Props ) {
18+ const { isSmallScreen } = useLayout ( ) ;
19+
1720 const platforms = [
1821 library . android ? 'Android' : null ,
1922 library . ios ? 'iOS' : null ,
@@ -25,63 +28,67 @@ export default function CompatibilityTags({ library }: Props) {
2528 ] . filter ( Boolean ) ;
2629
2730 return (
28- < View style = { tw `flex-row flex-wrap items-center gap-1.5` } >
31+ < View style = { tw `max-w-full flex-row flex-wrap items-center gap-1.5` } >
2932 { library . dev ? (
3033 < Tag
3134 label = "Development Tool"
3235 tagStyle = { tw `border-[#d9c8fa] bg-[#ece3fc] dark:border-[#3d2861] dark:bg-[#261a3d]` }
3336 icon = { null }
37+ small = { small }
3438 />
3539 ) : null }
3640 { library . template ? (
3741 < Tag
3842 label = "Template"
3943 tagStyle = { tw `border-[#f5c6e8] bg-[#fce1f5] dark:border-[#52213e] dark:bg-[#37172e]` }
4044 icon = { null }
45+ small = { small }
4146 />
4247 ) : null }
43- { ! library . dev && ! library . template && < NewArchitectureTag library = { library } /> }
48+ { ! library . dev && ! library . template && < NewArchitectureTag library = { library } small = { small } /> }
4449 { platforms . map ( platform =>
4550 platform ? (
4651 < Tag
4752 label = { platform }
4853 key = { `${ platform } -platform` }
4954 tagStyle = { tw `border-palette-gray2 bg-palette-gray1 dark:border-default dark:bg-dark` }
55+ small = { small }
5056 />
5157 ) : null
5258 ) }
53- { ( library . expoGo ?? library . fireos ?? library . vegaos ?? library . horizon ) && (
54- < Tooltip
55- side = "bottom"
56- trigger = {
57- < View
58- style = { tw `cursor-pointer items-center justify-center rounded-full` }
59- role = "button"
60- aria-label = "Additional information" >
61- < Info style = { tw `text-icon` } />
62- </ View >
63- } >
64- Additional information
65- < br />
66- < ul style = { tw `m-0 pl-3.5` } >
67- { library . expoGo && < li > Works with Expo Go</ li > }
68- { library . fireos && < li > Works with Fire OS</ li > }
69- { library . horizon && < li > Works with Meta Horizon OS</ li > }
70- { library . vegaos && typeof library . vegaos === 'boolean' && < li > Works with Vega OS</ li > }
71- { library . vegaos && typeof library . vegaos === 'string' && (
72- < li >
73- Works with Vega OS
74- < br />
75- < A
76- href = { `https://www.npmjs.com/package/${ library . vegaos } ` }
77- style = { tw `text-xs font-light text-white` } >
78- (via dedicated support package)
79- </ A >
80- </ li >
81- ) }
82- </ ul >
83- </ Tooltip >
84- ) }
59+ { ! ( small && isSmallScreen ) &&
60+ ( library . expoGo ?? library . fireos ?? library . vegaos ?? library . horizon ) && (
61+ < Tooltip
62+ side = "bottom"
63+ trigger = {
64+ < View
65+ style = { tw `cursor-pointer items-center justify-center rounded-full` }
66+ role = "button"
67+ aria-label = "Additional information" >
68+ < Info style = { tw `text-icon` } />
69+ </ View >
70+ } >
71+ Additional information
72+ < br />
73+ < ul style = { tw `m-0 pl-3.5` } >
74+ { library . expoGo && < li > Works with Expo Go</ li > }
75+ { library . fireos && < li > Works with Fire OS</ li > }
76+ { library . horizon && < li > Works with Meta Horizon OS</ li > }
77+ { library . vegaos && typeof library . vegaos === 'boolean' && < li > Works with Vega OS</ li > }
78+ { library . vegaos && typeof library . vegaos === 'string' && (
79+ < li >
80+ Works with Vega OS
81+ < br />
82+ < A
83+ href = { `https://www.npmjs.com/package/${ library . vegaos } ` }
84+ style = { tw `text-xs font-light text-white` } >
85+ (via dedicated support package)
86+ </ A >
87+ </ li >
88+ ) }
89+ </ ul >
90+ </ Tooltip >
91+ ) }
8592 </ View >
8693 ) ;
8794}
0 commit comments