// Import Stuff /// React Native import * as React from 'react' import { useState } from "react"; import { Alert, AsyncStorage, Text, TextInput, UseState, View } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' import { WebView } from 'react-native-webview' import Modal from "react-native-modal"; /// React Native Navigation import { NavigationContainer } from '@react-navigation/native' import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs' /// Expo Modules import * as SystemUI from 'expo-system-ui' /// Options import ScreenOptions from './options/TabOptions' /// Stylesheets import Styles from './stylesheets/style' // Others SystemUI.setBackgroundColorAsync("black") const Tab = createMaterialTopTabNavigator() let InstanceURL = 'https://design.penpot.app/' _storeData = async () => { try { await AsyncStorage.setItem( 'I like to save it.', ); } catch (error) { // Error saving data } }; _retrieveData = async () => { try { const value = await AsyncStorage.getItem('TASKS'); if (value !== null) { // We have data!! console.log(value); } } catch (error) { // Error retrieving data } }; // App export default function App() { const [isModalVisible, setModalVisible] = useState(false); const ToggleSettingModal = () => { setModalVisible(!isModalVisible); }; const [tabs, setTabs] = React.useState([ { name : "1", component : TabScreen, } ]) const addNewTab = () => { setTabs(tabs => [ ...tabs, { name : "" + (parseInt(tabs.pop().name.replace("", "")) + 1), component : TabScreen, } ]) } const remove = (route) => {setTabs(tabs => tabs.filter(tab => tab.name !== route.name))} function TabScreen({route}) { return ( Alert.alert("Something went wrong", "The page you are trying to load has either crashed or there is no connection. Please check your Instance setting to make sure the URL is correct.", [{text: 'OK'}])} source={{ uri: InstanceURL }} javaScriptEnabled={true} javaScriptEnabledAndroid={true} scalesPageToFit={false} allowsBackForwardNavigationGestures style={{backgroundColor: '#202020'}} /> ) } return ( { tabs.map(tab => ) } {/* {route.name !== "tab-1" && remove(route)}>close me} */} + Settings Instance SetInstance(e.target.value)} placeholder="https://design.penpot.app/" aria-label="InstanceURL" /> Cancel ) }