Closed ElishebaW closed 6 years ago
@ElishebaW looks almost good to me! Do you think it's possible to have "Dashboard" and "Logout" side by side on the right side? Now there are 4 areas: Logo | Genres | Logout?Login | Dashboard. But I think it would be more common to have 3 Areas: Logo | Genres | Dashboard, Logout/Login whereas the user settings (e.g. login, logout) are on the right side of the navbar.
@rwieruch Sure thing!
I was running into some problems where I couldn't add two expressions to the ternary operation when the condition evaluates to true.
I thought about using an if/else statement, but you can't do that with JSX and I don't think it would have solved my problem anyway. https://react-cn.github.io/react/tips/if-else-in-JSX.html
So I wrapped the two links in divs and used CSS to bring them closer together.
If you know of a better solution, I would love to learn something new!
Hey @ElishebaW Looks good to me! Thanks for your contribution 🎉
It's always difficult to decide what's the best solution when it comes to aligning components. But I think yours is fitting well! Perhaps another good read for conditional renderings beyond if-else statements is this one: https://www.robinwieruch.de/conditional-rendering-react/ Not sure if you have read it already, but it gives you a handful of neat options!
I wish you a happy new year!
@rwieruch Thanks! I bookmarked the article for future reference!
This pull request adds the dashboard link to the header so that the user doesn't have to enter the URL to navigate to the dashboard when logged in. @rwieruch