Skip to content

Instantly share code, notes, and snippets.

@DewofyourYouth
Last active November 15, 2023 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DewofyourYouth/cd86be6214362ba8cdedb8fc548f32b3 to your computer and use it in GitHub Desktop.
Save DewofyourYouth/cd86be6214362ba8cdedb8fc548f32b3 to your computer and use it in GitHub Desktop.
React Bad Adventure
function ChooseAdventure({ adventurer, choice }) {
return (
<div id="adventure">
{choice === "find the holy grail" && (
<div>
Howdy there {adventurer.name}! Are you ready to find the holy grail?
<button onClick={() => goToGrailQuest(adventurer)}>Yes</button>{" "}
<button onClick={changeAdventure}>Change Adventure</button>
</div>
)}
{choice === "save princess peach" && (
<div>
Howdy there {adventurer.name}! Are you ready to save Princess Peach?
<button onClick={() => goToMarioWorldQuest(adventurer)}>
Yes
</button>{" "}
<button onClick={changeAdventure}>Change Adventure</button>
</div>
)}
{choice === "save zelda from ganon" && (
<div>
Howdy there {adventurer.name}! Are you ready to save Princess Zelda?
<button onClick={() => goToLegendOfZeldaQuest(adventurer)}>
Yes
</button>{" "}
<button onClick={changeAdventure}>Change Adventure</button>
</div>
)}
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment