draftからrequestに
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
parent
53d250dddf
commit
8fd5eb7010
30 changed files with 184 additions and 198 deletions
|
|
@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkFoldableSection v-if="searchEmojis">
|
||||
<template #header>{{ i18n.ts.searchResult }}</template>
|
||||
<div :class="$style.emojis">
|
||||
<XEmoji v-for="emoji in searchEmojis" :key="emoji.name" :emoji="emoji" :draft="emoji.draft"/>
|
||||
<XEmoji v-for="emoji in searchEmojis" :key="emoji.name" :emoji="emoji" :request="emoji.request"/>
|
||||
</div>
|
||||
</MkFoldableSection>
|
||||
|
||||
|
|
@ -36,9 +36,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
</MkFoldableSection>
|
||||
</MkSpacer>
|
||||
<MkSpacer v-if="tab === 'draft'" :contentMax="1000" :marginMin="20">
|
||||
<MkSpacer v-if="tab === 'request'" :contentMax="1000" :marginMin="20">
|
||||
<div :class="$style.emojis">
|
||||
<XEmoji v-for="emoji in draftEmojis.emojis" :key="emoji.name" :emoji="emoji" :draft="true"/>
|
||||
<XEmoji v-for="emoji in requestEmojis.emojis" :key="emoji.name" :emoji="emoji" :request="true"/>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
|
|
@ -64,7 +64,7 @@ const headerTabs = $computed(() => [{
|
|||
key: 'emojis',
|
||||
title: i18n.ts.list,
|
||||
}, {
|
||||
key: 'draft',
|
||||
key: 'request',
|
||||
title: i18n.ts.requestEmojis,
|
||||
}]);
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ definePageMetadata(ref({}));
|
|||
let q = $ref('');
|
||||
let searchEmojis = $ref<Misskey.entities.CustomEmoji[]>(null);
|
||||
let selectedTags = $ref(new Set());
|
||||
const draftEmojis = await os.apiGet('emoji-drafts');
|
||||
const requestEmojis = await os.apiGet('emoji-requests');
|
||||
function search() {
|
||||
if ((q === '' || q == null) && selectedTags.size === 0) {
|
||||
searchEmojis = null;
|
||||
|
|
@ -97,7 +97,7 @@ function search() {
|
|||
|
||||
const edit = () => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
||||
isRequest: true,
|
||||
requestNow: true,
|
||||
}, {
|
||||
done: result => {
|
||||
window.location.reload();
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div v-if="tab === 'local'" class="local">
|
||||
<MkCustomEmojiEditLocal/>
|
||||
</div>
|
||||
<div v-if="tab === 'draft'" class="draft">
|
||||
<MkCustomEmojiEditDraft/>
|
||||
<div v-if="tab === 'request'" class="request">
|
||||
<MkCustomEmojiEditRequest/>
|
||||
</div>
|
||||
<div v-else-if="tab === 'remote'" class="remote">
|
||||
<MkCustomEmojiEditRemote/>
|
||||
|
|
@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
||||
import MkCustomEmojiEditDraft from '@/components/MkCustomEmojiEditDraft.vue';
|
||||
import MkCustomEmojiEditRequest from '@/components/MkCustomEmojiEditRequest.vue';
|
||||
import MkCustomEmojiEditLocal from '@/components/MkCustomEmojiEditLocal.vue';
|
||||
import MkCustomEmojiEditRemote from '@/components/MkCustomEmojiEditRemote.vue';
|
||||
import { selectFile } from '@/scripts/select-file';
|
||||
|
|
@ -34,7 +34,7 @@ import * as os from '@/os';
|
|||
import { i18n } from '@/i18n';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
|
||||
const tab = ref('draft');
|
||||
const tab = ref('request');
|
||||
|
||||
const add = async (ev: MouseEvent) => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
||||
|
|
@ -102,7 +102,7 @@ const headerActions = $computed(() => [{
|
|||
}]);
|
||||
|
||||
const headerTabs = $computed(() => [{
|
||||
key: 'draft',
|
||||
key: 'request',
|
||||
title: i18n.ts.requestEmojis,
|
||||
}, {
|
||||
key: 'local',
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<button v-if="draft" class="_button emoji-draft" :class="$style.root" @click="menu">
|
||||
<button v-if="request" class="_button emoji-request" :class="$style.root" @click="menu">
|
||||
<img :src="emoji.url" :class="$style.img" loading="lazy"/>
|
||||
<div class="body">
|
||||
<div class="name _monospace">{{ emoji.name + ' (draft)' }}</div>
|
||||
<div class="name _monospace">{{ emoji.name + ' (request)' }}</div>
|
||||
<div class="info">{{ emoji.aliases.join(' ') }}</div>
|
||||
</div>
|
||||
</button>
|
||||
|
|
@ -32,7 +32,7 @@ const props = defineProps<{
|
|||
category: string;
|
||||
url: string;
|
||||
};
|
||||
draft?: boolean;
|
||||
request?: boolean;
|
||||
}>();
|
||||
|
||||
function menu(ev) {
|
||||
|
|
@ -50,7 +50,7 @@ function menu(ev) {
|
|||
text: i18n.ts.info,
|
||||
icon: 'ti ti-info-circle',
|
||||
action: () => {
|
||||
os.apiGet('emoji-drafts', { name: props.emoji.name }).then(res => {
|
||||
os.apiGet('emoji-requests', { name: props.emoji.name }).then(res => {
|
||||
os.alert({
|
||||
type: 'info',
|
||||
text: `License: ${res.license}`,
|
||||
|
|
@ -99,7 +99,7 @@ function menu(ev) {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.emoji-draft {
|
||||
.emoji-request {
|
||||
--c: rgb(255 196 0 / 15%);;
|
||||
background-image: linear-gradient(45deg,var(--c) 16.67%,transparent 16.67%,transparent 50%,var(--c) 50%,var(--c) 66.67%,transparent 66.67%,transparent 100%);
|
||||
background-size: 16px 16px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue