import AsyncStorage from '@react-native-async-storage/async-storage'; import { createDrawerNavigator, DrawerContentScrollView, DrawerItemList } from '@react-navigation/drawer'; import React, { useEffect, useState } from 'react'; import { Button, Linking, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native'; import { STORAGE_KEY, useNotificationListener } from '../hooks/useNotificationListener'; import { usePushNotifications } from '../hooks/usePushNotifications'; import { version as appVersion } from '../package.json'; import { styles } from '../styles/styles'; import { categories, Category, categoryTitles } from '../types/Category'; import { Item } from "../types/Item"; const Drawer = createDrawerNavigator(); const API_KEY_STORAGE = 'API_KEY'; const API_URL = 'https://notifier.gansejunge.com'; type ApiKeyScreenProps = { onApiKeySaved: (key: string) => void; }; function ApiKeyScreen({ onApiKeySaved }: ApiKeyScreenProps) { const [apiKey, setApiKey] = useState(''); const saveApiKey = async () => { if (apiKey.trim()) { await AsyncStorage.setItem(API_KEY_STORAGE, apiKey); onApiKeySaved(apiKey); } }; return ( Enter your API Key: