UI fixes: emoji icons, modal form, Czech labels, polish

- Fixed group emoji icons in DB (💼🛒📚🗺️🏃🏠🌿)
- Added TaskModal component for + button
- Czech status labels (Čeká, Probíhá, Hotovo, Zrušeno)
- Improved TaskCard, GroupSelector, Header, StatusBadge
- Better dark/light mode transitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude CLI Agent
2026-03-29 11:16:07 +00:00
parent 6c93ae04d0
commit 4a6b5e5498
11 changed files with 499 additions and 163 deletions

View File

@@ -6,7 +6,7 @@ import { useAuth } from "@/lib/auth";
import { getTasks, getGroups, createTask, Task, Group } from "@/lib/api";
import TaskCard from "@/components/TaskCard";
import GroupSelector from "@/components/GroupSelector";
import TaskForm from "@/components/TaskForm";
import TaskModal from "@/components/TaskModal";
type StatusFilter = "all" | "pending" | "in_progress" | "done" | "cancelled";
@@ -35,7 +35,7 @@ export default function TasksPage() {
setTasks(tasksRes.data || []);
setGroups(groupsRes.data || []);
} catch (err) {
console.error("Chyba pri nacitani:", err);
console.error("Chyba p\u0159i na\u010d\u00edt\u00e1n\u00ed:", err);
} finally {
setLoading(false);
}
@@ -57,19 +57,23 @@ export default function TasksPage() {
}
const statusOptions: { value: StatusFilter; label: string }[] = [
{ value: "all", label: "Vse" },
{ value: "pending", label: "Ceka" },
{ value: "in_progress", label: "Probiha" },
{ value: "all", label: "V\u0161e" },
{ value: "pending", label: "\u010Cek\u00e1" },
{ value: "in_progress", label: "Prob\u00edh\u00e1" },
{ value: "done", label: "Hotovo" },
{ value: "cancelled", label: "Zruseno" },
{ value: "cancelled", label: "Zru\u0161eno" },
];
if (!token) return null;
return (
<div className="space-y-4">
<div className="space-y-4 pb-24">
{/* Group tabs */}
<GroupSelector groups={groups} selected={selectedGroup} onSelect={setSelectedGroup} />
<GroupSelector
groups={groups}
selected={selectedGroup}
onSelect={setSelectedGroup}
/>
{/* Status filter */}
<div className="flex gap-1.5 overflow-x-auto scrollbar-hide pb-1">
@@ -77,7 +81,7 @@ export default function TasksPage() {
<button
key={opt.value}
onClick={() => setStatusFilter(opt.value)}
className={`flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${
className={`flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-medium transition-all min-h-[36px] ${
statusFilter === opt.value
? "bg-gray-800 text-white dark:bg-white dark:text-gray-900"
: "bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"
@@ -88,29 +92,18 @@ export default function TasksPage() {
))}
</div>
{/* Task creation form */}
{showForm && (
<div className="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-2xl p-5">
<h2 className="text-lg font-semibold mb-4">Novy ukol</h2>
<TaskForm
groups={groups}
onSubmit={handleCreateTask}
onCancel={() => setShowForm(false)}
submitLabel="Vytvorit"
/>
</div>
)}
{/* Task list */}
{loading ? (
<div className="flex justify-center py-12">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div>
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" />
</div>
) : tasks.length === 0 ? (
<div className="text-center py-16">
<div className="text-4xl mb-3">&#9744;</div>
<p className="text-muted text-lg">Zadne ukoly</p>
<p className="text-muted text-sm mt-1">Vytvorte prvni ukol pomoci tlacitka +</p>
<div className="text-5xl mb-4 opacity-50">&#9744;</div>
<p className="text-muted text-lg font-medium">\u017d\u00e1dn\u00e9 \u00fakoly</p>
<p className="text-muted text-sm mt-1">
Vytvo\u0159te prvn\u00ed \u00fakol pomoc\u00ed tla\u010d\u00edtka +
</p>
</div>
) : (
<div className="space-y-2">
@@ -120,15 +113,34 @@ export default function TasksPage() {
</div>
)}
{/* Floating add button */}
{!showForm && (
<button
onClick={() => setShowForm(true)}
className="fixed bottom-6 right-6 w-14 h-14 bg-blue-600 hover:bg-blue-700 text-white rounded-full shadow-lg hover:shadow-xl transition-all flex items-center justify-center text-2xl font-light"
aria-label="Pridat ukol"
{/* Floating action button */}
<button
onClick={() => setShowForm(true)}
className="fixed bottom-6 right-6 w-14 h-14 bg-blue-600 hover:bg-blue-700 active:bg-blue-800 text-white rounded-full shadow-lg hover:shadow-xl active:shadow-md transition-all duration-200 flex items-center justify-center z-40 hover:scale-105 active:scale-95"
aria-label="P\u0159idat \u00fakol"
>
<svg
className="w-7 h-7"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={2.5}
>
+
</button>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M12 4v16m8-8H4"
/>
</svg>
</button>
{/* Add task modal */}
{showForm && (
<TaskModal
groups={groups}
onSubmit={handleCreateTask}
onClose={() => setShowForm(false)}
/>
)}
</div>
);