Tristan Yu commited on
Commit
564c253
·
1 Parent(s): 0a1b799

Simplify page transitions to loading indicator only, add skeleton loading for week transitions in TutorialTasks

Browse files
client/src/components/Layout.tsx CHANGED
@@ -133,16 +133,10 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
133
  </div>
134
  </div>
135
 
136
- {/* Main Content with Page Transitions */}
137
- <main
138
- className={`transition-all duration-300 ease-in-out ${
139
- isTransitioning
140
- ? 'opacity-50 scale-95 transform'
141
- : 'opacity-100 scale-100'
142
- }`}
143
- >
144
- {children}
145
- </main>
146
 
147
  {/* Transition Loading Indicator */}
148
  {isTransitioning && (
 
133
  </div>
134
  </div>
135
 
136
+ {/* Main Content */}
137
+ <main>
138
+ {children}
139
+ </main>
 
 
 
 
 
 
140
 
141
  {/* Transition Loading Indicator */}
142
  {isTransitioning && (
client/src/pages/TutorialTasks.tsx CHANGED
@@ -671,16 +671,46 @@ const TutorialTasks: React.FC = () => {
671
  </div>
672
  </div>
673
 
674
- {/* Content with Week Transition Animation */}
675
- <div
676
- className={`transition-all duration-300 ease-in-out ${
677
- isWeekTransitioning
678
- ? 'opacity-50 scale-95 transform'
679
- : 'opacity-100 scale-100'
680
- }`}
681
- >
682
- {/* Translation Brief - Shown once at the top */}
683
- {tutorialWeek && tutorialWeek.translationBrief ? (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  <div className="bg-white rounded-lg p-6 mb-8 border border-gray-200 shadow-sm">
685
  <div className="flex items-center justify-between mb-4">
686
  <div className="flex items-center space-x-3">
@@ -1323,7 +1353,8 @@ const TutorialTasks: React.FC = () => {
1323
  ))
1324
  )}
1325
  </div>
1326
- </div>
 
1327
  </div>
1328
 
1329
  {/* Edit Submission Modal */}
 
671
  </div>
672
  </div>
673
 
674
+ {/* Content with Week Transition Skeleton */}
675
+ {isWeekTransitioning ? (
676
+ <div className="space-y-6">
677
+ {/* Skeleton for Translation Brief */}
678
+ <div className="bg-white rounded-lg p-6 mb-8 border border-gray-200 shadow-sm animate-pulse">
679
+ <div className="flex items-center justify-between mb-4">
680
+ <div className="flex items-center space-x-3">
681
+ <div className="bg-gray-300 rounded-lg p-2 h-9 w-9"></div>
682
+ <div className="h-6 bg-gray-300 rounded w-32"></div>
683
+ </div>
684
+ </div>
685
+ <div className="space-y-3">
686
+ <div className="h-4 bg-gray-300 rounded w-full"></div>
687
+ <div className="h-4 bg-gray-300 rounded w-3/4"></div>
688
+ <div className="h-4 bg-gray-300 rounded w-1/2"></div>
689
+ </div>
690
+ </div>
691
+
692
+ {/* Skeleton for Tasks */}
693
+ {[1, 2, 3].map((i) => (
694
+ <div key={i} className="bg-white rounded-xl shadow-lg border border-gray-100 p-8 animate-pulse">
695
+ <div className="flex items-center justify-between mb-6">
696
+ <div className="flex items-center space-x-3">
697
+ <div className="bg-gray-300 rounded-full p-2 h-9 w-9"></div>
698
+ <div className="h-5 bg-gray-300 rounded w-24"></div>
699
+ </div>
700
+ </div>
701
+ <div className="space-y-4">
702
+ <div className="h-4 bg-gray-300 rounded w-full"></div>
703
+ <div className="h-4 bg-gray-300 rounded w-5/6"></div>
704
+ <div className="h-4 bg-gray-300 rounded w-4/5"></div>
705
+ <div className="h-4 bg-gray-300 rounded w-3/4"></div>
706
+ </div>
707
+ </div>
708
+ ))}
709
+ </div>
710
+ ) : (
711
+ <>
712
+ {/* Translation Brief - Shown once at the top */}
713
+ {tutorialWeek && tutorialWeek.translationBrief ? (
714
  <div className="bg-white rounded-lg p-6 mb-8 border border-gray-200 shadow-sm">
715
  <div className="flex items-center justify-between mb-4">
716
  <div className="flex items-center space-x-3">
 
1353
  ))
1354
  )}
1355
  </div>
1356
+ </>
1357
+ )}
1358
  </div>
1359
 
1360
  {/* Edit Submission Modal */}