-
+
@@ -102,17 +79,20 @@ import { computed, ref } from "vue"
import { useEditor } from "@/stores/editor"
import { useUserinfo } from "@/stores/userinfo"
import { useWellKnown } from "@/stores/wellKnown"
+import { useUI } from "@/stores/ui"
import PostTools from "@/components/publish/PostTools.vue"
import RealmTools from "@/components/realms/RealmTools.vue"
import RealmList from "@/components/realms/RealmList.vue"
import NotificationList from "@/components/NotificationList.vue"
+const ui = useUI()
+
const safeAreaTop = computed(() => {
- return getComputedStyle(document.documentElement).getPropertyValue("--safe-area-top")
+ return `${ui.safeArea.top}px`
})
const safeAreaBottom = computed(() => {
- return getComputedStyle(document.documentElement).getPropertyValue("--safe-area-bottom")
+ return `${ui.safeArea.bottom}px`
})
const id = useUserinfo()
diff --git a/src/stores/ui.ts b/src/stores/ui.ts
new file mode 100644
index 0000000..b1e0a81
--- /dev/null
+++ b/src/stores/ui.ts
@@ -0,0 +1,11 @@
+import { defineStore } from "pinia"
+import { reactive } from "vue"
+
+export const useUI = defineStore("ui", () => {
+ const safeArea = reactive({
+ top: 0,
+ bottom: 0,
+ })
+
+ return { safeArea }
+})