diff --git a/src/ui.js b/src/ui.js index 4264489..d950ed5 100644 --- a/src/ui.js +++ b/src/ui.js @@ -57,9 +57,18 @@ export default class UIManager { fishInfo.innerHTML = `Name: ${fish.name}`; fishInfo.innerHTML += `
Mood: ${fish.mood}`; fishInfo.innerHTML += `
Favorite food: ${fish.favoriteFood}`; - + fishInfo.innerHTML += "
"; + + let fishLink = document.createElement("a"); + fishLink.href = "#journal"; + fishLink.innerText = "Go to journal"; + fishLink.addEventListener("click", function () { + this.setJournalSelected(fish); + }.bind(this)); + fishDiv.appendChild(fishImage); fishDiv.appendChild(fishInfo); + fishDiv.appendChild(fishLink); // Add it to the selected fish div selectedFishDiv.appendChild(fishDiv);