From 24c573ccf032f096906e71875d8762733596c303 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 23 Nov 2022 11:06:56 +0800 Subject: [PATCH] refactor: signin page --- components/account/AccountHeader.vue | 2 +- components/account/AccountSignIn.vue | 29 +++++++++++++++++++---- components/account/AccountSignInEntry.vue | 10 ++++++++ components/nav/NavSide.vue | 4 ++++ components/publish/PublishWidget.vue | 4 ++-- layouts/default.vue | 2 +- pages/signin/index.vue | 24 +------------------ shim.d.ts | 1 + tsconfig.json | 5 ---- unocss.config.ts | 5 ++-- 10 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 components/account/AccountSignInEntry.vue create mode 100644 shim.d.ts diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index 6e19946d..7dd99fab 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -25,7 +25,7 @@ const createdAt = $computed(() => { - +

@{{ account.acct }}

diff --git a/components/account/AccountSignIn.vue b/components/account/AccountSignIn.vue index 43865a26..abb6d924 100644 --- a/components/account/AccountSignIn.vue +++ b/components/account/AccountSignIn.vue @@ -1,10 +1,29 @@ + + diff --git a/components/account/AccountSignInEntry.vue b/components/account/AccountSignInEntry.vue new file mode 100644 index 00000000..43865a26 --- /dev/null +++ b/components/account/AccountSignInEntry.vue @@ -0,0 +1,10 @@ + diff --git a/components/nav/NavSide.vue b/components/nav/NavSide.vue index 4b0b5e85..4a40e232 100644 --- a/components/nav/NavSide.vue +++ b/components/nav/NavSide.vue @@ -38,6 +38,10 @@
Bookmarks + + + Profile +
diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 4fbc68ac..b4591b70 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -55,8 +55,8 @@ onUnmounted(() => { />
diff --git a/pages/signin/index.vue b/pages/signin/index.vue index c0d5e5b3..279a3992 100644 --- a/pages/signin/index.vue +++ b/pages/signin/index.vue @@ -2,30 +2,8 @@ definePageMeta({ layout: 'none', }) - -const server = ref() - -async function oauth() { - const a = document.createElement('a') - a.href = `/api/${server.value}/login` - a.target = '_blank' - a.click() -} diff --git a/shim.d.ts b/shim.d.ts new file mode 100644 index 00000000..7642b6ce --- /dev/null +++ b/shim.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json index 12539ff5..740c4a37 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "./.nuxt/tsconfig.json", - "compilerOptions": { - "types": [ - "unplugin-vue-macros/macros-global" - ] - }, "vueCompilerOptions": { "plugins": [ "@vue-macros/volar/define-model", diff --git a/unocss.config.ts b/unocss.config.ts index 95068164..6c66a8a2 100644 --- a/unocss.config.ts +++ b/unocss.config.ts @@ -15,8 +15,9 @@ export default defineConfig({ 'border-base': 'border-$c-border', 'bg-base': 'bg-$c-bg-base', 'text-base': 'text-$c-text-base', - 'btn-solid': 'px-4 py-2 rounded text-white bg-$c-primary hover:bg-$c-primary-active', - 'btn-outline': 'px-4 py-2 rounded text-$c-primary border-$c-primary hover:bg-$c-primary hover:text-white', + 'interact-disabled': 'disabled:opacity-50 disabled:pointer-events-none disabled:saturate-0', + 'btn-solid': 'px-4 py-2 rounded text-white bg-$c-primary hover:bg-$c-primary-active interact-disabled', + 'btn-outline': 'px-4 py-2 rounded text-$c-primary border-$c-primary hover:bg-$c-primary hover:text-white interact-disabled', }, ], presets: [