Skip to content

Commit bc2f23d

Browse files
committed
Update styling
1 parent 9bdf2f6 commit bc2f23d

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

src/components/Habits/Components/ContributionGraph.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const ContributionGraph = () => {
130130
}}
131131
className="px-4 py-2 border border-gray-300 dark:border-gray-700 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 text-gray-800 dark:text-gray-200 rounded-md transition-colors text-sm"
132132
>
133-
< Yesterday
133+
<span className="hidden sm:inline">&lt; </span>Yesterday
134134
</button>
135135
<button
136136
onClick={() => setSelectedDate(new Date())}
@@ -146,7 +146,7 @@ export const ContributionGraph = () => {
146146
}}
147147
className="px-4 py-2 border border-gray-300 dark:border-gray-700 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 text-gray-800 dark:text-gray-200 rounded-md transition-colors text-sm"
148148
>
149-
Tomorrow &gt;
149+
Tomorrow<span className="hidden sm:inline"> &gt;</span>
150150
</button>
151151
</div>
152152
</div>

src/components/Habits/Components/HabitList.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,30 @@ export const HabitList = () => {
8080
return (
8181
<div
8282
key={habit.id}
83-
className="flex gap-3 p-3 hover:bg-gray-50 dark:hover:bg-gray-900 rounded-md transition-colors group justify-between items-center"
83+
className="flex gap-2 p-3 hover:bg-gray-50 dark:hover:bg-gray-900 rounded-md transition-colors group items-end md:items-start flex-col md:flex-row"
8484
>
85-
<input
86-
id={`habit-checkbox-${habit.id}`}
87-
type="checkbox"
88-
checked={isCompleted}
89-
onChange={() => toggleCompletion(habit.id, dateStr)}
90-
className="h-5 w-5 rounded border-gray-300 dark:border-gray-700 text-blue-600 focus:ring-2 focus:ring-blue-500 cursor-pointer"
91-
/>
92-
<label htmlFor={`habit-checkbox-${habit.id}`} className="flex-1 cursor-pointer">
93-
<div className="flex-1">
85+
<div className="flex items-start sm:items-center flex-1 gap-3 w-full">
86+
<input
87+
id={`habit-checkbox-${habit.id}`}
88+
type="checkbox"
89+
checked={isCompleted}
90+
onChange={() => toggleCompletion(habit.id, dateStr)}
91+
className="h-5 w-5 mt-0.5 sm:mt-0 sm:flex-col flex-shrink-0 rounded border-gray-300 dark:border-gray-700 text-blue-600 focus:ring-2 focus:ring-blue-500 cursor-pointer"
92+
/>
93+
<label htmlFor={`habit-checkbox-${habit.id}`} className="flex-1 cursor-pointer min-w-0">
9494
<div className="font-medium text-gray-900 dark:text-gray-100">{habit.name}</div>
9595
{habit.description && (
9696
<div className="text-sm text-gray-600 dark:text-gray-400">{habit.description}</div>
9797
)}
98-
</div>
99-
</label>
100-
<div className="flex gap-2">
98+
</label>
99+
</div>
100+
<div className="flex gap-1.5 flex-shrink-0">
101101
<button
102102
onClick={() => {
103103
setAddForm({ visible: true, id: habit.id, name: habit.name, description: habit.description || '' });
104104
}}
105-
className="opacity-0 group-hover:opacity-100 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 transition-opacity"
105+
className="opacity-100 sm:opacity-0 sm:group-hover:opacity-100 px-2 py-1 text-xs sm:text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-all"
106+
aria-label="Edit habit"
106107
>
107108
Edit
108109
</button>
@@ -112,7 +113,8 @@ export const HabitList = () => {
112113
deleteHabit(habit.id);
113114
}
114115
}}
115-
className="opacity-0 group-hover:opacity-100 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 transition-opacity"
116+
className="opacity-100 sm:opacity-0 sm:group-hover:opacity-100 px-2 py-1 text-xs sm:text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-all"
117+
aria-label="Delete habit"
116118
>
117119
Delete
118120
</button>

0 commit comments

Comments
 (0)