refactor
This commit is contained in:
		
							parent
							
								
									ac7c60d102
								
							
						
					
					
						commit
						b186c67767
					
				|  | @ -293,7 +293,7 @@ function onDragleave() { | |||
| 	draghover.value = false; | ||||
| } | ||||
| 
 | ||||
| function onDrop(ev: DragEvent) { | ||||
| function onDrop(ev: DragEvent): void | boolean { | ||||
| 	draghover.value = false; | ||||
| 
 | ||||
| 	if (!ev.dataTransfer) return; | ||||
|  |  | |||
|  | @ -39,17 +39,10 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| export type Tab = { | ||||
| 	key: string; | ||||
| 	onClick?: (ev: MouseEvent) => void; | ||||
| } & ( | ||||
| 	| { | ||||
| 		iconOnly?: false; | ||||
| 		title: string; | ||||
| 		icon?: string; | ||||
| 	} | ||||
| 	| { | ||||
| 		iconOnly: true; | ||||
| 		icon: string; | ||||
| 	} | ||||
| ); | ||||
| 	iconOnly?: boolean; | ||||
| 	title: string; | ||||
| 	icon?: string; | ||||
| }; | ||||
| </script> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
|  |  | |||
|  | @ -39,17 +39,10 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| export type Tab = { | ||||
| 	key: string; | ||||
| 	onClick?: (ev: MouseEvent) => void; | ||||
| } & ( | ||||
| 	| { | ||||
| 		iconOnly?: false; | ||||
| 		title: string; | ||||
| 		icon?: string; | ||||
| 	} | ||||
| 	| { | ||||
| 		iconOnly: true; | ||||
| 		icon: string; | ||||
| 	} | ||||
| ); | ||||
| 	iconOnly?: boolean; | ||||
| 	title: string; | ||||
| 	icon?: string; | ||||
| }; | ||||
| </script> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
|  |  | |||
|  | @ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| 		</div> | ||||
| 	</MkFoldableSection> | ||||
| 
 | ||||
| 	<MkFoldableSection v-for="category in customEmojiCategories" v-once :key="category"> | ||||
| 	<MkFoldableSection v-for="category in customEmojiCategories" v-once :key="category ?? '___root___'"> | ||||
| 		<template #header>{{ category || i18n.ts.other }}</template> | ||||
| 		<div :class="$style.emojis"> | ||||
| 			<XEmoji v-for="emoji in customEmojis.filter(e => e.category === category)" :key="emoji.name" :emoji="emoji"/> | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| <div class="_gaps_m"> | ||||
| 	<div :class="$style.banner" :style="{ backgroundImage: `url(${ instance.bannerUrl })` }"> | ||||
| 		<div style="overflow: clip;"> | ||||
| 			<img :src="instance.iconUrl ?? instance.faviconUrl ?? '/favicon.ico'" alt="" :class="$style.bannerIcon"/> | ||||
| 			<img :src="instance.iconUrl ?? '/favicon.ico'" alt="" :class="$style.bannerIcon"/> | ||||
| 			<div :class="$style.bannerName"> | ||||
| 				<b>{{ instance.name ?? host }}</b> | ||||
| 			</div> | ||||
|  |  | |||
|  | @ -172,7 +172,7 @@ const headerTabs = computed(() => [{ | |||
| 	key: 'raw', | ||||
| 	title: 'Raw data', | ||||
| 	icon: 'ti ti-code', | ||||
| }]); | ||||
| }].filter(x => x != null)); | ||||
| 
 | ||||
| definePage(() => ({ | ||||
| 	title: file.value ? `${i18n.ts.file}: ${file.value.name}` : i18n.ts.file, | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| 	<div class="body"> | ||||
| 		<div class="left"> | ||||
| 			<button v-click-anime class="item _button instance" @click="openInstanceMenu"> | ||||
| 				<img :src="instance.iconUrl ?? instance.faviconUrl ?? '/favicon.ico'" draggable="false"/> | ||||
| 				<img :src="instance.iconUrl ?? '/favicon.ico'" draggable="false"/> | ||||
| 			</button> | ||||
| 			<MkA v-click-anime v-tooltip="i18n.ts.timeline" class="item index" activeClass="active" to="/" exact> | ||||
| 				<i class="ti ti-home ti-fw"></i> | ||||
|  | @ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| 				</component> | ||||
| 			</template> | ||||
| 			<div class="divider"></div> | ||||
| 			<MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip="i18n.ts.controlPanel" class="item" activeClass="active" to="/admin" :behavior="settingsWindowed ? 'window' : null"> | ||||
| 			<MkA v-if="$i && ($i.isAdmin || $i.isModerator)" v-click-anime v-tooltip="i18n.ts.controlPanel" class="item" activeClass="active" to="/admin" :behavior="settingsWindowed ? 'window' : null"> | ||||
| 				<i class="ti ti-dashboard ti-fw"></i> | ||||
| 			</MkA> | ||||
| 			<button v-click-anime class="item _button" @click="more"> | ||||
|  | @ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| 			<MkA v-click-anime v-tooltip="i18n.ts.settings" class="item" activeClass="active" to="/settings" :behavior="settingsWindowed ? 'window' : null"> | ||||
| 				<i class="ti ti-settings ti-fw"></i> | ||||
| 			</MkA> | ||||
| 			<button v-click-anime class="item _button account" @click="openAccountMenu"> | ||||
| 			<button v-if="$i" v-click-anime class="item _button account" @click="openAccountMenu"> | ||||
| 				<MkAvatar :user="$i" class="avatar"/><MkAcct class="acct" :user="$i"/> | ||||
| 			</button> | ||||
| 			<div class="post" @click="os.post()"> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue