Skip to content

Commit 90a2b21

Browse files
committed
Display notes on artifact sets
1 parent 983c147 commit 90a2b21

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

pages/artifacts/[artifact].tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export default function ArtifactWebpage({ artifact, location, guides }: Props &
5151
{artifact.name}
5252
</h1>
5353

54-
{artifact.levels && <div className="inline-block pr-2">
54+
{artifact.note && <div className="block pr-2">
55+
<ReactMarkdown>{(artifact.note.replace(/ ?\$\{.*?\}/g, "").replace(/\n/g, "\n\n") ?? "")}</ReactMarkdown>
56+
</div>}
57+
58+
{artifact.levels && <div className="block pr-2">
5559
Available in {joinMulti(artifact.levels.map(l => `${l}★`))}
5660
</div>}
5761
</div>

utils/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export interface Reminder {
5454

5555
// Artifacts
5656
export interface Artifact {
57-
name: string
57+
name: string
58+
note?: string
5859
levels?: number[]
5960
bonuses?: Bonus[]
6061
artis?: Arti[]

utils/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export function getStarColor(star: number): string {
180180
export function createSmallChar(char: Character): SmallChar {
181181
const c: SmallChar = { name: char.name, urlpath: "characters" }
182182
if (char.star) c.stars = char.star
183-
if (char.meta.element) c.element = [char.meta.element as ElementType]
184183
if (char.skills) c.element = char.skills.map(skill => skill.ult?.type).filter(x => x) as ElementType[]
184+
if (char.meta.element && (c.element == undefined || c.element.length < 1)) c.element = [char.meta.element as ElementType]
185185
if (char.weaponType) c.weapon = char.weaponType
186186
if (char.icon) c.icon = char.icon
187187
return c

0 commit comments

Comments
 (0)