Spaces:
Sleeping
Sleeping
Tristan Yu commited on
Commit ·
04f8035
1
Parent(s): 0157ee0
Fix image display logic: Use task.weekNumber instead of selectedWeek for proper week-based layout
Browse files
client/src/pages/TutorialTasks.tsx
CHANGED
|
@@ -1398,8 +1398,8 @@ const TutorialTasks: React.FC = () => {
|
|
| 1398 |
) : (
|
| 1399 |
<div className="space-y-4">
|
| 1400 |
{task.imageUrl ? (
|
| 1401 |
-
// Different layout based on week number
|
| 1402 |
-
|
| 1403 |
// Week 3+ layout with dynamic sizing and alignment
|
| 1404 |
<div className={`flex flex-col md:flex-row gap-6 items-start ${
|
| 1405 |
task.imageAlignment === 'left' ? 'md:flex-row' :
|
|
@@ -1577,7 +1577,7 @@ const TutorialTasks: React.FC = () => {
|
|
| 1577 |
)}
|
| 1578 |
|
| 1579 |
{/* Translation Input (always show if user is logged in, but hide for image-only content in week 3+) */}
|
| 1580 |
-
{localStorage.getItem('token') && !(
|
| 1581 |
<div className="bg-white rounded-lg p-6 border border-gray-200 shadow-sm">
|
| 1582 |
<div className="flex items-center space-x-3 mb-4">
|
| 1583 |
<div className="bg-gray-100 rounded-lg p-2">
|
|
|
|
| 1398 |
) : (
|
| 1399 |
<div className="space-y-4">
|
| 1400 |
{task.imageUrl ? (
|
| 1401 |
+
// Different layout based on task's week number
|
| 1402 |
+
task.weekNumber >= 3 ? (
|
| 1403 |
// Week 3+ layout with dynamic sizing and alignment
|
| 1404 |
<div className={`flex flex-col md:flex-row gap-6 items-start ${
|
| 1405 |
task.imageAlignment === 'left' ? 'md:flex-row' :
|
|
|
|
| 1577 |
)}
|
| 1578 |
|
| 1579 |
{/* Translation Input (always show if user is logged in, but hide for image-only content in week 3+) */}
|
| 1580 |
+
{localStorage.getItem('token') && !(task.weekNumber >= 3 && task.content === 'Image-based task') && (
|
| 1581 |
<div className="bg-white rounded-lg p-6 border border-gray-200 shadow-sm">
|
| 1582 |
<div className="flex items-center space-x-3 mb-4">
|
| 1583 |
<div className="bg-gray-100 rounded-lg p-2">
|
client/src/pages/WeeklyPractice.tsx
CHANGED
|
@@ -2030,7 +2030,7 @@ const WeeklyPractice: React.FC = () => {
|
|
| 2030 |
</div>
|
| 2031 |
) : (
|
| 2032 |
<div>
|
| 2033 |
-
{practice.imageUrl &&
|
| 2034 |
<div className={`flex flex-col md:flex-row gap-6 items-start ${
|
| 2035 |
practice.imageAlignment === 'left' ? 'md:flex-row' :
|
| 2036 |
practice.imageAlignment === 'right' ? 'md:flex-row-reverse' :
|
|
@@ -2198,8 +2198,8 @@ const WeeklyPractice: React.FC = () => {
|
|
| 2198 |
</div>
|
| 2199 |
)}
|
| 2200 |
|
| 2201 |
-
{/* Translation Input (only show if user is logged in and has no submission, and not for image-only content) */}
|
| 2202 |
-
{localStorage.getItem('token') && (!userSubmissions[practice._id] || userSubmissions[practice._id].length === 0) && practice.content
|
| 2203 |
<div className="bg-gradient-to-r from-purple-50 to-violet-50 rounded-xl p-6 border border-purple-200">
|
| 2204 |
<div className="flex items-center space-x-2 mb-4">
|
| 2205 |
<div className="bg-purple-100 rounded-full p-1">
|
|
|
|
| 2030 |
</div>
|
| 2031 |
) : (
|
| 2032 |
<div>
|
| 2033 |
+
{practice.imageUrl && practice.weekNumber >= 3 ? (
|
| 2034 |
<div className={`flex flex-col md:flex-row gap-6 items-start ${
|
| 2035 |
practice.imageAlignment === 'left' ? 'md:flex-row' :
|
| 2036 |
practice.imageAlignment === 'right' ? 'md:flex-row-reverse' :
|
|
|
|
| 2198 |
</div>
|
| 2199 |
)}
|
| 2200 |
|
| 2201 |
+
{/* Translation Input (only show if user is logged in and has no submission, and not for image-only content in week 3+) */}
|
| 2202 |
+
{localStorage.getItem('token') && (!userSubmissions[practice._id] || userSubmissions[practice._id].length === 0) && !(practice.weekNumber >= 3 && practice.content === 'Image-based practice') && (
|
| 2203 |
<div className="bg-gradient-to-r from-purple-50 to-violet-50 rounded-xl p-6 border border-purple-200">
|
| 2204 |
<div className="flex items-center space-x-2 mb-4">
|
| 2205 |
<div className="bg-purple-100 rounded-full p-1">
|