From 694ee7e89ffbfe12a8e3328998c2bc85c6d7704b Mon Sep 17 00:00:00 2001 From: Carter Date: Tue, 30 Jan 2024 12:29:27 -0800 Subject: [PATCH] split from page components --- theseus_gui/src/App.vue | 74 +++++++++++++++++++----- theseus_gui/src/helpers/icon.js | 12 ++++ theseus_gui/src/pages/Index.vue | 26 ++++----- theseus_gui/src/pages/Library.vue | 16 ++--- theseus_gui/src/pages/instance/Index.vue | 22 ++++++- theseus_gui/src/pages/instance/Mods.vue | 12 ++++ theseus_gui/src/store/instances.js | 43 ++++++++++++++ 7 files changed, 165 insertions(+), 40 deletions(-) create mode 100644 theseus_gui/src/helpers/icon.js create mode 100644 theseus_gui/src/store/instances.js diff --git a/theseus_gui/src/App.vue b/theseus_gui/src/App.vue index 868808e98..0263dd1da 100644 --- a/theseus_gui/src/App.vue +++ b/theseus_gui/src/App.vue @@ -13,9 +13,11 @@ import { Card, TextLogo, PlusIcon, + HamburgerIcon, } from 'omorphia' import { useLoading, useTheming } from '@/store/state' +import { useInstances } from '@/store/instances' // import AccountsCard from './components/ui/AccountsCard.vue' import AccountDropdown from '@/components/ui/platform/AccountDropdown.vue' import InstanceCreationModal from '@/components/ui/InstanceCreationModal.vue' @@ -38,6 +40,7 @@ import { useDisableClicks } from '@/composables/click.js' import { openExternal } from '@/helpers/external.js' import { await_sync, check_safe_loading_bars_complete } from '@/helpers/state.js' import { install_from_file } from '@/helpers/pack.js' +import { iconPathAsUrl } from '@/helpers/icon' import URLConfirmModal from '@/components/ui/URLConfirmModal.vue' import StickyTitleBar from '@/components/ui/tutorial/StickyTitleBar.vue' @@ -50,6 +53,7 @@ import { TauriEvent } from '@tauri-apps/api/event' import { confirm } from '@tauri-apps/api/dialog' import { type } from '@tauri-apps/api/os' import { appWindow } from '@tauri-apps/api/window' +import { storeToRefs } from 'pinia' const themeStore = useTheming() const urlModal = ref(null) @@ -68,6 +72,9 @@ const onboardingVideo = ref() const failureText = ref(null) const os = ref('') +const instances = useInstances() +const { instancesByPlayed } = storeToRefs(instances) + defineExpose({ initialize: async () => { isLoading.value = false @@ -275,15 +282,8 @@ const toggleSidebar = () => { >
-
@@ -316,9 +316,23 @@ const toggleSidebar = () => { +
+
+
- - Meow + + + {{ instance.metadata.name }}
@@ -358,7 +372,6 @@ const toggleSidebar = () => {