Skip to content

Commit

Permalink
button on home to login if not loggedin
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Nov 14, 2024
1 parent ccf9941 commit f4e3698
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
<p>Zum Github-Repo:</p>
<a class="text-accent underline" href="https://github.com/probablyjassin/studenplancampusdual">probablyjassin/stundenplancampusdual</a>
</span>
<UButton v-if="isLoggedIn" to="/dash/stundenplan" block class="w-1/3">Zum Stundenplan</UButton>
<USkeleton v-if="!isMounted" class="h-8 w-1/3"></USkeleton>
<UButton v-else-if="isMounted && isLoggedIn" to="/dash/stundenplan" block class="w-1/3">Zum Stundenplan</UButton>
<UButton v-else to="/login" block class="w-1/3">Anmelden</UButton>
</div>
</div>
</template>

<script setup>
const isLoggedIn = useState("isLoggedIn", (() => false))
const isMounted = ref(false)
onMounted(() => {
isMounted.value = true
})
</script>

0 comments on commit f4e3698

Please sign in to comment.