import { Preferences } from '@capacitor/preferences' import { Box, Button, Container, Input, Sheet, Typography } from '@mui/joy' import React from 'react' import { useNavigate } from 'react-router-dom' import { API_URL } from '../../Config' import Logo from '../../Logo' import { useNotification } from '../../service/NotificationProvider' import { apiManager } from '../../utils/TokenManager' const LoginSettings = () => { const Navigate = useNavigate() const [serverURL, setServerURL] = React.useState('') const { showError } = useNotification() React.useEffect(() => { Preferences.get({ key: 'customServerUrl' }).then(result => { setServerURL(result.value || API_URL) }) }, []) const isValidServerURL = () => { return serverURL.match(/^(http|https):\/\/[^ "]+$/) } return ( Done tick Server URL { setServerURL(e.target.value) }} /> Change the server URL to connect to a different server, such as your own self-hosted Donetick server. Please ensure to include the protocol (http:// or https://) and the port number if necessary (default Donetick port is 2021). ) } export default LoginSettings