Korbs revised this gist . Go to revision
1 file changed, 9 insertions, 1 deletion
if-else-statement.astro
@@ -1,6 +1,14 @@ | |||
1 | + | --- | |
2 | + | var UserLogin = false | |
3 | + | --- | |
4 | + | ||
5 | + | <!-- Use this method if the results only returns "true" or "false" --> | |
6 | + | {UserLogin ? <p>Log Out</p> : <p>Sign in</p>} | |
7 | + | ||
8 | + | <!-- Use this method if the results return other results that are not labeled as "true" or "false --> | |
1 | 9 | { | |
2 | 10 | ()=> { | |
3 | - | if (user.login === true) { | |
11 | + | if (UserLogin === "external") { | |
4 | 12 | return <p>Log Out</p> | |
5 | 13 | } else { | |
6 | 14 | return <p>Sign In</p> |
Korbs revised this gist . Go to revision
1 file changed, 9 insertions
if-else-statement.astro(file created)
@@ -0,0 +1,9 @@ | |||
1 | + | { | |
2 | + | ()=> { | |
3 | + | if (user.login === true) { | |
4 | + | return <p>Log Out</p> | |
5 | + | } else { | |
6 | + | return <p>Sign In</p> | |
7 | + | } | |
8 | + | } | |
9 | + | } |