Skip to content

Commit

Permalink
hook up mod dev tools platform selection to router
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Nov 11, 2024
1 parent 0c69bd8 commit 2f4d0be
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 29 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/reusable/PlatformSelectPanels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const items = ref([{
label: 'Package Validater',
icon: 'pi pi-check-square'
}])
const props = defineEmits(['selectThunderstore', 'selectNexus'])
</script>

<template>
Expand All @@ -48,7 +50,7 @@ const items = ref([{
<div class="blur w-full h-full">
<div class="flex column panel-text">
Thunderstore
<Button class="mt-3" label="Select"/>
<Button class="mt-3" label="Select" @click="$emit('selectThunderstore')"/>
</div>
</div>
</SplitterPanel>
Expand All @@ -57,7 +59,7 @@ const items = ref([{
<div class="blur w-full h-full">
<div class="flex column panel-text">
Nexus Mods
<Button class="mt-3" label="Select"/>
<Button class="mt-3" label="Select" @click="$emit('selectNexus')"/>
</div>
</div>
</SplitterPanel>
Expand Down
19 changes: 15 additions & 4 deletions frontend/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import type { RouteRecordRaw } from 'vue-router'
const Dashboard = () => import('../views/Dashboard.vue')
const GameSelection = () => import('../views/GameSelection.vue')
const SelectedGame = () => import('../views/SelectedGame.vue')
const ModDevTools = () => import('../views/mod-dev-tools/ModDevTools.vue')

const ModDevTools = () => import('../views/mod-dev-tools/PlatformSelection.vue')
const ModDevToolsThunderstore = () => import('../views/mod-dev-tools/Thunderstore.vue')
const ModDevToolsNexus = () => import('../views/mod-dev-tools/Nexus.vue')

const ROUTES: RouteRecordRaw[] = [{
path: '/',
name: 'Dashboard',
path: '/',
name: 'Dashboard',
component: Dashboard
}, {
path: '/game-selection',
Expand All @@ -19,8 +22,16 @@ const ROUTES: RouteRecordRaw[] = [{
component: SelectedGame
}, {
path: '/mod-dev-tools',
name: 'Mod Dev Tools',
name: 'Mod Dev Tools (Platform Selection)',
component: ModDevTools
}, {
path: '/mod-dev-tools/thunderstore',
name: 'Mod Dev Tools (Thunderstore)',
component: ModDevToolsThunderstore
}, {
path: '/mod-dev-tools/nexus',
name: 'Mod Dev Tools (Nexus)',
component: ModDevToolsNexus
}]

export default ROUTES
23 changes: 0 additions & 23 deletions frontend/src/views/mod-dev-tools/ModDevTools.vue

This file was deleted.

11 changes: 11 additions & 0 deletions frontend/src/views/mod-dev-tools/Nexus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts" setup>
</script>

<template>

</template>

<style scoped>
</style>
30 changes: 30 additions & 0 deletions frontend/src/views/mod-dev-tools/PlatformSelection.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script lang="ts" setup>
import { PlatformSelectPanels } from "@components"
import { onUnmounted, ref } from "vue"
// enum Platform {
// THUNDERSTORE = 1,
// NEXUS
// }
// const selectedPlatform = ref(0)
// const setSelectedPlatform = (platform: Platform) => {
// selectedPlatform.value = platform
// console.log(`[ModDevTools] Selected platform set to '${Platform[platform]}'. Index: ${platform}`)
// }
// onUnmounted(() => {
// selectedPlatform.value = 0
// })
</script>

<template>
<PlatformSelectPanels
@selectThunderstore="$router.push('/mod-dev-tools/thunderstore')"
@selectNexus="$router.push('/mod-dev-tools/nexus')"
/>
</template>

<style scoped>
</style>
11 changes: 11 additions & 0 deletions frontend/src/views/mod-dev-tools/Thunderstore.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts" setup>
</script>

<template>

</template>

<style scoped>
</style>

0 comments on commit 2f4d0be

Please sign in to comment.