strat-gameplay-webapp/frontend-sba/layouts/game.vue
Cal Corum 581bc33f15 CLAUDE: Move games list to index page for better UX
SBA users are already league members - they don't need a marketing page.
Moving the games list to "/" reduces friction by eliminating a redirect.

Changes:
- pages/index.vue: Now shows games list (was marketing/dashboard)
- pages/games/index.vue: Redirects to / for backwards compatibility
- Updated all internal links from /games to /
- Auth callback redirects to / after login

User flow is now:
- Not logged in: / → auth middleware → Discord OAuth → /
- Logged in: / shows games list directly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:59:34 -06:00

84 lines
2.6 KiB
Vue

<template>
<div class="min-h-screen flex flex-col bg-gray-900">
<!-- Minimal Header for Game View -->
<header class="bg-gray-800 text-white shadow-lg sticky top-0 z-50">
<div class="container mx-auto px-4 py-3">
<div class="flex items-center justify-between">
<!-- Back to Games -->
<NuxtLink
to="/"
class="flex items-center space-x-2 hover:text-gray-300 transition text-sm"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z"
clip-rule="evenodd"
/>
</svg>
<span>Back to Games</span>
</NuxtLink>
<!-- Logo -->
<div class="text-lg font-bold">SBA</div>
<!-- Connection Status -->
<div class="flex items-center space-x-3">
<!-- WebSocket Connection Indicator -->
<div
v-if="isConnected"
class="flex items-center space-x-2 text-green-400 text-sm"
>
<div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"/>
<span class="hidden sm:inline">Connected</span>
</div>
<div
v-else
class="flex items-center space-x-2 text-red-400 text-sm"
>
<div class="w-2 h-2 bg-red-400 rounded-full"/>
<span class="hidden sm:inline">Disconnected</span>
</div>
<!-- User -->
<div class="text-sm text-gray-400 hidden md:block">
{{ authStore.currentUser?.username }}
</div>
</div>
</div>
</div>
</header>
<!-- Game Content (Full Width, No Container) -->
<main class="flex-1 overflow-auto">
<slot />
</main>
<!-- Modals/Toasts Container -->
<div id="modal-container" class="relative z-50"/>
<div id="toast-container" class="fixed top-20 right-4 z-50 space-y-2"/>
</div>
</template>
<script setup lang="ts">
import { useAuthStore } from '~/store/auth'
import { useGameStore } from '~/store/game'
const authStore = useAuthStore()
const gameStore = useGameStore()
// WebSocket connection status
const isConnected = computed(() => gameStore.isConnected)
// Auth is initialized by the auth plugin automatically
</script>
<style scoped>
/* Game layout specific styles */
</style>