Skip to content

Commit

Permalink
feat(app): multi-tenant structure with tenancy identifier (string)
Browse files Browse the repository at this point in the history
  • Loading branch information
botprzemek committed Mar 22, 2024
1 parent 04e2966 commit d3870e5
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 12 deletions.
17 changes: 9 additions & 8 deletions components/navigation/RouteList.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
<script setup lang="ts">
const route = useRoute();
const routes = [
{
name: "home",
path: "/dashboard",
path: "dashboard",
},
{
name: "teams",
path: "/dashboard/teams",
path: "dashboard/teams",
},
{
name: "live",
path: "/dashboard/live",
path: "dashboard/live",
},
{
name: "leaderboard",
path: "/dashboard/leaderboard",
path: "dashboard/leaderboard",
},
{
name: "schedule",
path: "/dashboard/schedule",
path: "dashboard/schedule",
},
];
</script>

<template>
<nav class="flex-grow">
<ul>
<li v-for="route in routes" :key="route.name">
<NuxtLink :to="route.path">
{{ $t(`navigation.routes.${route.name}`) }}
<li v-for="child in routes" :key="child.name">
<NuxtLink :to="`/${route.params.tenancy}/${child.path}`">
{{ $t(`navigation.routes.${child.name}`) }}
</NuxtLink>
</li>
</ul>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions pages/[tenancy]/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
const route = useRoute();
const names = {
knury: "Knury Knurów",
};
</script>

<template>
<section class="w-screen h-screen grid place-content-center">
<h1>Welcome {{ names[route.params.tenancy] || "Error" }}!</h1>
<NuxtLink :to="`${route.params.tenancy}/dashboard`">Dashboard</NuxtLink>
</section>
</template>
4 changes: 0 additions & 4 deletions pages/index.vue

This file was deleted.

0 comments on commit d3870e5

Please sign in to comment.