Workout Management tests ready
This commit is contained in:
@@ -66,10 +66,14 @@ const ExerciseModal: React.FC<ExerciseModalProps> = ({ isOpen, onClose, onSave,
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
onClose={() => {
|
||||
console.log('ExerciseModal onClose');
|
||||
onClose();
|
||||
}}
|
||||
title={t('create_exercise', lang)}
|
||||
maxWidth="sm"
|
||||
>
|
||||
{console.log('ExerciseModal Rendering. isOpen:', isOpen)}
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<FilledInput
|
||||
|
||||
@@ -32,7 +32,7 @@ const FilledInput: React.FC<FilledInputProps> = ({ label, value, onChange, onCle
|
||||
return (
|
||||
<div className="relative group bg-surface-container-high rounded-t-lg border-b border-outline-variant hover:bg-white/5 focus-within:border-primary transition-colors">
|
||||
<label htmlFor={id} className="absolute top-2 left-4 text-[10px] font-medium text-on-surface-variant flex items-center gap-1">
|
||||
{icon} {label}
|
||||
{icon ? <>{icon} {label}</> : label}
|
||||
</label>
|
||||
<input
|
||||
id={id}
|
||||
|
||||
@@ -138,11 +138,12 @@ const Plans: React.FC<PlansProps> = ({ lang }) => {
|
||||
};
|
||||
|
||||
const onDragStart = (index: number) => {
|
||||
console.log('Drag Start:', index);
|
||||
dragItem.current = index;
|
||||
setDraggingIndex(index);
|
||||
};
|
||||
|
||||
const onDragEnter = (index: number) => {
|
||||
console.log('Drag Enter:', index);
|
||||
if (dragItem.current === null) return;
|
||||
if (dragItem.current === index) return;
|
||||
|
||||
@@ -153,6 +154,7 @@ const Plans: React.FC<PlansProps> = ({ lang }) => {
|
||||
setSteps(newSteps);
|
||||
dragItem.current = index;
|
||||
setDraggingIndex(index);
|
||||
console.log(`Swapped ${draggedItemContent.id} to ${index}`);
|
||||
};
|
||||
|
||||
const onDragEnd = () => {
|
||||
|
||||
@@ -364,7 +364,10 @@ const Profile: React.FC<ProfileProps> = ({ user, onLogout, lang, onLanguageChang
|
||||
{/* EXERCISE MANAGER */}
|
||||
<Card>
|
||||
<button
|
||||
onClick={() => setShowExercises(!showExercises)}
|
||||
onClick={() => {
|
||||
console.log('Toggling showExercises', !showExercises);
|
||||
setShowExercises(!showExercises);
|
||||
}}
|
||||
className="w-full flex justify-between items-center text-sm font-bold text-primary"
|
||||
>
|
||||
<span className="flex items-center gap-2"><Dumbbell size={14} /> {t('manage_exercises', lang)}</span>
|
||||
@@ -374,7 +377,10 @@ const Profile: React.FC<ProfileProps> = ({ user, onLogout, lang, onLanguageChang
|
||||
{showExercises && (
|
||||
<div className="mt-4 space-y-4">
|
||||
<button
|
||||
onClick={() => setIsCreatingEx(true)}
|
||||
onClick={() => {
|
||||
console.log('Clicking New Exercise');
|
||||
setIsCreatingEx(true);
|
||||
}}
|
||||
className="w-full py-2 border border-outline border-dashed rounded-lg text-sm text-on-surface-variant hover:bg-surface-container-high flex items-center justify-center gap-2"
|
||||
>
|
||||
<Plus size={16} /> {t('create_exercise', lang)}
|
||||
@@ -414,13 +420,15 @@ const Profile: React.FC<ProfileProps> = ({ user, onLogout, lang, onLanguageChang
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1 shrink-0">
|
||||
<button onClick={() => setEditingExercise(ex)} className="p-2 text-on-surface-variant hover:text-primary hover:bg-white/5 rounded-full">
|
||||
<button onClick={() => setEditingExercise(ex)} className="p-2 text-on-surface-variant hover:text-primary hover:bg-white/5 rounded-full" role="button" aria-label="Edit Exercise">
|
||||
<Pencil size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleArchiveExercise(ex, !ex.isArchived)}
|
||||
className={`p-2 rounded-full hover:bg-white/5 ${ex.isArchived ? 'text-primary' : 'text-on-surface-variant'}`}
|
||||
title={ex.isArchived ? t('unarchive', lang) : t('archive', lang)}
|
||||
role="button"
|
||||
aria-label={ex.isArchived ? 'Unarchive Exercise' : 'Archive Exercise'}
|
||||
>
|
||||
{ex.isArchived ? <ArchiveRestore size={16} /> : <Archive size={16} />}
|
||||
</button>
|
||||
|
||||
@@ -41,7 +41,11 @@ export const Modal: React.FC<ModalProps> = ({ isOpen, onClose, title, children,
|
||||
className="absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<div className={`relative bg-surface-container w-full ${maxWidthClasses[maxWidth]} rounded-[28px] shadow-elevation-3 animate-in slide-in-from-bottom-10 zoom-in-95 duration-200 flex flex-col max-h-[90vh]`}>
|
||||
<div
|
||||
className={`relative bg-surface-container w-full ${maxWidthClasses[maxWidth]} rounded-[28px] shadow-elevation-3 animate-in slide-in-from-bottom-10 zoom-in-95 duration-200 flex flex-col max-h-[90vh]`}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<div className="flex items-center justify-between p-6 pb-2 shrink-0">
|
||||
<h3 className="text-xl font-normal text-on-surface">{title}</h3>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user