Closed frankcollins3 closed 1 year ago
first proposed approach including conditionally declaring which function would be run in the onClick prop but wondering how to get imgSrc if that context is declared in the other element prop.
onClick={leftIconClick}
new approach: { <img onClick={login} src={exit} <img onClick={logout} src={NON_GOOGLE_IMG_URL }
onClick={NON_GOOGLE_IMG_URL ? logout : login}
this would've also worked. {
} [5:03pm]
attempting to do: poor man's logout based exclusively on cookies (while login uses Oauth2.0)
error: for this code:
that function is based on this UI which is leads to login/signup if no userCookies, and is the profile icon if signed in. it's also the logout button.
<img onClick={loginLogout} id="loginLogoutIcon" src={ NON_GOOGLE_IMG_URL ? NON_GOOGLE_IMG_URL : exit}/>
proposed approach: separate concerns of the else if block not running. ternary to render different functions