Set state on "Modify" button in list (side) quests
This commit is contained in:
parent
065fd743e4
commit
5336be044f
|
@ -7,7 +7,13 @@ function QuestTile(props) {
|
|||
<p>Difficulty: {["Low", "Medium", "High"][props.quest.difficulty - 1]}</p>
|
||||
<p>Priority: {["Low", "Medium", "High"][props.quest.priority - 1]}</p>
|
||||
<p>State: {props.quest.state ? "Complete": "Incomplete"}</p>
|
||||
<button className="nes-btn is-primary">Modify</button>
|
||||
<button
|
||||
className="nes-btn is-primary"
|
||||
onClick={() => props.setDisplay({
|
||||
"type": props.type,
|
||||
"id": props.quest.id
|
||||
})}
|
||||
>Modify</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -15,6 +21,7 @@ function QuestTile(props) {
|
|||
QuestTile.propTypes = {
|
||||
quest: PropTypes.object,
|
||||
setDisplay: PropTypes.func,
|
||||
type: PropTypes.string,
|
||||
};
|
||||
|
||||
function Quests(props) {
|
||||
|
@ -34,6 +41,7 @@ function Quests(props) {
|
|||
{props.quests.map((cur) => <QuestTile
|
||||
key={cur.id}
|
||||
quest={cur}
|
||||
type={ props.display.type === "quests" ? "quest" : "sideQuest"}
|
||||
setDisplay={props.setDisplay}/>)}
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue