Skip to content

Commit 78268fe

Browse files
committed
Add effects to mats
1 parent 37cf60d commit 78268fe

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

pages/materials/[material].tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ export default function MaterialWebpage({ mat, location, guides, specialty, used
123123
</table>
124124
</>}
125125

126+
{mat.effect && (typeof mat.effect == "string" ? <>
127+
<h3 className="text-lg font-bold pt-1" id="effect">Effect:</h3>
128+
<div>{mat.effect}</div>
129+
</>
130+
: <>
131+
<h3 className="text-lg font-bold pt-1" id="effect">Effects:</h3>
132+
<table className={`table-auto w-full ${styles.table} mb-2 sm:text-sm md:text-base text-xs`}>
133+
<thead>
134+
<tr className="divide-x divide-gray-200 dark:divide-gray-500">
135+
<th>Food</th>
136+
<th>Effect</th>
137+
</tr>
138+
</thead>
139+
<tbody className="divide-y divide-gray-200 dark:divide-gray-500">
140+
{Object.entries(mat.effect).map(([name, effect]) => <tr className="pr-1 divide-x divide-gray-200 dark:divide-gray-500" key={name} >
141+
<td>{name}</td>
142+
<td>{effect}</td>
143+
</tr>)}
144+
</tbody>
145+
</table>
146+
</>)}
147+
126148
{specialty && <>
127149
<h3 className="text-lg font-bold pt-1" id="specialty">Specialty:</h3>
128150
<Specialty specialty={specialty} location={location} />

utils/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ export interface Material {
320320
sources?: string[]
321321
specialty?: { char: string, recipe: string }
322322
recipe?: Item[]
323+
effect?: string | Record<string, string>
323324
}
324325

325326

0 commit comments

Comments
 (0)