diff --git a/src/App.vue b/src/App.vue
index 8997021..ab626c2 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,8 +1,12 @@
@@ -14,6 +18,7 @@ const showDroneParts = ref(false);
+
diff --git a/src/components/MyDropMenu.vue b/src/components/MyDropMenu.vue
index e0c3e43..801b271 100644
--- a/src/components/MyDropMenu.vue
+++ b/src/components/MyDropMenu.vue
@@ -22,6 +22,25 @@
text-color="#ffffff"
active-text-color="#23aae3"
>
+
+
+
+
+
+
@@ -30,7 +49,7 @@
v-for="(item, index) in informationForDirectory"
:key="item.title"
:index="`term-${index}`"
- class="terms-menu-item"
+ class="menu-list-item"
@click="openInfoCard(item)"
>
@@ -147,7 +187,8 @@ h1 {
background-color: rgba(255, 255, 255, 0.1);
}
-.terms-menu-item {
+.terms-menu-item,
+.menu-list-item {
height: auto;
line-height: normal;
padding: 0;
@@ -155,12 +196,14 @@ h1 {
white-space: normal;
}
-.terms-menu-item :deep(.list-card) {
+.terms-menu-item :deep(.list-card),
+.menu-list-item :deep(.list-card) {
margin: 0;
width: 100%;
}
-.terms-menu-item.is-active {
+.terms-menu-item.is-active,
+.menu-list-item.is-active {
background-color: transparent !important;
}
diff --git a/src/composables/usePartsCatalog.js b/src/composables/usePartsCatalog.js
new file mode 100644
index 0000000..3d4a83a
--- /dev/null
+++ b/src/composables/usePartsCatalog.js
@@ -0,0 +1,36 @@
+import { ref } from 'vue'
+
+const parts = ref([])
+let loadPromise = null
+
+export function usePartsCatalog() {
+ async function loadParts() {
+ if (parts.value.length) {
+ return parts.value
+ }
+
+ if (!loadPromise) {
+ loadPromise = fetch('/droneComponents/components.json')
+ .then((response) => (response.ok ? response.json() : []))
+ .then((data) => {
+ parts.value = data
+ return data
+ })
+ .catch(() => {
+ parts.value = []
+ return []
+ })
+ .finally(() => {
+ loadPromise = null
+ })
+ }
+
+ return loadPromise
+ }
+
+ function getPartById(id) {
+ return parts.value.find((part) => part.id === id) ?? null
+ }
+
+ return { parts, loadParts, getPartById }
+}
diff --git a/src/composables/useTopicResolver.js b/src/composables/useTopicResolver.js
new file mode 100644
index 0000000..97f5b15
--- /dev/null
+++ b/src/composables/useTopicResolver.js
@@ -0,0 +1,22 @@
+import { usePartsCatalog } from '@/composables/usePartsCatalog'
+
+export async function resolveTopic(source, id) {
+ if (source === 'parts') {
+ const { loadParts, getPartById } = usePartsCatalog()
+ await loadParts()
+ const part = getPartById(Number(id))
+
+ if (!part) {
+ return null
+ }
+
+ return {
+ title: part.name,
+ subtitle: part.category,
+ image: part.image,
+ description: part.description,
+ }
+ }
+
+ return null
+}
diff --git a/src/router/index.js b/src/router/index.js
index 7d96f15..8028b42 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -14,6 +14,11 @@ const router = createRouter({
name: 'preview',
component: () => import('@/views/PreviewView.vue'),
},
+ {
+ path: '/topic/:source/:id',
+ name: 'topic',
+ component: () => import('@/views/TopicView.vue'),
+ },
],
})
diff --git a/src/views/PlannerView.vue b/src/views/PlannerView.vue
index 1489c16..11bbdd2 100644
--- a/src/views/PlannerView.vue
+++ b/src/views/PlannerView.vue
@@ -1,10 +1,9 @@
+
+
+
+
+
+