import React, {useState} from 'react' import {StyleSheet, Text, TextInput, TouchableOpacity, View} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {BottomSheetScrollView, BottomSheetTextInput} from '@gorhom/bottom-sheet' import {useStores} from '../../../state' import {s, colors} from '../../lib/styles' import { IS_PROD_BUILD, LOCAL_DEV_SERVICE, STAGING_SERVICE, PROD_SERVICE, } from '../../../state/index' export const snapPoints = ['80%'] export function Component({ initialService, onSelect, }: { initialService: string onSelect: (url: string) => void }) { const store = useStores() const [customUrl, setCustomUrl] = useState('') const doSelect = (url: string) => { if (!url.startsWith('http://') && !url.startsWith('https://')) { url = `https://${url}` } store.shell.closeModal() onSelect(url) } return ( Choose Service {!IS_PROD_BUILD ? ( <> doSelect(LOCAL_DEV_SERVICE)}> Local dev server doSelect(STAGING_SERVICE)}> Staging ) : undefined} doSelect(PROD_SERVICE)}> Bluesky.Social Other service doSelect(customUrl)}> ) } const styles = StyleSheet.create({ inner: { padding: 14, }, group: { marginBottom: 20, }, label: { fontWeight: 'bold', paddingHorizontal: 4, paddingBottom: 4, }, textInput: { flex: 1, borderWidth: 1, borderColor: colors.gray3, borderTopLeftRadius: 6, borderBottomLeftRadius: 6, paddingHorizontal: 14, paddingVertical: 12, fontSize: 16, }, textInputBtn: { borderWidth: 1, borderLeftWidth: 0, borderColor: colors.gray3, borderTopRightRadius: 6, borderBottomRightRadius: 6, paddingHorizontal: 14, paddingVertical: 10, }, btn: { flexDirection: 'row', alignItems: 'center', backgroundColor: colors.blue3, borderRadius: 6, paddingHorizontal: 14, paddingVertical: 10, marginBottom: 6, }, btnText: { flex: 1, fontSize: 18, fontWeight: '500', color: colors.white, }, })