mirror of
https://github.com/mudabbir-ahmad/Media-Aggregation-and-Sorting-System.git
synced 2026-10-08 03:40:20 +00:00
feat: update app structure and improve user experience; refactor media handling and enhance NAS integration
This commit is contained in:
1 parent
4006cd93f1
commit
ac9e4aee43
23 files changed
+1229
-643
No files matched your search
@@ -7,6 +7,8 @@ import { useTheme } from '../services/ThemeContext';
|
||||
import DatabaseService from '../services/DatabaseService';
|
||||
|
||||
const APP_ICON = require('../../assets/icon.png');
|
||||
const isBlank = (value) => !value?.trim();
|
||||
const isEmailValid = (value) => value.includes('@') && value.includes('.');
|
||||
|
||||
const RegisterScreen = ({ navigation }) => {
|
||||
const { theme } = useTheme();
|
||||
@@ -17,11 +19,11 @@ const RegisterScreen = ({ navigation }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleRegister = async () => {
|
||||
if (!username.trim()) { Alert.alert('Error', 'Please enter a username'); return; }
|
||||
if (isBlank(username)) { Alert.alert('Error', 'Please enter a username'); return; }
|
||||
if (username.trim().length < 3) { Alert.alert('Error', 'Username must be at least 3 characters'); return; }
|
||||
if (!email.trim()) { Alert.alert('Error', 'Please enter an email'); return; }
|
||||
if (!email.includes('@') || !email.includes('.')) { Alert.alert('Error', 'Please enter a valid email address'); return; }
|
||||
if (!password.trim()) { Alert.alert('Error', 'Please enter a password'); return; }
|
||||
if (isBlank(email)) { Alert.alert('Error', 'Please enter an email'); return; }
|
||||
if (!isEmailValid(email)) { Alert.alert('Error', 'Please enter a valid email address'); return; }
|
||||
if (isBlank(password)) { Alert.alert('Error', 'Please enter a password'); return; }
|
||||
if (password.length < 6) { Alert.alert('Error', 'Password must be at least 6 characters'); return; }
|
||||
if (password !== confirmPassword) { Alert.alert('Error', 'Passwords do not match'); return; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user