refactor
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name }}</span> | ||||
| 	</template> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name }}</span> | ||||
| 	</template> | ||||
| @@ -14,13 +14,13 @@ | ||||
| </template> | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import * as misskey from 'misskey-js'; | ||||
| import XColumn from './column.vue'; | ||||
| import { updateColumn, Column } from './deck-store'; | ||||
| import MkTimeline from '@/components/MkTimeline.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import * as os from '@/os'; | ||||
| import { i18n } from '@/i18n'; | ||||
| import * as misskey from 'misskey-js'; | ||||
|  | ||||
| const props = defineProps<{ | ||||
| 	column: Column; | ||||
|   | ||||
| @@ -1,16 +1,16 @@ | ||||
| <template> | ||||
| <!-- TODO: リファクタの余地がありそう --> | ||||
| <div v-if="!column">たぶん見えちゃいけないやつ</div> | ||||
| <XMainColumn v-else-if="column.type === 'main'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XWidgetsColumn v-else-if="column.type === 'widgets'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XNotificationsColumn v-else-if="column.type === 'notifications'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XTlColumn v-else-if="column.type === 'tl'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XListColumn v-else-if="column.type === 'list'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XChannelColumn v-else-if="column.type === 'channel'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XAntennaColumn v-else-if="column.type === 'antenna'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XMentionsColumn v-else-if="column.type === 'mentions'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XDirectColumn v-else-if="column.type === 'direct'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XRoleTimelineColumn v-else-if="column.type === 'roleTimeline'" :column="column" :is-stacked="isStacked" @parent-focus="emit('parent-focus', $event)"/> | ||||
| <XMainColumn v-else-if="column.type === 'main'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XWidgetsColumn v-else-if="column.type === 'widgets'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XNotificationsColumn v-else-if="column.type === 'notifications'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XTlColumn v-else-if="column.type === 'tl'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XListColumn v-else-if="column.type === 'list'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XChannelColumn v-else-if="column.type === 'channel'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XAntennaColumn v-else-if="column.type === 'antenna'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XMentionsColumn v-else-if="column.type === 'mentions'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XDirectColumn v-else-if="column.type === 'direct'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| <XRoleTimelineColumn v-else-if="column.type === 'roleTimeline'" :column="column" :isStacked="isStacked" @parentFocus="emit('parent-focus', $event)"/> | ||||
| </template> | ||||
|  | ||||
| <script lang="ts" setup> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header><i class="ti ti-mail" style="margin-right: 8px;"></i>{{ column.name }}</template> | ||||
|  | ||||
| 	<MkNotes :pagination="pagination"/> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ column.name }}</span> | ||||
| 	</template> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn v-if="deckStore.state.alwaysShowMainColumn || mainRouter.currentRoute.value.name !== 'index'" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn v-if="deckStore.state.alwaysShowMainColumn || mainRouter.currentRoute.value.name !== 'index'" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<template v-if="pageMetadata?.value"> | ||||
| 			<i :class="pageMetadata?.value.icon"></i> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header><i class="ti ti-at" style="margin-right: 8px;"></i>{{ column.name }}</template> | ||||
|  | ||||
| 	<MkNotes :pagination="pagination"/> | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| <template> | ||||
| <XColumn :column="column" :is-stacked="isStacked" :menu="menu" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :column="column" :isStacked="isStacked" :menu="menu" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header><i class="ti ti-bell" style="margin-right: 8px;"></i>{{ column.name }}</template> | ||||
|  | ||||
| 	<XNotifications :include-types="column.includingTypes"/> | ||||
| 	<XNotifications :includeTypes="column.includingTypes"/> | ||||
| </XColumn> | ||||
| </template> | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name }}</span> | ||||
| 	</template> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header> | ||||
| 		<i v-if="column.tl === 'home'" class="ti ti-home"></i> | ||||
| 		<i v-else-if="column.tl === 'local'" class="ti ti-planet"></i> | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| <template> | ||||
| <XColumn :menu="menu" :naked="true" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)"> | ||||
| <XColumn :menu="menu" :naked="true" :column="column" :isStacked="isStacked" @parentFocus="$event => emit('parent-focus', $event)"> | ||||
| 	<template #header><i class="ti ti-apps" style="margin-right: 8px;"></i>{{ column.name }}</template> | ||||
|  | ||||
| 	<div :class="$style.root"> | ||||
| 		<div v-if="!(column.widgets && column.widgets.length > 0) && !edit" :class="$style.intro">{{ i18n.ts._deck.widgetsIntroduction }}</div> | ||||
| 		<XWidgets :edit="edit" :widgets="column.widgets ?? []" @add-widget="addWidget" @remove-widget="removeWidget" @update-widget="updateWidget" @update-widgets="updateWidgets" @exit="edit = false"/> | ||||
| 		<XWidgets :edit="edit" :widgets="column.widgets ?? []" @addWidget="addWidget" @removeWidget="removeWidget" @updateWidget="updateWidget" @updateWidgets="updateWidgets" @exit="edit = false"/> | ||||
| 	</div> | ||||
| </XColumn> | ||||
| </template> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo