1+ import React , { useState } from 'react' ;
2+ import { TouchableOpacity , Text , View , Linking } from 'react-native' ;
3+
4+ const RapidnativePill = ( ) => {
5+ const [ isPressed , setIsPressed ] = useState ( false ) ;
6+ const [ isHovered , setIsHovered ] = useState ( false ) ;
7+
8+ const handlePress = ( ) => {
9+ Linking . openURL ( 'https://rapidnative.com' ) ;
10+ } ;
11+
12+ return (
13+ < TouchableOpacity
14+ onPress = { handlePress }
15+ onPressIn = { ( ) => setIsPressed ( true ) }
16+ onPressOut = { ( ) => setIsPressed ( false ) }
17+ onMouseEnter = { ( ) => setIsHovered ( true ) }
18+ onMouseLeave = { ( ) => setIsHovered ( false ) }
19+ // backgroundColor: isPressed ? '#0891b2' : isHovered ? '#0e7490' : '#06b6d4',
20+ // backgroundColor: isPressed ? '##0891b2' : isHovered ? '#06b6d4' : '#0891b2',
21+ style = { {
22+ backgroundColor : isPressed ? '##0891b2' : isHovered ? '#0891b2' : '#06b6d4' ,
23+ paddingHorizontal : 12 ,
24+ paddingVertical : 6 ,
25+ borderRadius : 20 ,
26+ flexDirection : 'row' ,
27+ alignItems : 'center' ,
28+ justifyContent : 'center' ,
29+ shadowColor : '#000' ,
30+ shadowOffset : { width : 0 , height : 1 } ,
31+ shadowOpacity : isHovered ? 0.15 : 0.1 ,
32+ shadowRadius : isHovered ? 3 : 2 ,
33+ elevation : isHovered ? 3 : 2 ,
34+ transform : [ { scale : isPressed ? 0.98 : isHovered ? 1.02 : 1 } ] ,
35+ transition : 'all 0.2s ease' ,
36+ } }
37+ >
38+ < Text
39+ style = { {
40+ color : '#ffffff' ,
41+ fontSize : 14 ,
42+ fontWeight : '500' ,
43+ marginRight : 4 ,
44+ } }
45+ >
46+ Prompt to React Native UI
47+ </ Text >
48+ < Text
49+ style = { {
50+ color : '#ffffff' ,
51+ fontSize : 12 ,
52+ fontWeight : '400' ,
53+ } }
54+ >
55+ →
56+ </ Text >
57+ </ TouchableOpacity >
58+ ) ;
59+ } ;
60+
61+ export default RapidnativePill ;
0 commit comments