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>Difficulty: {["Low", "Medium", "High"][props.quest.difficulty - 1]}</p>
|
||||||
<p>Priority: {["Low", "Medium", "High"][props.quest.priority - 1]}</p>
|
<p>Priority: {["Low", "Medium", "High"][props.quest.priority - 1]}</p>
|
||||||
<p>State: {props.quest.state ? "Complete": "Incomplete"}</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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +21,7 @@ function QuestTile(props) {
|
||||||
QuestTile.propTypes = {
|
QuestTile.propTypes = {
|
||||||
quest: PropTypes.object,
|
quest: PropTypes.object,
|
||||||
setDisplay: PropTypes.func,
|
setDisplay: PropTypes.func,
|
||||||
|
type: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
function Quests(props) {
|
function Quests(props) {
|
||||||
|
@ -34,6 +41,7 @@ function Quests(props) {
|
||||||
{props.quests.map((cur) => <QuestTile
|
{props.quests.map((cur) => <QuestTile
|
||||||
key={cur.id}
|
key={cur.id}
|
||||||
quest={cur}
|
quest={cur}
|
||||||
|
type={ props.display.type === "quests" ? "quest" : "sideQuest"}
|
||||||
setDisplay={props.setDisplay}/>)}
|
setDisplay={props.setDisplay}/>)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue