vmi-virtual-memorial/vmi-wd-frontend / 46821eb

Browse files

add ternary for single year conflicts

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
46821eb07727af15d4392e228e6e5ef0bc9e4623
Parents
cc2b939
Tree
5649b2d

3 changed files

StatusFile+-
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() {
7878
             {conflict.name}
7979
           </h1>
8080
           <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'}`}
8284
           </p>
8385
           {conflict.description && (
8486
             <p className="text-gray-800 leading-relaxed mb-6">{conflict.description}</p>
app/memorial/page.tsxmodified
@@ -148,7 +148,9 @@ export default function MemorialIndexPage() {
148148
                       {conflict.name}
149149
                     </h2>
150150
                     <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'}`}
152154
                     </p>
153155
                   </div>
154156
                   <div className="flex items-center gap-4">
app/page.tsxmodified
@@ -132,7 +132,9 @@ export default function Home() {
132132
                           {conflict.name}
133133
                         </h3>
134134
                         <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'}`}
136138
                         </p>
137139
                       </div>
138140
                       <div className="text-right">