Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance:共同管理者の編集をいい感じにした #23

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions packages/frontend/src/pages/channel-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton @click="addUser()">
{{ i18n.ts._channel.addCollaborator }}
</MkButton>
<div v-for="user in collaboratorUsers" :class="$style.collaborator">
<MkAvatar :user="user" style="height: 48px; width: 48px"/>
<MkAcct :user="user"/>
<div v-for="( user, i ) in collaboratorUsers" :class="$style.userItem">
<div :class="$style.userItemMain">
<MkA :class="$style.userItemMainBody" :to="`${userPage(user)}`">
<MkUserCardMini :user="user"/>
</MkA>
<button class="_button" :class="$style.unassign" @click="collaboratorUserDelete(i)"><i class="ti ti-x"></i></button>
</div>
</div>
</div>
</MkFolder>
Expand Down Expand Up @@ -110,6 +114,8 @@ import MkSwitch from '@/components/MkSwitch.vue';
import MkTextarea from '@/components/MkTextarea.vue';
import { useRouter } from '@/router/supplier.js';
import { $i, iAmModerator } from '@/account.js';
import { userPage } from '@/filters/user';
import MkUserCardMini from '@/components/MkUserCardMini.vue';

const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));

Expand Down Expand Up @@ -206,6 +212,10 @@ function addUser() {
});
}

function collaboratorUserDelete (i:number) {
collaboratorUsers.value.splice( i, 1 );
}

fetchChannel();

async function addPinnedNote() {
Expand Down Expand Up @@ -319,4 +329,26 @@ definePageMetadata(() => ({
margin: 8px 0;
align-items: center;
}

.userItemMain {
display: flex;
}

.userItemMainBody {
flex: 1;
min-width: 0;
margin-right: 8px;

&:hover {
text-decoration: none;
}
}

.unassign {
width: 32px;
height: 32px;
align-self: center;
color: #ff2a2a;
}

</style>
Loading