Skip to content

Commit

Permalink
enhance(frontend): ページの表示部上部に編集リンクを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Apr 16, 2024
1 parent e9e877f commit 9058e7e
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions packages/frontend/src/pages/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:leaveActiveClass="defaultStore.state.animation ? $style.fadeLeaveActive : ''"
:enterFromClass="defaultStore.state.animation ? $style.fadeEnterFrom : ''"
:leaveToClass="defaultStore.state.animation ? $style.fadeLeaveTo : ''"
mode="out-in"
>
<div v-if="page" :key="page.id" class="_gaps">
<div :class="$style.pageMain">
Expand Down Expand Up @@ -41,8 +42,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div :class="$style.pageBannerTitle" class="_gaps_s">
<h1>{{ page.title || page.name }}</h1>
<div v-if="page.user" :class="$style.pageBannerTitleUser">
<MkAvatar :user="page.user" :class="$style.avatar" indicator link preview/> <MkA :to="`/@${username}`"><MkUserName :user="page.user" :nowrap="false"/></MkA>
<div :class="$style.pageBannerTitleSub">
<div v-if="page.user" :class="$style.pageBannerTitleUser">
<MkAvatar :user="page.user" :class="$style.avatar" indicator link preview/> <MkA :to="`/@${username}`"><MkUserName :user="page.user" :nowrap="false"/></MkA>
</div>
<div :class="$style.pageBannerTitleSubActions">
<button v-tooltip="i18n.ts.share" class="_button" :class="$style.generalActionButton" @click="share"><i class="ti ti-share ti-fw"></i></button>
<MkA v-if="page.userId === $i?.id" v-tooltip="i18n.ts._pages.editThisPage" :to="`/pages/edit/${page.id}`" class="_button" :class="$style.generalActionButton"><i class="ti ti-pencil ti-fw"></i></MkA>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -355,8 +362,15 @@ definePageMetadata(() => ({
margin: 0;
}

.pageBannerTitleSub {
display: flex;
align-items: center;
width: 100%;
}

.pageBannerTitleUser {
--height: 32px;
flex-shrink: 0;

.avatar {
height: var(--height);
Expand All @@ -365,6 +379,14 @@ definePageMetadata(() => ({

line-height: var(--height);
}

.pageBannerTitleSubActions {
flex-shrink: 0;
display: flex;
align-items: center;
gap: var(--marginHalf);
margin-left: auto;
}
}
}

Expand Down

0 comments on commit 9058e7e

Please sign in to comment.