feat: replace back button with home button on public note list views
This commit is contained in:
28
src/components/HomeButton.vue
Normal file
28
src/components/HomeButton.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router"
|
||||
|
||||
const router = useRouter()
|
||||
const goHome = () => router.push({ name: "Home" })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a class="btn btn-sm" @click="goHome">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="icon icon-tabler icon-tabler-home"
|
||||
width="28"
|
||||
height="28"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M5 12l-2 0l9 -9l9 9l-2 0" />
|
||||
<path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
|
||||
<path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" />
|
||||
</svg>
|
||||
</a>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import BackButton from "@/components/BackButton.vue"
|
||||
import HomeButton from "@/components/HomeButton.vue"
|
||||
import PublicNoteList from "@/components/PublicNoteList.vue"
|
||||
import { usePublicNoteList } from "@/hooks/usePublicNoteList.hook"
|
||||
import { getAuthor } from "@/modules/atproto/getAuthor"
|
||||
@@ -17,7 +17,7 @@ const author = computedAsync(async () => getAuthor(did.value))
|
||||
<template>
|
||||
<main class="public-note-list-view">
|
||||
<div class="header">
|
||||
<back-button class="back-button" :fallback="{ name: 'Home' }" />
|
||||
<home-button class="back-button" />
|
||||
<h1>{{ author?.handle ?? did }}</h1>
|
||||
</div>
|
||||
<div v-if="isLoading"></div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import BackButton from "@/components/BackButton.vue"
|
||||
import HomeButton from "@/components/HomeButton.vue"
|
||||
import PublicNoteList from "@/components/PublicNoteList.vue"
|
||||
import SignInAtproto from "@/components/SignInAtproto.vue"
|
||||
import { useATProtoLogin } from "@/hooks/useATProtoLogin.hook"
|
||||
@@ -32,7 +32,7 @@ const following = useFollowingNoteList(follows, followingEnabled)
|
||||
<template>
|
||||
<main class="public-note-list-view">
|
||||
<div class="header">
|
||||
<back-button class="back-button" :fallback="{ name: 'Home' }" />
|
||||
<home-button class="back-button" />
|
||||
<h1><img src="/favicon.png" alt="Remanso icon" /></h1>
|
||||
<sign-in-atproto />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user