Skip to content

Commit

Permalink
refactor: clean routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludchieng committed Jan 24, 2023
1 parent 5d2932f commit 2aa7aa4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 40 deletions.
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import Vuex from 'vuex'
import VuexPersistence from 'vuex-persist'
import './registerServiceWorker'
import App from './App.vue'
import TimetablesPage from '@/pages/TimetablesPage.vue'
import SettingsPage from '@/pages/SettingsPage.vue'
import TimetablesHubPage from '@/pages/TimetablesHubPage.vue'
import TimetablesLinePage from '@/pages/TimetablesLinePage.vue'
import TimetablesStopPage from '@/pages/TimetablesStopPage.vue'

Vue.config.productionTip = false
Vue.use(VueRouter)
Expand All @@ -14,10 +16,9 @@ Vue.use(Vuex)
const routes = [
{ path: '/', component: App },
{ path: '/settings', component: SettingsPage },
{ path: '/timetables/', component: TimetablesPage },
{ path: '/timetables/:tab', component: TimetablesPage },
{ path: '/timetables/:tab/:line', component: TimetablesPage },
{ path: '/timetables/:tab/:line/:stop', component: TimetablesPage },
{ path: '/timetables/:tab', component: TimetablesHubPage },
{ path: '/timetables/:tab/:line', component: TimetablesLinePage },
{ path: '/timetables/:tab/:line/:stop', component: TimetablesStopPage },
]

const router = new VueRouter({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="tab-page-new">
<div class="page">
<div
v-for="category in linesByCategory"
:key="category.name"
Expand Down Expand Up @@ -29,7 +29,7 @@ import { getLinesByCategory } from '@/utils/localstore/lines'
import DesignTitle from '@/components/design/DesignTitle.vue'
export default Vue.extend({
name: 'TimetablesHome',
name: 'TimetablesHubPage',
components: {
LineIcon,
DesignTitle,
Expand All @@ -43,7 +43,7 @@ export default Vue.extend({
</script>

<style scoped>
.tab-page-new {
.page {
padding: 1rem;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="tab-page-line">
<div class="page">
<LineRouteMap :line="$route.params.line"/>
</div>
</template>
Expand All @@ -9,13 +9,13 @@ import Vue from 'vue'
import LineRouteMap from '@/components/LineMap/LineMap.vue'
export default Vue.extend({
name: 'TimetablesLine',
name: 'TimetablesLinePage',
components: { LineRouteMap },
})
</script>

<style scoped>
.tab-page-line {
.page {
padding: 10rem 1rem 4rem 1rem;
}
</style>
26 changes: 0 additions & 26 deletions src/pages/TimetablesPage.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="tab-page-stop">
<div class="page">
<StopHeader :stop="stop" />
<StopPrevNextStops :stop="stop" />
<StopTimetable :stop="stop" />
Expand All @@ -15,7 +15,7 @@ import StopPrevNextStops from '@/components/Stop/StopPrevNextStops.vue'
import { getStop } from '@/utils/localstore/stops'
export default Vue.extend({
name: 'TimetablesStop',
name: 'TimetablesStopPage',
components: {
StopTimetable,
StopHeader,
Expand Down Expand Up @@ -45,7 +45,7 @@ export default Vue.extend({
</script>

<style scoped>
.tab-page-stop {
.page {
padding: 0 1rem 8rem 1rem;
}
</style>

0 comments on commit 2aa7aa4

Please sign in to comment.