Copilot w/React-navigation, any idea how wrap a const with the copilot prop?
See original GitHub issueActually i have this progress (?) using this library w/react-navigation, exactly createBottomTabNavigator but the problem(s) are this: 1: This method (createBottomTabNavigator ) only works exporting a const 2: I dont know how to export this const with the copilot prefix (example: export default copilot()(CustomConst) If anyone knows how i can do this thing probably save my entire project My code:
import React, {Component} from 'react'
import { Image, View, SafeAreaView, StyleSheet, Text, AsyncStorage } from 'react-native'
import HomeScreen from '../screens/home/HomeScreen'
import {createBottomTabNavigator} from 'react-navigation-tabs'
import { Icon } from 'native-base'
import StatsStack from './StatsStack';
import ScannerScreen from '../screens/scanner/ScannerScreen';
import {
heightPercentageToDP as hp,
} from 'react-native-responsive-screen'
import { copilot, walkthroughable, CopilotStep } from 'react-native-copilot';
const WalkthroughableText = walkthroughable(Text);
const WalkthroughableImage = walkthroughable(Image);
class Null extends Component{
render(){
return <View/>
}
}
const nav = createBottomTabNavigator({
Home: {
screen: HomeScreen,
navigationOptions: () => ({
tabBarIcon: ({tintColor})=> {
return (
<CopilotStep text="This is your home screen. Here you can check past workouts, future workouts, and most importantly, today's suggested workout.." order={1} name="home">
<WalkthroughableText>
<Icon name={'home-outline'} type='MaterialCommunityIcons' style={{color: tintColor, fontSize: hp('4.5%')}}/>
</WalkthroughableText>
</CopilotStep>
)
}
}
)
},
Scanner: {
screen: ScannerScreen,
navigationOptions: ( ) => ({
header: null,
tabBarVisible: false,
tabBarIcon: ({tintColor})=> {
return (
<CopilotStep text="This is the session screen. Here you can activate EvenLift cameras and start your workout. Check www.evenlift.io/usage for detailed instructions." order={2} name="lift">
<WalkthroughableImage
small source={require('../assets/images/Logos/escanear-icon.png')}
style={{width: hp('8%'), height: hp('8%'), marginBottom: hp('3.5%')}}
>
</WalkthroughableImage>
</CopilotStep>
)
}
})
},
Stats: {
screen: StatsStack,
navigationOptions: () => ({
tabBarIcon: ({tintColor})=> {
return (
<CopilotStep text="This is the analysis screen, showing detailed summaries of your progress so far." order={3} name="ChartInfo">
<WalkthroughableText>
<Icon name={'chart-line'} type='MaterialCommunityIcons' style={{color: tintColor,fontSize: hp('4.5%')}}/>
</WalkthroughableText>
</CopilotStep>
)
}
}
)
}
}, {
tabBarOptions: {
style: {
backgroundColor: '#433650',
height: hp('6.5%')
},
activeTintColor: '#90D16B',
inactiveTintColor: '#312740',
showLabel: false,
scrollEnabled: true
},
initialRouteName: 'Home'
})
export default nav
// export default copilot({animated: true, stepNumberComponent: Null})(nav) Maybe something like this??
If anyone have questions about how i can divide the routes feel free to ask here in the comment box, actually if i export nav without the copilot react-native throw this errror TypeError: Cannot read property ‘getCurrrentStep’ of undefined
anyone help me pls :C
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Mohamad Mohebifar react-native-copilot Issues - Giters
Mohamad Mohebifar react-native-copilot: Step-by-step walkthrough for your ... Copilot w/React-navigation, any idea how wrap a const with the copilot prop?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ahmetozalp the only way i found to solution this is create a “false” intro view that shows exactly the same as the REAL bottomTabNavigation, and when the tour was finished redirect to the real bottomTabNavigation if you need more explanation let me know
thank you. @YisusMB