import React, {useState} from 'react' import { Animated, Image, SafeAreaView, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View, } from 'react-native' import {TabView, SceneMap, Route, TabBarProps} from 'react-native-tab-view' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {UserGroupIcon} from '../../lib/icons' import {useStores} from '../../../state' import {s} from '../../lib/styles' import {SCENE_EXPLAINER, TABS_EXPLAINER} from '../../lib/assets' const Intro = () => ( Welcome to Bluesky Let's do a quick tour through the new features. ) const Scenes = () => ( Scenes Scenes are invite-only groups of users. Follow them to see what's trending with the scene's members. ) const Tabs = () => ( Tabs Never lose your place! Long-press to open posts and profiles in a new tab. ) const SCENE_MAP = { intro: Intro, scenes: Scenes, tabs: Tabs, } const renderScene = SceneMap(SCENE_MAP) export const FeatureExplainer = () => { const layout = useWindowDimensions() const store = useStores() const [index, setIndex] = useState(0) const routes = [ {key: 'intro', title: 'Intro'}, {key: 'scenes', title: 'Scenes'}, {key: 'tabs', title: 'Tabs'}, ] const onPressSkip = () => store.onboard.next() const onPressNext = () => { if (index >= routes.length - 1) { store.onboard.next() } else { setIndex(index + 1) } } const renderTabBar = (props: TabBarProps) => { const inputRange = props.navigationState.routes.map((x, i) => i) return ( {props.navigationState.routes.map((route, i) => { const opacity = props.position.interpolate({ inputRange, outputRange: inputRange.map(inputIndex => inputIndex === i ? 1 : 0.5, ), }) return ( setIndex(i)}> ° ) })} ) } const FirstExplainer = SCENE_MAP[routes[0]?.key as keyof typeof SCENE_MAP] return ( {routes.length > 1 ? ( ) : FirstExplainer ? ( ) : ( )} Skip Next ) } const styles = StyleSheet.create({ container: { flex: 1, }, tabBar: { flexDirection: 'row', }, tabItem: { alignItems: 'center', padding: 16, }, explainer: { flex: 1, paddingHorizontal: 16, paddingTop: 80, }, explainerIcon: { flexDirection: 'row', }, explainerHeading: { fontSize: 42, fontWeight: 'bold', textAlign: 'center', marginBottom: 16, }, explainerDesc: { fontSize: 18, textAlign: 'center', marginBottom: 16, }, explainerImg: { resizeMode: 'contain', maxWidth: '100%', maxHeight: 330, }, footer: { flexDirection: 'row', paddingHorizontal: 32, paddingBottom: 24, }, })