1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

🔧 Add display method to Condition objects

This commit is contained in:
Steffo 2021-05-22 03:52:25 +02:00
parent 7ca7ae49a5
commit 2737e8c1a2
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,4 +1,11 @@
import { IconDefinition, faQuestionCircle } from "@fortawesome/free-solid-svg-icons"
import {
IconDefinition,
faQuestionCircle,
faHashtag,
faAt,
faClock,
faLocationArrow,
} from "@fortawesome/free-solid-svg-icons"
/**
@ -40,7 +47,7 @@ export class Condition {
color: "Grey",
icon: faQuestionCircle,
title: this.id,
content: this.content,
children: this.content,
}
}
}
@ -53,6 +60,15 @@ export class ConditionHashtag extends Condition {
constructor(hashtag, id = null) {
super(0, hashtag, id)
}
display() {
return {
color: "Grey",
icon: faHashtag,
title: this.id,
children: this.content,
}
}
}
@ -63,6 +79,15 @@ export class ConditionUser extends Condition {
constructor(user, id = null) {
super(5, user, id)
}
display() {
return {
color: "Green",
icon: faAt,
title: this.id,
children: this.content,
}
}
}
@ -76,6 +101,15 @@ export class ConditionTime extends Condition {
super(2, timeRay.toString(), id)
this.timeRay = timeRay
}
display() {
return {
color: "Yellow",
icon: faClock,
title: this.id,
children: this.content,
}
}
}
@ -89,4 +123,13 @@ export class ConditionLocation extends Condition {
super(3, mapArea.toString(), id)
this.mapArea = mapArea
}
display() {
return {
color: "Red",
icon: faLocationArrow,
title: this.id,
children: this.mapArea.toHumanString(),
}
}
}