-
- Nuxtodon
+
+ Sign in
-
-
Mastodon Server
+
Mastodon Server Name
https://
-
diff --git a/components/account/AccountSwitcher.vue b/components/account/AccountSwitcher.vue
new file mode 100644
index 00000000..c32c309f
--- /dev/null
+++ b/components/account/AccountSwitcher.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/components/modal/ModalContainer.vue b/components/modal/ModalContainer.vue
new file mode 100644
index 00000000..954803db
--- /dev/null
+++ b/components/modal/ModalContainer.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+ Switch Account
+
+
+
+
+
+
+
+ Add another account
+
+
+
+
+
+
+
+
diff --git a/components/modal/ModalDialog.vue b/components/modal/ModalDialog.vue
new file mode 100644
index 00000000..0262b820
--- /dev/null
+++ b/components/modal/ModalDialog.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/components/modal/ModalDrawer.vue b/components/modal/ModalDrawer.vue
new file mode 100644
index 00000000..94a8043e
--- /dev/null
+++ b/components/modal/ModalDrawer.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
diff --git a/composables/accounts.ts b/composables/accounts.ts
index 1e7736a0..72e2b28e 100644
--- a/composables/accounts.ts
+++ b/composables/accounts.ts
@@ -18,7 +18,9 @@ export const currentUser = computed
(() => {
export const currentServer = computed(() => currentUser.value?.server || DEFAULT_SERVER)
-export async function loginCallback(user: UserLogin) {
+export const useAccounts = () => accounts
+
+export async function loginTo(user: UserLogin) {
const existing = accounts.value.findIndex(u => u.server === user.server && u.token === user.token)
if (existing !== -1) {
if (currentId.value === accounts.value[existing].account?.id)
diff --git a/composables/content.ts b/composables/content.ts
index f1d55c14..916b2fa4 100644
--- a/composables/content.ts
+++ b/composables/content.ts
@@ -8,9 +8,6 @@ import { RouterLink } from 'vue-router'
type Node = DefaultTreeAdapterMap['childNode']
type Element = DefaultTreeAdapterMap['element']
-const UserLinkRE = /^https?:\/\/([^/]+)\/@([^/]+)$/
-const TagLinkRE = /^https?:\/\/([^/]+)\/tags\/([^/]+)$/
-
export function defaultHandle(el: Element) {
// Redirect mentions to the user page
if (el.tagName === 'a' && el.attrs.find(i => i.name === 'class' && i.value.includes('mention'))) {
diff --git a/composables/dialog.ts b/composables/dialog.ts
new file mode 100644
index 00000000..86526c17
--- /dev/null
+++ b/composables/dialog.ts
@@ -0,0 +1,11 @@
+export const isAccountSwitcherOpen = ref(false)
+export const isSigninDialogOpen = ref(false)
+
+export function openAccountSwitcher() {
+ isAccountSwitcherOpen.value = true
+}
+
+export function openSigninDialog() {
+ isSigninDialogOpen.value = true
+ isAccountSwitcherOpen.value = false
+}
diff --git a/composables/utils.ts b/composables/utils.ts
index 11bc5fa7..a2eaf2a0 100644
--- a/composables/utils.ts
+++ b/composables/utils.ts
@@ -1,5 +1,8 @@
import type { Emoji } from 'masto'
+export const UserLinkRE = /^https?:\/\/([^/]+)\/@([^/]+)$/
+export const TagLinkRE = /^https?:\/\/([^/]+)\/tags\/([^/]+)$/
+
export function getDataUrlFromArr(arr: Uint8ClampedArray, w: number, h: number) {
if (typeof w === 'undefined' || typeof h === 'undefined')
w = h = Math.sqrt(arr.length / 4)
diff --git a/layouts/default.vue b/layouts/default.vue
index bc5d8153..25b28ac5 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -4,7 +4,10 @@
+