Mobile Dev
This commit is contained in:
@@ -1,416 +1,258 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
KeyboardAvoidingView,
|
||||
Modal,
|
||||
Platform,
|
||||
Pressable,
|
||||
RefreshControl,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextInput,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { ActivityIndicator, Pressable, RefreshControl, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import { router } from 'expo-router';
|
||||
|
||||
import { createTask, fetchTasks, fetchTenantProfiles, Task, TaskStatus, updateTask } from '@/src/lib/api';
|
||||
import { fetchStaffTimeSpans, fetchTasks, Task } from '@/src/lib/api';
|
||||
import { useAuth } from '@/src/providers/auth-provider';
|
||||
|
||||
const STATUSES: TaskStatus[] = ['Offen', 'In Bearbeitung', 'Abgeschlossen'];
|
||||
const PRIMARY = '#69c350';
|
||||
|
||||
function normalizeStatus(status: unknown): TaskStatus {
|
||||
if (status === 'In Bearbeitung' || status === 'Abgeschlossen') return status;
|
||||
type DashboardData = {
|
||||
tasks: Task[];
|
||||
openTasks: number;
|
||||
inProgressTasks: number;
|
||||
activeTimeStart: string | null;
|
||||
pendingSubmissions: number;
|
||||
todayMinutes: number;
|
||||
};
|
||||
|
||||
function normalizeTaskStatus(value: unknown): 'Offen' | 'In Bearbeitung' | 'Abgeschlossen' {
|
||||
if (value === 'In Bearbeitung') return 'In Bearbeitung';
|
||||
if (value === 'Abgeschlossen') return 'Abgeschlossen';
|
||||
return 'Offen';
|
||||
}
|
||||
|
||||
function getTaskAssigneeId(task: Task): string | null {
|
||||
return (task.userId || task.user_id || task.profile || null) as string | null;
|
||||
function formatMinutes(minutes: number): string {
|
||||
const h = Math.floor(minutes / 60);
|
||||
const m = minutes % 60;
|
||||
return `${h}h ${String(m).padStart(2, '0')}m`;
|
||||
}
|
||||
|
||||
export default function TasksScreen() {
|
||||
const { token, user, activeTenantId } = useAuth();
|
||||
function formatDateTime(value: string | null): string {
|
||||
if (!value) return '-';
|
||||
return new Date(value).toLocaleString('de-DE', {
|
||||
day: '2-digit',
|
||||
month: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
});
|
||||
}
|
||||
|
||||
export default function DashboardScreen() {
|
||||
const { token, user } = useAuth();
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [updatingTaskId, setUpdatingTaskId] = useState<number | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const [tasks, setTasks] = useState<Task[]>([]);
|
||||
const [profiles, setProfiles] = useState<{ id: string; label: string }[]>([]);
|
||||
|
||||
const [search, setSearch] = useState('');
|
||||
const [statusFilter, setStatusFilter] = useState<'Alle' | TaskStatus>('Alle');
|
||||
const [showCompleted, setShowCompleted] = useState(false);
|
||||
|
||||
const [showSearchPanel, setShowSearchPanel] = useState(false);
|
||||
const [showFilterPanel, setShowFilterPanel] = useState(false);
|
||||
|
||||
const [createModalOpen, setCreateModalOpen] = useState(false);
|
||||
const [createError, setCreateError] = useState<string | null>(null);
|
||||
const [newTaskName, setNewTaskName] = useState('');
|
||||
const [newTaskDescription, setNewTaskDescription] = useState('');
|
||||
const [data, setData] = useState<DashboardData>({
|
||||
tasks: [],
|
||||
openTasks: 0,
|
||||
inProgressTasks: 0,
|
||||
activeTimeStart: null,
|
||||
pendingSubmissions: 0,
|
||||
todayMinutes: 0,
|
||||
});
|
||||
|
||||
const currentUserId = useMemo(() => (user?.id ? String(user.id) : null), [user]);
|
||||
|
||||
const filteredTasks = useMemo(() => {
|
||||
const needle = search.trim().toLowerCase();
|
||||
|
||||
return tasks
|
||||
.filter((task) => {
|
||||
const status = normalizeStatus(task.categorie);
|
||||
if (!showCompleted && status === 'Abgeschlossen') return false;
|
||||
const statusMatch = statusFilter === 'Alle' || status === statusFilter;
|
||||
const textMatch =
|
||||
!needle ||
|
||||
[task.name, task.description, task.categorie].some((value) =>
|
||||
String(value || '').toLowerCase().includes(needle)
|
||||
);
|
||||
return statusMatch && textMatch;
|
||||
})
|
||||
.sort((a, b) => Number(a.id) - Number(b.id));
|
||||
}, [search, showCompleted, statusFilter, tasks]);
|
||||
|
||||
function getAssigneeLabel(task: Task): string {
|
||||
const assigneeId = getTaskAssigneeId(task);
|
||||
if (!assigneeId) return '-';
|
||||
return profiles.find((profile) => profile.id === assigneeId)?.label || assigneeId;
|
||||
}
|
||||
|
||||
const loadTasks = useCallback(
|
||||
const loadDashboard = useCallback(
|
||||
async (showSpinner = true) => {
|
||||
if (!token) return;
|
||||
|
||||
if (!token || !currentUserId) return;
|
||||
if (showSpinner) setLoading(true);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const [taskRows, profileRows] = await Promise.all([fetchTasks(token), fetchTenantProfiles(token)]);
|
||||
setTasks(taskRows || []);
|
||||
setProfiles(
|
||||
(profileRows || [])
|
||||
.map((profile) => {
|
||||
const id = profile.user_id || (profile.id ? String(profile.id) : null);
|
||||
const label = profile.full_name || profile.fullName || profile.email || id;
|
||||
return id ? { id: String(id), label: String(label || id) } : null;
|
||||
})
|
||||
.filter((value): value is { id: string; label: string } => Boolean(value))
|
||||
);
|
||||
const [taskRows, spans] = await Promise.all([
|
||||
fetchTasks(token),
|
||||
fetchStaffTimeSpans(token, currentUserId),
|
||||
]);
|
||||
|
||||
const tasks = taskRows || [];
|
||||
const openTasks = tasks.filter((task) => normalizeTaskStatus(task.categorie) === 'Offen').length;
|
||||
const inProgressTasks = tasks.filter(
|
||||
(task) => normalizeTaskStatus(task.categorie) === 'In Bearbeitung'
|
||||
).length;
|
||||
|
||||
const activeTime = spans.find((span) => !span.stopped_at) || null;
|
||||
const pendingSubmissions = spans.filter(
|
||||
(span) => (span.state === 'draft' || span.state === 'factual') && !!span.stopped_at
|
||||
).length;
|
||||
|
||||
const today = new Date();
|
||||
const todayIso = today.toISOString().slice(0, 10);
|
||||
const todayMinutes = spans
|
||||
.filter((span) => span.started_at?.slice(0, 10) === todayIso)
|
||||
.reduce((sum, span) => sum + (span.duration_minutes || 0), 0);
|
||||
|
||||
setData({
|
||||
tasks,
|
||||
openTasks,
|
||||
inProgressTasks,
|
||||
activeTimeStart: activeTime?.started_at || null,
|
||||
pendingSubmissions,
|
||||
todayMinutes,
|
||||
});
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : 'Aufgaben konnten nicht geladen werden.');
|
||||
setError(err instanceof Error ? err.message : 'Dashboard konnte nicht geladen werden.');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
setRefreshing(false);
|
||||
}
|
||||
},
|
||||
[token]
|
||||
[currentUserId, token]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!token || !activeTenantId) return;
|
||||
void loadTasks(true);
|
||||
}, [token, activeTenantId, loadTasks]);
|
||||
if (!token || !currentUserId) return;
|
||||
void loadDashboard(true);
|
||||
}, [currentUserId, loadDashboard, token]);
|
||||
|
||||
async function onRefresh() {
|
||||
if (!token) return;
|
||||
setRefreshing(true);
|
||||
await loadTasks(false);
|
||||
}
|
||||
|
||||
function closeCreateModal() {
|
||||
setCreateModalOpen(false);
|
||||
setCreateError(null);
|
||||
setNewTaskName('');
|
||||
setNewTaskDescription('');
|
||||
}
|
||||
|
||||
async function onCreateTask() {
|
||||
if (!token) return;
|
||||
|
||||
const name = newTaskName.trim();
|
||||
if (!name) {
|
||||
setCreateError('Bitte einen Aufgabennamen eingeben.');
|
||||
return;
|
||||
}
|
||||
|
||||
setSaving(true);
|
||||
setCreateError(null);
|
||||
|
||||
try {
|
||||
await createTask(token, {
|
||||
name,
|
||||
description: newTaskDescription.trim() || null,
|
||||
categorie: 'Offen',
|
||||
userId: currentUserId,
|
||||
});
|
||||
|
||||
closeCreateModal();
|
||||
await loadTasks(false);
|
||||
} catch (err) {
|
||||
setCreateError(err instanceof Error ? err.message : 'Aufgabe konnte nicht erstellt werden.');
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function setTaskStatus(task: Task, status: TaskStatus) {
|
||||
if (!token || !task?.id) return;
|
||||
if (normalizeStatus(task.categorie) === status) return;
|
||||
|
||||
setUpdatingTaskId(Number(task.id));
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
await updateTask(token, Number(task.id), { categorie: status });
|
||||
setTasks((prev) => prev.map((item) => (item.id === task.id ? { ...item, categorie: status } : item)));
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : 'Status konnte nicht gesetzt werden.');
|
||||
} finally {
|
||||
setUpdatingTaskId(null);
|
||||
}
|
||||
await loadDashboard(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={styles.screen}>
|
||||
<ScrollView
|
||||
contentContainerStyle={styles.container}
|
||||
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}>
|
||||
<View style={styles.topActions}>
|
||||
<Pressable
|
||||
style={[styles.topActionButton, showSearchPanel ? styles.topActionButtonActive : null]}
|
||||
onPress={() => setShowSearchPanel((prev) => !prev)}>
|
||||
<Text style={[styles.topActionText, showSearchPanel ? styles.topActionTextActive : null]}>Suche</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
style={[styles.topActionButton, showFilterPanel ? styles.topActionButtonActive : null]}
|
||||
onPress={() => setShowFilterPanel((prev) => !prev)}>
|
||||
<Text style={[styles.topActionText, showFilterPanel ? styles.topActionTextActive : null]}>Filter</Text>
|
||||
</Pressable>
|
||||
<ScrollView
|
||||
contentContainerStyle={styles.container}
|
||||
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}>
|
||||
{error ? <Text style={styles.error}>{error}</Text> : null}
|
||||
|
||||
{loading ? (
|
||||
<View style={styles.loadingBox}>
|
||||
<ActivityIndicator />
|
||||
<Text style={styles.loadingText}>Dashboard wird geladen...</Text>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{showSearchPanel ? (
|
||||
<View style={styles.panel}>
|
||||
<TextInput
|
||||
placeholder="Suche"
|
||||
placeholderTextColor="#9ca3af"
|
||||
style={styles.input}
|
||||
value={search}
|
||||
onChangeText={setSearch}
|
||||
/>
|
||||
{!loading ? (
|
||||
<>
|
||||
<View style={styles.row}>
|
||||
<View style={[styles.metricCard, styles.metricCardPrimary]}>
|
||||
<Text style={styles.metricLabelPrimary}>Aktive Zeit</Text>
|
||||
<Text style={styles.metricValuePrimary}>
|
||||
{data.activeTimeStart ? `Seit ${formatDateTime(data.activeTimeStart)}` : 'Nicht aktiv'}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{showFilterPanel ? (
|
||||
<View style={styles.panel}>
|
||||
<View style={styles.filterRow}>
|
||||
{(['Alle', 'Offen', 'In Bearbeitung'] as const).map((status) => (
|
||||
<Pressable
|
||||
key={status}
|
||||
style={[styles.filterChip, statusFilter === status ? styles.filterChipActive : null]}
|
||||
onPress={() => setStatusFilter(status)}>
|
||||
<Text
|
||||
style={[
|
||||
styles.filterChipText,
|
||||
statusFilter === status ? styles.filterChipTextActive : null,
|
||||
]}>
|
||||
{status}
|
||||
</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
<Pressable
|
||||
style={[styles.filterChip, showCompleted ? styles.filterChipActive : null]}
|
||||
onPress={() => setShowCompleted((prev) => !prev)}>
|
||||
<Text style={[styles.filterChipText, showCompleted ? styles.filterChipTextActive : null]}>
|
||||
Abgeschlossene anzeigen
|
||||
</Text>
|
||||
<View style={styles.row}>
|
||||
<View style={styles.metricCard}>
|
||||
<Text style={styles.metricLabel}>Offene Aufgaben</Text>
|
||||
<Text style={styles.metricValue}>{data.openTasks}</Text>
|
||||
</View>
|
||||
<View style={styles.metricCard}>
|
||||
<Text style={styles.metricLabel}>In Bearbeitung</Text>
|
||||
<Text style={styles.metricValue}>{data.inProgressTasks}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={styles.row}>
|
||||
<View style={styles.metricCard}>
|
||||
<Text style={styles.metricLabel}>Heute erfasst</Text>
|
||||
<Text style={styles.metricValue}>{formatMinutes(data.todayMinutes)}</Text>
|
||||
</View>
|
||||
<View style={styles.metricCard}>
|
||||
<Text style={styles.metricLabel}>Zum Einreichen</Text>
|
||||
<Text style={styles.metricValue}>{data.pendingSubmissions}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={styles.quickActionsCard}>
|
||||
<Text style={styles.quickActionsTitle}>Schnellzugriff</Text>
|
||||
<View style={styles.quickActionsRow}>
|
||||
<Pressable style={styles.quickActionButton} onPress={() => router.push('/(tabs)/tasks')}>
|
||||
<Text style={styles.quickActionText}>Aufgaben</Text>
|
||||
</Pressable>
|
||||
<Pressable style={styles.quickActionButton} onPress={() => router.push('/(tabs)/projects')}>
|
||||
<Text style={styles.quickActionText}>Projekten</Text>
|
||||
</Pressable>
|
||||
<Pressable style={styles.quickActionButton} onPress={() => router.push('/(tabs)/time')}>
|
||||
<Text style={styles.quickActionText}>Zeiten</Text>
|
||||
</Pressable>
|
||||
<Pressable style={styles.quickActionButton} onPress={() => router.push('/more/inventory?action=scan')}>
|
||||
<Text style={styles.quickActionText}>Inventar Scan</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{error ? <Text style={styles.error}>{error}</Text> : null}
|
||||
|
||||
{loading ? (
|
||||
<View style={styles.loadingBox}>
|
||||
<ActivityIndicator />
|
||||
<Text style={styles.loadingText}>Aufgaben werden geladen...</Text>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{!loading && filteredTasks.length === 0 ? (
|
||||
<Text style={styles.empty}>Keine Aufgaben gefunden.</Text>
|
||||
) : null}
|
||||
|
||||
{!loading &&
|
||||
filteredTasks.map((task) => {
|
||||
const status = normalizeStatus(task.categorie);
|
||||
const isUpdating = updatingTaskId === Number(task.id);
|
||||
|
||||
return (
|
||||
<View key={String(task.id)} style={styles.taskCard}>
|
||||
<View style={styles.taskHeader}>
|
||||
<Text style={styles.taskTitle} numberOfLines={2}>
|
||||
{task.name}
|
||||
</Text>
|
||||
<Text style={styles.statusBadge}>{status}</Text>
|
||||
</View>
|
||||
|
||||
{task.description ? (
|
||||
<Text style={styles.taskDescription} numberOfLines={3}>
|
||||
{task.description}
|
||||
</Text>
|
||||
) : null}
|
||||
|
||||
<Text style={styles.taskMeta}>Zuweisung: {getAssigneeLabel(task)}</Text>
|
||||
|
||||
<View style={styles.actionRow}>
|
||||
{STATUSES.map((nextStatus) => (
|
||||
<Pressable
|
||||
key={nextStatus}
|
||||
style={[
|
||||
styles.actionButton,
|
||||
nextStatus === status ? styles.actionButtonActive : null,
|
||||
isUpdating ? styles.buttonDisabled : null,
|
||||
]}
|
||||
onPress={() => setTaskStatus(task, nextStatus)}
|
||||
disabled={isUpdating || nextStatus === status}>
|
||||
<Text style={styles.actionButtonText}>{nextStatus}</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</ScrollView>
|
||||
|
||||
<Pressable style={styles.fab} onPress={() => setCreateModalOpen(true)}>
|
||||
<Text style={styles.fabText}>+</Text>
|
||||
</Pressable>
|
||||
|
||||
<Modal visible={createModalOpen} transparent animationType="fade" onRequestClose={closeCreateModal}>
|
||||
<View style={styles.modalOverlay}>
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
style={styles.modalKeyboardWrap}>
|
||||
<View style={styles.modalCard}>
|
||||
<Text style={styles.modalTitle}>Neue Aufgabe</Text>
|
||||
|
||||
<TextInput
|
||||
placeholder="Titel"
|
||||
placeholderTextColor="#9ca3af"
|
||||
style={styles.input}
|
||||
value={newTaskName}
|
||||
onChangeText={setNewTaskName}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder="Beschreibung (optional)"
|
||||
placeholderTextColor="#9ca3af"
|
||||
style={[styles.input, styles.inputMultiline]}
|
||||
multiline
|
||||
value={newTaskDescription}
|
||||
onChangeText={setNewTaskDescription}
|
||||
/>
|
||||
|
||||
{createError ? <Text style={styles.error}>{createError}</Text> : null}
|
||||
|
||||
<View style={styles.modalActions}>
|
||||
<Pressable style={styles.secondaryButton} onPress={closeCreateModal} disabled={saving}>
|
||||
<Text style={styles.secondaryButtonText}>Abbrechen</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
style={[styles.primaryButton, saving ? styles.buttonDisabled : null]}
|
||||
onPress={onCreateTask}
|
||||
disabled={saving}>
|
||||
<Text style={styles.primaryButtonText}>{saving ? 'Speichere...' : 'Anlegen'}</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
</View>
|
||||
</Modal>
|
||||
</View>
|
||||
</>
|
||||
) : null}
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
screen: {
|
||||
flex: 1,
|
||||
backgroundColor: '#f9fafb',
|
||||
},
|
||||
container: {
|
||||
padding: 16,
|
||||
gap: 12,
|
||||
paddingBottom: 96,
|
||||
backgroundColor: '#f9fafb',
|
||||
},
|
||||
topActions: {
|
||||
row: {
|
||||
flexDirection: 'row',
|
||||
gap: 8,
|
||||
gap: 10,
|
||||
},
|
||||
topActionButton: {
|
||||
borderWidth: 1,
|
||||
borderColor: '#d1d5db',
|
||||
borderRadius: 10,
|
||||
paddingHorizontal: 12,
|
||||
paddingVertical: 8,
|
||||
metricCard: {
|
||||
flex: 1,
|
||||
backgroundColor: '#ffffff',
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: '#e5e7eb',
|
||||
padding: 12,
|
||||
gap: 6,
|
||||
},
|
||||
topActionButtonActive: {
|
||||
metricCardPrimary: {
|
||||
borderColor: PRIMARY,
|
||||
backgroundColor: '#eff9ea',
|
||||
},
|
||||
topActionText: {
|
||||
color: '#374151',
|
||||
fontWeight: '600',
|
||||
metricLabel: {
|
||||
color: '#6b7280',
|
||||
fontSize: 12,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
topActionTextActive: {
|
||||
metricValue: {
|
||||
color: '#111827',
|
||||
fontSize: 22,
|
||||
fontWeight: '700',
|
||||
},
|
||||
metricLabelPrimary: {
|
||||
color: '#3d7a30',
|
||||
fontSize: 12,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
panel: {
|
||||
metricValuePrimary: {
|
||||
color: '#2f5f24',
|
||||
fontSize: 18,
|
||||
fontWeight: '700',
|
||||
},
|
||||
quickActionsCard: {
|
||||
backgroundColor: '#ffffff',
|
||||
borderRadius: 12,
|
||||
padding: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: '#e5e7eb',
|
||||
padding: 12,
|
||||
gap: 10,
|
||||
},
|
||||
input: {
|
||||
borderWidth: 1,
|
||||
borderColor: '#d1d5db',
|
||||
borderRadius: 10,
|
||||
paddingHorizontal: 12,
|
||||
paddingVertical: 10,
|
||||
fontSize: 15,
|
||||
quickActionsTitle: {
|
||||
color: '#111827',
|
||||
backgroundColor: '#ffffff',
|
||||
fontSize: 15,
|
||||
fontWeight: '600',
|
||||
},
|
||||
inputMultiline: {
|
||||
minHeight: 72,
|
||||
textAlignVertical: 'top',
|
||||
},
|
||||
filterRow: {
|
||||
quickActionsRow: {
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'wrap',
|
||||
gap: 8,
|
||||
},
|
||||
filterChip: {
|
||||
borderRadius: 999,
|
||||
borderWidth: 1,
|
||||
borderColor: '#d1d5db',
|
||||
paddingHorizontal: 10,
|
||||
paddingVertical: 6,
|
||||
backgroundColor: '#ffffff',
|
||||
quickActionButton: {
|
||||
minWidth: 120,
|
||||
minHeight: 40,
|
||||
borderRadius: 10,
|
||||
backgroundColor: PRIMARY,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
filterChipActive: {
|
||||
borderColor: PRIMARY,
|
||||
backgroundColor: '#eff9ea',
|
||||
},
|
||||
filterChipText: {
|
||||
color: '#374151',
|
||||
fontSize: 13,
|
||||
fontWeight: '500',
|
||||
},
|
||||
filterChipTextActive: {
|
||||
color: '#3d7a30',
|
||||
quickActionText: {
|
||||
color: '#ffffff',
|
||||
fontWeight: '600',
|
||||
},
|
||||
error: {
|
||||
color: '#dc2626',
|
||||
@@ -424,144 +266,4 @@ const styles = StyleSheet.create({
|
||||
loadingText: {
|
||||
color: '#6b7280',
|
||||
},
|
||||
empty: {
|
||||
color: '#6b7280',
|
||||
textAlign: 'center',
|
||||
paddingVertical: 16,
|
||||
},
|
||||
taskCard: {
|
||||
backgroundColor: '#ffffff',
|
||||
borderRadius: 12,
|
||||
padding: 12,
|
||||
gap: 8,
|
||||
borderWidth: 1,
|
||||
borderColor: '#e5e7eb',
|
||||
},
|
||||
taskHeader: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'flex-start',
|
||||
gap: 8,
|
||||
},
|
||||
taskTitle: {
|
||||
flex: 1,
|
||||
color: '#111827',
|
||||
fontSize: 16,
|
||||
fontWeight: '600',
|
||||
},
|
||||
statusBadge: {
|
||||
color: '#3d7a30',
|
||||
backgroundColor: '#eff9ea',
|
||||
borderRadius: 999,
|
||||
paddingHorizontal: 8,
|
||||
paddingVertical: 4,
|
||||
fontSize: 12,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
taskDescription: {
|
||||
color: '#374151',
|
||||
fontSize: 14,
|
||||
},
|
||||
taskMeta: {
|
||||
color: '#6b7280',
|
||||
fontSize: 12,
|
||||
},
|
||||
actionRow: {
|
||||
flexDirection: 'row',
|
||||
gap: 8,
|
||||
flexWrap: 'wrap',
|
||||
},
|
||||
actionButton: {
|
||||
borderRadius: 8,
|
||||
borderWidth: 1,
|
||||
borderColor: '#d1d5db',
|
||||
backgroundColor: '#ffffff',
|
||||
paddingHorizontal: 10,
|
||||
paddingVertical: 7,
|
||||
},
|
||||
actionButtonActive: {
|
||||
borderColor: PRIMARY,
|
||||
backgroundColor: '#eff9ea',
|
||||
},
|
||||
actionButtonText: {
|
||||
color: '#1f2937',
|
||||
fontSize: 12,
|
||||
fontWeight: '500',
|
||||
},
|
||||
fab: {
|
||||
position: 'absolute',
|
||||
right: 18,
|
||||
bottom: 24,
|
||||
width: 56,
|
||||
height: 56,
|
||||
borderRadius: 28,
|
||||
backgroundColor: PRIMARY,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
elevation: 4,
|
||||
shadowColor: '#111827',
|
||||
shadowOpacity: 0.18,
|
||||
shadowRadius: 10,
|
||||
shadowOffset: { width: 0, height: 4 },
|
||||
},
|
||||
fabText: {
|
||||
color: '#ffffff',
|
||||
fontSize: 30,
|
||||
lineHeight: 30,
|
||||
fontWeight: '500',
|
||||
marginTop: -1,
|
||||
},
|
||||
modalOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: 'rgba(0,0,0,0.35)',
|
||||
justifyContent: 'center',
|
||||
padding: 16,
|
||||
},
|
||||
modalKeyboardWrap: {
|
||||
width: '100%',
|
||||
},
|
||||
modalCard: {
|
||||
backgroundColor: '#ffffff',
|
||||
borderRadius: 14,
|
||||
padding: 14,
|
||||
gap: 10,
|
||||
},
|
||||
modalTitle: {
|
||||
fontSize: 18,
|
||||
fontWeight: '700',
|
||||
color: '#111827',
|
||||
},
|
||||
modalActions: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-end',
|
||||
gap: 8,
|
||||
marginTop: 2,
|
||||
},
|
||||
secondaryButton: {
|
||||
minHeight: 42,
|
||||
borderRadius: 10,
|
||||
paddingHorizontal: 14,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: '#e5e7eb',
|
||||
},
|
||||
secondaryButtonText: {
|
||||
color: '#111827',
|
||||
fontWeight: '600',
|
||||
},
|
||||
primaryButton: {
|
||||
minHeight: 42,
|
||||
borderRadius: 10,
|
||||
paddingHorizontal: 14,
|
||||
backgroundColor: PRIMARY,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
primaryButtonText: {
|
||||
color: '#ffffff',
|
||||
fontWeight: '600',
|
||||
},
|
||||
buttonDisabled: {
|
||||
opacity: 0.6,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user