From 97239b8fe0dd5b438c78f91e76df84d0bff59cb6 Mon Sep 17 00:00:00 2001 From: Marco La Rosa Date: Fri, 3 Nov 2023 10:32:43 +1100 Subject: [PATCH] implement deep linking of langauges and words commit 8d841926b10f72abf165ce6bb4c4e94f894e2154 Author: Marco La Rosa Date: Fri Nov 3 09:58:37 2023 +1100 deep linking related changes commit e76e0b672791665005611bba8b7aa338165edb7b Author: Marco La Rosa Date: Fri Nov 3 09:55:51 2023 +1100 trigger and await data loading before mount This is required for deep linking to languages and words to work. In the old way of dispatch the store we wouldn't know when the data was available and ready. commit ee472c904f36094e3fb705910820638fcf8ec059 Author: Marco La Rosa Date: Fri Nov 3 09:54:10 2023 +1100 adjust layout commit 5355d20964695f99c24be50a9d73b8a2d1d95ef8 Author: Marco La Rosa Date: Fri Nov 3 09:53:44 2023 +1100 revise map height for small screens commit 7e3ec21f5b0ff861045c1a20aa5b6b57f2662f4e Author: Marco La Rosa Date: Fri Nov 3 09:33:12 2023 +1100 revise home link to be languages commit ee80ba0cc115d7cc439b5b5ce67574ad33ddf54f Author: Marco La Rosa Date: Fri Nov 3 09:29:12 2023 +1100 set bounds on mamp init; cleanup commit f82af1ff9fda1b9e763e45a97d176e0ba44b7cf3 Author: Marco La Rosa Date: Fri Nov 3 09:28:16 2023 +1100 add routes for deep links to langauges and words --- src/components/Header.component.vue | 2 +- src/components/HeaderMobile.component.vue | 6 +- src/components/InformationPanel.component.vue | 108 +++++++++++------- ...InformationPanelLanguageList.component.vue | 25 +++- ...InformationPanelViewLanguage.component.vue | 61 ++++------ .../InformationPanelViewWord.component.vue | 62 +++++----- .../InformationPanelWordList.component.vue | 23 +++- src/components/Map.component.vue | 68 +---------- src/components/Shell.component.vue | 68 +++++------ src/routes.js | 23 +++- 10 files changed, 214 insertions(+), 232 deletions(-) diff --git a/src/components/Header.component.vue b/src/components/Header.component.vue index 8db45d4..f501ec8 100644 --- a/src/components/Header.component.vue +++ b/src/components/Header.component.vue @@ -80,6 +80,6 @@ function playAll() { router.push({ name: "playall" }); } function home() { - router.push({ name: "home" }); + router.push({ name: "languages" }); } diff --git a/src/components/HeaderMobile.component.vue b/src/components/HeaderMobile.component.vue index d49485a..19ad96d 100644 --- a/src/components/HeaderMobile.component.vue +++ b/src/components/HeaderMobile.component.vue @@ -1,6 +1,6 @@ - - - diff --git a/src/components/InformationPanelViewWord.component.vue b/src/components/InformationPanelViewWord.component.vue index b643e24..156a310 100644 --- a/src/components/InformationPanelViewWord.component.vue +++ b/src/components/InformationPanelViewWord.component.vue @@ -1,5 +1,5 @@ - - - diff --git a/src/components/InformationPanelWordList.component.vue b/src/components/InformationPanelWordList.component.vue index fddc207..0cc2882 100644 --- a/src/components/InformationPanelWordList.component.vue +++ b/src/components/InformationPanelWordList.component.vue @@ -13,19 +13,34 @@ diff --git a/src/components/Map.component.vue b/src/components/Map.component.vue index 6005af2..db771b8 100644 --- a/src/components/Map.component.vue +++ b/src/components/Map.component.vue @@ -7,7 +7,7 @@ 'width-screen cursor-pointer': smallDevice, }" :style="{ - height: smallDevice ? (selection.type ? '30vh' : '45vh') : mapHeight, + height: smallDevice ? (selection.type ? '30vh' : '60vh') : mapHeight, }" > +let selection = computed(() => $store.getters.getSelectionData()); +let layer = computed(() => $store.state.layer); +let ready = ref(false); +onBeforeMount(async () => { + console.time(); + let languages = await loadLanguages(); + $store.commit("setLanguages", languages); - + let words = await loadWords(); + $store.commit("setWords", words); + console.timeEnd(); + ready.value = true; +}); + diff --git a/src/routes.js b/src/routes.js index fdfa53d..de99953 100644 --- a/src/routes.js +++ b/src/routes.js @@ -10,7 +10,28 @@ const routes = [ path: "/", name: "home", component: ShellComponent, - children: [], + children: [ + { + path: "/languages", + name: "languages", + component: ShellComponent, + }, + { + path: "/languages/:language", + name: "language", + component: ShellComponent, + }, + { + path: "/words", + name: "words", + component: ShellComponent, + }, + { + path: "/words/:word", + name: "word", + component: ShellComponent, + }, + ], }, { name: "playall",