Chg: コミュニティ・チャンネルのUI

This commit is contained in:
2026-06-01 22:02:19 +09:00
parent 2abbe66d06
commit e009526798
6 changed files with 133 additions and 58 deletions
+12 -1
View File
@@ -54,7 +54,12 @@
</div> </div>
<div class="content-main"> <div class="content-main">
<div class="content-header"> <div
class="content-header"
:class='isHiddenTitleBar
? "isHidden"
: ""'
>
{{ {{
title title
?? (serverInfo?.success ?? (serverInfo?.success
@@ -187,6 +192,7 @@ main.layout {
} }
.content-header { .content-header {
display: block;
padding: 1rem 1.25rem; padding: 1rem 1.25rem;
font-size: 1.3rem; font-size: 1.3rem;
font-weight: bold; font-weight: bold;
@@ -198,6 +204,10 @@ main.layout {
-webkit-user-select: none; -webkit-user-select: none;
} }
.content-header.isHidden {
display: none;
}
.route-main { .route-main {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -256,6 +266,7 @@ const router = useRouter();
const route = useRoute(); const route = useRoute();
const isFullRoute = computed(() => route.meta.isFullRoute === true); const isFullRoute = computed(() => route.meta.isFullRoute === true);
const isHiddenTitleBar = computed(() => route.meta.isHiddenTitleBar === true);
watch(route, () => { watch(route, () => {
if (typeof route.meta.title === "string") if (typeof route.meta.title === "string")
@@ -151,6 +151,13 @@ const deleteMessage = async () => {
resolve(); resolve();
break; break;
default: default:
createTopNotice({
props: {
icon: "material-symbols:error-outline-rounded",
iconColor: "var(--error-color)",
message: "キャンセルしました",
},
});
return; return;
} }
}, },
+1
View File
@@ -58,6 +58,7 @@ const router = createRouter({
meta: { meta: {
title: "コミュニティ", title: "コミュニティ",
isFullRoute: true, isFullRoute: true,
isHiddenTitleBar: true,
}, },
component: () => import("@/routes/community/index.vue"), component: () => import("@/routes/community/index.vue"),
children: [ children: [
@@ -9,44 +9,51 @@
v-if="!isProcessing && channel" v-if="!isProcessing && channel"
class="channel" class="channel"
> >
<div class="messages" @scroll.passive="messagesScroll"> <div class="community-top-info">
<div class="none-message" v-if="messages.length === 0"> <Icon icon="material-symbols:chat-rounded" />
<span>何ということでしょう</span> {{ channel.name }}
<span>メッセージがありませんね</span>
</div>
<Progress
v-if="isLoading"
:size="10"
class="loading-progress"
/>
<Message
v-for="message of messages"
@deleteMessage="deleteMessage"
:key="message.id"
:message="message"
/>
</div> </div>
<form> <div class="main">
<textarea <div class="messages" @scroll.passive="messagesScroll">
@input="resize" <div class="none-message" v-if="messages.length === 0">
@keydown.ctrl.enter="send" <span>何ということでしょう</span>
class="message-input" <span>メッセージがありませんね</span>
rows="1" </div>
v-model="message"
:disabled="isSending"
:placeholder="`${channel.name}に送信`"
/>
<Icon <Progress
@click="send" v-if="isLoading"
:icon='isSending :size="10"
? "line-md:loading-twotone-loop" class="loading-progress"
: "material-symbols:send-rounded"' />
/>
</form> <Message
v-for="message of messages"
@deleteMessage="deleteMessage"
:key="message.id"
:message="message"
/>
</div>
<form>
<textarea
@input="resize"
@keydown.ctrl.enter="send"
class="message-input"
rows="1"
v-model="message"
:disabled="isSending"
:placeholder="`${channel.name}に送信`"
/>
<Icon
@click="send"
:icon='isSending
? "line-md:loading-twotone-loop"
: "material-symbols:send-rounded"'
/>
</form>
</div>
</div> </div>
</template> </template>
@@ -55,6 +62,12 @@
margin: auto; margin: auto;
} }
.community-top-info svg {
margin: auto 0;
width: 1.25rem;
height: 1.25rem;
}
.channel { .channel {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -62,6 +75,13 @@
height: 100%; height: 100%;
} }
.main {
display: flex;
flex-direction: column;
flex-grow: 1;
padding: 1rem;
}
.messages { .messages {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -91,7 +111,6 @@
display: flex; display: flex;
gap: 0.5rem; gap: 0.5rem;
padding: 1rem; padding: 1rem;
margin-bottom: 1rem;
border-radius: 1rem; border-radius: 1rem;
background-color: var(--bg-sub-color); background-color: var(--bg-sub-color);
} }
@@ -1,2 +1,11 @@
<template> <template>
<span>チャンネルを選びやがれ</span>
</template> </template>
<style scoped>
span {
margin: auto;
font-size: 1.25rem;
font-weight: bold;
}
</style>
@@ -6,20 +6,26 @@
/> />
<div <div
v-if="!isProcessing && channels" v-if="!isProcessing && presentCommunity && channels"
class="community" class="community"
> >
<div class="channels"> <div class="left">
<RouterLink <div class="community-top-info">
v-for="channel of channels" {{ presentCommunity.name }}
:to="`/community/${$route.params.communityId}/${channel.id}`" </div>
:class='route.fullPath === `/community/${$route.params.communityId}/${channel.id}`
? "isActive" <div class="channels">
: ""' <RouterLink
> v-for="channel of channels"
<Icon icon="material-symbols:chat-rounded" /> :to="`/community/${$route.params.communityId}/${channel.id}`"
<span>{{ channel.name }}</span> :class='route.fullPath === `/community/${$route.params.communityId}/${channel.id}`
</RouterLink> ? "isActive"
: ""'
>
<Icon icon="material-symbols:chat-rounded" />
<span>{{ channel.name }}</span>
</RouterLink>
</div>
</div> </div>
<span class="border" /> <span class="border" />
@@ -32,6 +38,22 @@
</div> </div>
</template> </template>
<style>
.community-top-info {
display: flex;
gap: 0.25rem;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border-bottom: 1px solid var(--border-color);
padding: 1rem;
font-size: 1.1rem;
font-weight: bold;
box-sizing: border-box;
}
</style>
<style scoped> <style scoped>
.processing-progress { .processing-progress {
margin: auto; margin: auto;
@@ -40,16 +62,13 @@
.community { .community {
height: 100%; height: 100%;
display: flex; display: flex;
padding-left: 1rem;
padding-right: 1rem;
} }
.channels { .left {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-top: 1rem;
box-sizing: border-box; box-sizing: border-box;
width: 16rem; width: 18rem;
height: 100%; height: 100%;
border-top-right-radius: 2rem; border-top-right-radius: 2rem;
border-bottom-right-radius: 2rem; border-bottom-right-radius: 2rem;
@@ -60,10 +79,22 @@
flex-shrink: 0; flex-shrink: 0;
} }
.channels {
display: flex;
flex-direction: column;
width: 100%;
flex-grow: 1;
gap: 1rem;
overflow: scroll;
padding: 1rem 1rem 0 1rem;
box-sizing: border-box;
}
.channels a { .channels a {
display: flex; display: flex;
color: var(--text-color); color: var(--text-color);
text-decoration: none; text-decoration: none;
padding-left: 1rem;
gap: 0.25rem; gap: 0.25rem;
height: 2rem; height: 2rem;
border: 1px solid transparent; border: 1px solid transparent;
@@ -101,13 +132,10 @@
.community .border { .community .border {
width: 1px; width: 1px;
height: 100%; height: 100%;
margin-right: 1rem;
margin-left: 1rem;
background-color: var(--border-color); background-color: var(--border-color);
} }
.community .community-inner { .community .community-inner {
padding-top: 1rem;
flex-grow: 1; flex-grow: 1;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;