mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-28 23:44:19 +00:00
🔧 Add display method to Condition objects
This commit is contained in:
parent
7ca7ae49a5
commit
2737e8c1a2
1 changed files with 45 additions and 2 deletions
|
@ -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",
|
color: "Grey",
|
||||||
icon: faQuestionCircle,
|
icon: faQuestionCircle,
|
||||||
title: this.id,
|
title: this.id,
|
||||||
content: this.content,
|
children: this.content,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +60,15 @@ export class ConditionHashtag extends Condition {
|
||||||
constructor(hashtag, id = null) {
|
constructor(hashtag, id = null) {
|
||||||
super(0, hashtag, id)
|
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) {
|
constructor(user, id = null) {
|
||||||
super(5, user, id)
|
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)
|
super(2, timeRay.toString(), id)
|
||||||
this.timeRay = timeRay
|
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)
|
super(3, mapArea.toString(), id)
|
||||||
this.mapArea = mapArea
|
this.mapArea = mapArea
|
||||||
}
|
}
|
||||||
|
|
||||||
|
display() {
|
||||||
|
return {
|
||||||
|
color: "Red",
|
||||||
|
icon: faLocationArrow,
|
||||||
|
title: this.id,
|
||||||
|
children: this.mapArea.toHumanString(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue