fix: gold checkbox + button layout in schedule modal
- Custom gold checkbox for 'Одинаковое время' - Delete button moved to right with text label - Save button on left Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -401,27 +401,29 @@ function ClassModal({
|
|||||||
|
|
||||||
{/* Same time checkbox + time fields */}
|
{/* Same time checkbox + time fields */}
|
||||||
{selectedDays.size > 1 && (
|
{selectedDays.size > 1 && (
|
||||||
<label className="flex items-center gap-2 text-sm text-neutral-300 cursor-pointer select-none">
|
<button
|
||||||
<input
|
type="button"
|
||||||
type="checkbox"
|
onClick={() => {
|
||||||
checked={sameTime}
|
const checked = !sameTime;
|
||||||
onChange={(e) => {
|
setSameTime(checked);
|
||||||
const checked = e.target.checked;
|
if (checked) {
|
||||||
setSameTime(checked);
|
const refTime = dayTimes[currentDay] || Object.values(dayTimes)[0] || cls.time;
|
||||||
if (checked) {
|
setDayTimes((prev) => {
|
||||||
// Sync all days to current day's time
|
const next: Record<string, string> = {};
|
||||||
const refTime = dayTimes[currentDay] || Object.values(dayTimes)[0] || cls.time;
|
for (const d of Object.keys(prev)) next[d] = refTime;
|
||||||
setDayTimes((prev) => {
|
return next;
|
||||||
const next: Record<string, string> = {};
|
});
|
||||||
for (const d of Object.keys(prev)) next[d] = refTime;
|
}
|
||||||
return next;
|
}}
|
||||||
});
|
className="flex items-center gap-2 text-sm text-neutral-300 select-none"
|
||||||
}
|
>
|
||||||
}}
|
<span className={`inline-flex items-center justify-center w-4 h-4 rounded border transition-colors ${
|
||||||
className="rounded border-white/20 bg-neutral-800 text-gold focus:ring-gold/50"
|
sameTime ? "bg-gold border-gold" : "border-white/20 bg-neutral-800"
|
||||||
/>
|
}`}>
|
||||||
|
{sameTime && <span className="text-black text-xs font-bold leading-none">✓</span>}
|
||||||
|
</span>
|
||||||
Одинаковое время
|
Одинаковое время
|
||||||
</label>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{sameTime || selectedDays.size <= 1 ? (
|
{sameTime || selectedDays.size <= 1 ? (
|
||||||
@@ -504,7 +506,7 @@ function ClassModal({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="mt-6 flex items-center gap-3">
|
<div className="mt-6 flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -528,9 +530,10 @@ function ClassModal({
|
|||||||
onDelete();
|
onDelete();
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
className="rounded-lg border border-red-500/30 px-4 py-2.5 text-sm text-red-400 hover:bg-red-500/10 transition-colors"
|
className="rounded-lg border border-red-500/30 px-4 py-2.5 text-sm text-red-400 hover:bg-red-500/10 transition-colors flex items-center gap-1.5"
|
||||||
>
|
>
|
||||||
<Trash2 size={16} />
|
<Trash2 size={14} />
|
||||||
|
Удалить
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user