diff --git a/src/app/app/page.tsx b/src/app/app/page.tsx index 4a53f82..bdc19a1 100644 --- a/src/app/app/page.tsx +++ b/src/app/app/page.tsx @@ -7,6 +7,9 @@ import Character from "@/src/components/character/character"; import Header from "@/src/components/header/header"; import SkillsTable from "@/src/components/skills-table/skills-table"; import TasksTable from "@/src/components/tasks-table/tasks-table"; +import { cn } from "@/src/lib/utils"; + +type ActivePanel = "skills" | "goals"; export default function HomePage() { const [skills, setSkills] = useState([]); @@ -18,6 +21,24 @@ export default function HomePage() { const [loadingGoalIds, setLoadingGoalIds] = useState>(new Set()); + // Mobile tabs state + const [activePanel, setActivePanel] = useState("skills"); + + // Handle skill selection with auto-switch to Goals on mobile + const handleSelectSkill = (skillId: string | null) => { + if (skillId === selectedSkillId) { + // Deselecting + setSelectedSkillId(null); + } + else { + setSelectedSkillId(skillId); + // Auto-switch to Goals panel when selecting a skill (for mobile UX) + if (skillId !== null) { + setActivePanel("goals"); + } + } + }; + // Load skills on mount useEffect(() => { async function fetchSkills() { @@ -156,7 +177,7 @@ export default function HomePage() { if (isLoading) { return ( -
+

Loading...

); @@ -164,7 +185,7 @@ export default function HomePage() { if (error) { return ( -
+

Error: {error} @@ -174,19 +195,70 @@ export default function HomePage() { } return ( -

-
+
+
-
-
+
+ {/* Character section - full width on mobile, 2/3 on larger screens */} +
-
-
- + + {/* Mobile tabs - only visible on small screens */} +
+ + +
+ + {/* Content grid - stacked on mobile (with tabs), side-by-side on lg+ */} +
+ {/* Skills panel */} +
+
-
- + + {/* Goals panel */} +
+
diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx index 7303657..50e4c28 100644 --- a/src/components/header/header.tsx +++ b/src/components/header/header.tsx @@ -24,26 +24,35 @@ function Header() { }; return ( -
-

BeetForge

-
- - - -
+
diff --git a/src/components/skills-table/skills-table.tsx b/src/components/skills-table/skills-table.tsx index d4313ed..6d477fb 100644 --- a/src/components/skills-table/skills-table.tsx +++ b/src/components/skills-table/skills-table.tsx @@ -8,20 +8,20 @@ import AddSkillModal from "../add-skill-modal/add-skill-modal"; function SkillsTable({ skills, selectedSkillId, setSelectedSkillId, onAddSkill }: { skills: Skill[]; selectedSkillId: string | null; setSelectedSkillId: (id: string | null) => void; onAddSkill: (skill: NewSkill) => void }) { return ( - <> -
-

Skill

+
+
+

Skills

A list of your skills. - Rank + Rank Title LvL - XP - Actions + XP + Actions @@ -36,23 +36,23 @@ function SkillsTable({ skills, selectedSkillId, setSelectedSkillId, onAddSkill } )} onClick={() => setSelectedSkillId(isSelected ? null : skill.id)} > - + {skill.rank} - {skill.skillName} + {skill.skillName} {skill.level} - + {skill.currentXp} / {skill.nextLevelXp} - actions + actions ); })}
- +
); } diff --git a/src/components/tasks-table/tasks-table.tsx b/src/components/tasks-table/tasks-table.tsx index 8b0591b..0866019 100644 --- a/src/components/tasks-table/tasks-table.tsx +++ b/src/components/tasks-table/tasks-table.tsx @@ -9,16 +9,16 @@ import { cn } from "@/src/lib/utils"; function TasksTable({ selectedSkill, onToggleGoal, loadingGoalIds }: { selectedSkill: Skill | null; onToggleGoal: (goalId: string) => void; loadingGoalIds: Set }) { if (!selectedSkill) { return ( - <> -
-

- Goals for: Select a skill on the left +
+
+

+ Goals

-
+
Select a skill to view its goals
- +
); } @@ -27,56 +27,65 @@ function TasksTable({ selectedSkill, onToggleGoal, loadingGoalIds }: { selectedS : 0; return ( - <> -
-

- Goals for: +
+
+

+ Goals: {" "} - {selectedSkill.skillName} + {selectedSkill.skillName}

- {selectedSkill.rank} + {selectedSkill.rank}
-

- What I want to achieve: - {" "} +

+ Goal: {selectedSkill.description ?? "No description"} -

-
- - Lvl: +

+
+ + Lvl {" "} {selectedSkill.level} -
+
-
- {`${selectedSkill.currentXp}/${selectedSkill.nextLevelXp} exp.`} +
+ {`${selectedSkill.currentXp}/${selectedSkill.nextLevelXp} xp`}
-
- {selectedSkill.goals.map((goal) => { - const isLoading = loadingGoalIds.has(goal.id); - return ( -
- {isLoading - ? - : onToggleGoal(goal.id)} />} - {goal.goalName} -
- - +
+ {selectedSkill.goals.length === 0 + ? ( +
+ No goals yet
-
- ); - })} + ) + : ( + selectedSkill.goals.map((goal) => { + const isLoading = loadingGoalIds.has(goal.id); + return ( +
+
+ {isLoading + ? + : onToggleGoal(goal.id)} />} +
+ {goal.goalName} +
+ + +
+
+ ); + }) + )}
- +
); }