import React, { useState, useCallback } from 'react'; import { Button, View } from 'react-native'; import Modal from 'components/Modal'; import Input from 'components/Input'; import { setJellyfinCredentials } from 'store/settings/actions'; import { useDispatch } from 'react-redux'; import { useNavigation, StackActions } from '@react-navigation/native'; import CredentialGenerator from './components/CredentialGenerator'; import { THEME_COLOR } from 'CONSTANTS'; import { t } from '@localisation'; import useDefaultStyles from 'components/Colors'; import { Text } from 'components/Typography'; export default function SetJellyfinServer() { const defaultStyles = useDefaultStyles(); // State for first screen const [serverUrl, setServerUrl] = useState(); const [isLogginIn, setIsLogginIn] = useState(false); // Handlers needed for dispatching stuff const dispatch = useDispatch(); const navigation = useNavigation(); // Save creedentials to store and close the modal const saveCredentials = useCallback((credentials) => { dispatch(setJellyfinCredentials(credentials)); navigation.dispatch(StackActions.popToTop()); }, [navigation, dispatch]); return ( {isLogginIn ? ( ) : ( {t('set-jellyfin-server-instruction')}