import React, { useEffect, useState, useCallback, useContext, useRef } from 'react'; import { Platform, useWindowDimensions } from 'react-native'; import { Icon, MD3Colors, Button, Text, TextInput, TouchableRipple, ActivityIndicator } from 'react-native-paper'; import { View, AnimatePresence } from 'moti'; import Toast from 'react-native-toast-message'; import * as FileSystem from 'expo-file-system'; import axios from 'axios'; import Theme from '@/constants/theme'; import Dropdown from '@/components/dropdown'; import { CONTEXT } from '@/constants/module/context'; import Storage from '@/constants/module/storages/storage'; import ComicStorage from '@/constants/module/storages/comic_storage'; import ImageCacheStorage from '@/constants/module/storages/image_cache_storage'; import ChapterStorage from '@/constants/module/storages/chapter_storage'; export const PageNavigationWidget = ({setPage}:any) =>{ const Dimensions = useWindowDimensions(); const {themeTypeContext, setThemeTypeContext}:any = useContext(CONTEXT) const {widgetContext, setWidgetContext}:any = useContext(CONTEXT) const [goToPage, setGoToPage] = useState(""); const [_feedBack, _setFeedBack] = useState(""); return ( { const value = event.nativeEvent.text const isInt = /^-?\d+$/.test(value); if (isInt || value === "") { _setFeedBack("") setGoToPage(value) } else _setFeedBack("Input is not a valid number.") }} /> {_feedBack ? {_feedBack} : <> } ) }