add ternary for single year conflicts
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
46821eb07727af15d4392e228e6e5ef0bc9e4623- Parents
-
cc2b939 - Tree
5649b2d
46821eb
46821eb07727af15d4392e228e6e5ef0bc9e4623cc2b939
5649b2d| Status | File | + | - |
|---|---|---|---|
| M |
app/memorial/conflict/[id]/page.tsx
|
3 | 1 |
| M |
app/memorial/page.tsx
|
3 | 1 |
| M |
app/page.tsx
|
3 | 1 |
app/memorial/conflict/[id]/page.tsxmodified@@ -78,7 +78,9 @@ export default function ConflictPage() { | ||
| 78 | 78 | {conflict.name} |
| 79 | 79 | </h1> |
| 80 | 80 | <p className="text-xl text-gray-700 mb-4"> |
| 81 | - {conflict.start_year} – {conflict.end_year || 'Present'} | |
| 81 | + {conflict.start_year === conflict.end_year | |
| 82 | + ? conflict.start_year | |
| 83 | + : `${conflict.start_year} – ${conflict.end_year || 'Present'}`} | |
| 82 | 84 | </p> |
| 83 | 85 | {conflict.description && ( |
| 84 | 86 | <p className="text-gray-800 leading-relaxed mb-6">{conflict.description}</p> |
app/memorial/page.tsxmodified@@ -148,7 +148,9 @@ export default function MemorialIndexPage() { | ||
| 148 | 148 | {conflict.name} |
| 149 | 149 | </h2> |
| 150 | 150 | <p className="text-gray-600"> |
| 151 | - {conflict.start_year} – {conflict.end_year || 'Present'} | |
| 151 | + {conflict.start_year === conflict.end_year | |
| 152 | + ? conflict.start_year | |
| 153 | + : `${conflict.start_year} – ${conflict.end_year || 'Present'}`} | |
| 152 | 154 | </p> |
| 153 | 155 | </div> |
| 154 | 156 | <div className="flex items-center gap-4"> |
app/page.tsxmodified@@ -132,7 +132,9 @@ export default function Home() { | ||
| 132 | 132 | {conflict.name} |
| 133 | 133 | </h3> |
| 134 | 134 | <p className="text-gray-600"> |
| 135 | - {conflict.start_year} – {conflict.end_year || 'Present'} | |
| 135 | + {conflict.start_year === conflict.end_year | |
| 136 | + ? conflict.start_year | |
| 137 | + : `${conflict.start_year} – ${conflict.end_year || 'Present'}`} | |
| 136 | 138 | </p> |
| 137 | 139 | </div> |
| 138 | 140 | <div className="text-right"> |