design: remodel public list and public notes
This commit is contained in:
@@ -4,6 +4,14 @@
|
|||||||
|
|
||||||
<repo-list />
|
<repo-list />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Lite notes are
|
||||||
|
|
||||||
|
<router-link :to="{ name: 'PublicNoteListView' }" class="btn btn-link"
|
||||||
|
>now public</router-link
|
||||||
|
>!
|
||||||
|
</p>
|
||||||
|
|
||||||
<last-visited />
|
<last-visited />
|
||||||
|
|
||||||
<div class="get-started">
|
<div class="get-started">
|
||||||
@@ -19,9 +27,6 @@
|
|||||||
<router-link v-if="isLogged" :to="{ name: 'RepoList' }" class="btn"
|
<router-link v-if="isLogged" :to="{ name: 'RepoList' }" class="btn"
|
||||||
>Manage your repos</router-link
|
>Manage your repos</router-link
|
||||||
>
|
>
|
||||||
<router-link :to="{ name: 'PublicNoteListView' }" class="btn"
|
|
||||||
>Public notes</router-link
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form class="github-form" @submit.prevent>
|
<form class="github-form" @submit.prevent>
|
||||||
|
|||||||
@@ -24,25 +24,73 @@ const getAlias = (did: string) => aka.value.get(did) ?? ""
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="isLoading"></div>
|
<main class="public-note-view">
|
||||||
<div class="public-note-view" v-else>
|
<h1>Lite public notes</h1>
|
||||||
<ul>
|
<div v-if="isLoading"></div>
|
||||||
<li v-for="note in state.notes">
|
<div v-else>
|
||||||
{{ getAlias(note.did) }}:
|
<ul class="list rounded-box shadow-sm">
|
||||||
<router-link
|
<li v-for="note in state.notes" class="list-row">
|
||||||
:to="{
|
<div class="list-col">
|
||||||
name: 'PublicNoteView',
|
<div>
|
||||||
params: { did: note.did, rkey: note.rkey },
|
<router-link
|
||||||
}"
|
:to="{
|
||||||
class="btn btn-link"
|
name: 'PublicNoteView',
|
||||||
>{{ note.title }}</router-link
|
params: { did: note.did, rkey: note.rkey },
|
||||||
>
|
}"
|
||||||
</li>
|
class="btn btn-link"
|
||||||
</ul>
|
>{{ note.title }}</router-link
|
||||||
</div>
|
>
|
||||||
|
</div>
|
||||||
|
<div class="text-xs uppercase font-semibold opacity-60">
|
||||||
|
<span v-if="getAlias(note.did)">
|
||||||
|
{{ getAlias(note.did) }}
|
||||||
|
</span>
|
||||||
|
<div v-else class="skeleton h-4 w-20"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'Home' }"
|
||||||
|
class="button is-small is-white back-button"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
class="icon icon-tabler icon-tabler-arrow-narrow-left"
|
||||||
|
width="28"
|
||||||
|
height="28"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5"
|
||||||
|
stroke="currentColor"
|
||||||
|
fill="none"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<line x1="5" y1="12" x2="19" y2="12" />
|
||||||
|
<line x1="5" y1="12" x2="9" y2="16" />
|
||||||
|
<line x1="5" y1="12" x2="9" y2="8" />
|
||||||
|
</svg>
|
||||||
|
return home
|
||||||
|
</router-link>
|
||||||
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.public-note-view {
|
.public-note-view {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 1rem;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { markdownBuilder } from "@/hooks/useMarkdown.hook"
|
import { markdownBuilder } from "@/hooks/useMarkdown.hook"
|
||||||
|
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
|
||||||
import { getUniqueAka } from "@/modules/atproto/getAka"
|
import { getUniqueAka } from "@/modules/atproto/getAka"
|
||||||
import { getUrl } from "@/modules/atproto/getUrl"
|
import { getUrl } from "@/modules/atproto/getUrl"
|
||||||
import { computedAsync } from "@vueuse/core"
|
import { computedAsync } from "@vueuse/core"
|
||||||
@@ -39,6 +40,7 @@ export interface Ref {
|
|||||||
const props = defineProps<{ did: string; rkey: string }>()
|
const props = defineProps<{ did: string; rkey: string }>()
|
||||||
const did = computed(() => props.did)
|
const did = computed(() => props.did)
|
||||||
const rkey = computed(() => props.rkey)
|
const rkey = computed(() => props.rkey)
|
||||||
|
const { scrollToFocusedNote } = useRouteQueryStackedNotes()
|
||||||
|
|
||||||
const alias = computedAsync(async () => getUniqueAka(did.value))
|
const alias = computedAsync(async () => getUniqueAka(did.value))
|
||||||
const url = computedAsync(async () =>
|
const url = computedAsync(async () =>
|
||||||
@@ -49,7 +51,7 @@ const rawContent = computedAsync(async () =>
|
|||||||
)
|
)
|
||||||
const { toHTML } = markdownBuilder()
|
const { toHTML } = markdownBuilder()
|
||||||
|
|
||||||
// const title = computed(() => rawContent.value?.value.title)
|
const title = computed(() => rawContent.value?.value.title)
|
||||||
const content = computed(() =>
|
const content = computed(() =>
|
||||||
rawContent.value?.value.content
|
rawContent.value?.value.content
|
||||||
? toHTML(rawContent.value?.value.content)
|
? toHTML(rawContent.value?.value.content)
|
||||||
@@ -59,12 +61,90 @@ const content = computed(() =>
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="public-note-view">
|
<div class="public-note-view">
|
||||||
<span v-if="alias">{{ alias }}</span>
|
<div class="note article">
|
||||||
<div v-html="content"></div>
|
<div class="repo-title-breadcrumb">
|
||||||
|
<a
|
||||||
|
class="title-stacked-note-link"
|
||||||
|
@click.prevent="scrollToFocusedNote()"
|
||||||
|
v-if="alias && title"
|
||||||
|
>{{ alias }} | {{ title }}</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<article v-html="content" class="note"></article>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss">
|
||||||
.public-note-view {
|
.public-note-view {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.article {
|
||||||
|
padding: 0 2rem;
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.content {
|
||||||
|
.title,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
strong {
|
||||||
|
color: var(--color-base-content);
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
color: var(--color-base-content);
|
||||||
|
background-color: var(--color-base-100);
|
||||||
|
|
||||||
|
thead {
|
||||||
|
th {
|
||||||
|
color: var(--color-base-content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
background-color: var(--color-base-100);
|
||||||
|
color: var(--color-base-content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.note {
|
||||||
|
position: sticky;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 100vh;
|
||||||
|
position: sticky;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 769px) {
|
||||||
|
.repo-title-breadcrumb {
|
||||||
|
padding: 0.5rem 1rem 0;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
transform: rotate(90deg);
|
||||||
|
font-size: 0.8em;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--color-base-content);
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.note {
|
||||||
|
min-width: var(--note-width);
|
||||||
|
max-width: var(--note-width);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user