Use FontAwesome as web font instead of vue component (#7469)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * Update yarn.lock * wip * wip
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="yweeujhr _root" v-size="{ max: [400] }">
|
||||
<MkButton @click="start" primary class="start"><Fa :icon="faPlus"/> {{ $ts.startMessaging }}</MkButton>
|
||||
<MkButton @click="start" primary class="start"><i class="fas fa-plus"></i> {{ $ts.startMessaging }}</MkButton>
|
||||
|
||||
<div class="history" v-if="messages.length > 0">
|
||||
<MkA v-for="(message, i) in messages"
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineAsyncComponent, defineComponent } from 'vue';
|
||||
import { faUser, faUsers, faComments, faPlus } from '@fortawesome/free-solid-svg-icons';
|
||||
import getAcct from '@/misc/acct/render';
|
||||
import MkButton from '@client/components/ui/button.vue';
|
||||
import { acct } from '../../filters/user';
|
||||
@@ -54,13 +53,12 @@ export default defineComponent({
|
||||
return {
|
||||
[symbols.PAGE_INFO]: {
|
||||
title: this.$ts.messaging,
|
||||
icon: faComments
|
||||
icon: 'fas fa-comments'
|
||||
},
|
||||
fetching: true,
|
||||
moreFetching: false,
|
||||
messages: [],
|
||||
connection: null,
|
||||
faUser, faUsers, faComments, faPlus
|
||||
};
|
||||
},
|
||||
|
||||
@@ -120,11 +118,11 @@ export default defineComponent({
|
||||
start(ev) {
|
||||
os.modalMenu([{
|
||||
text: this.$ts.messagingWithUser,
|
||||
icon: faUser,
|
||||
icon: 'fas fa-user',
|
||||
action: () => { this.startUser() }
|
||||
}, {
|
||||
text: this.$ts.messagingWithGroup,
|
||||
icon: faUsers,
|
||||
icon: 'fas fa-users',
|
||||
action: () => { this.startGroup() }
|
||||
}], ev.currentTarget || ev.target);
|
||||
},
|
||||
|
||||
@@ -13,17 +13,16 @@
|
||||
></textarea>
|
||||
<div class="file" @click="file = null" v-if="file">{{ file.name }}</div>
|
||||
<button class="send _button" @click="send" :disabled="!canSend || sending" :title="$ts.send">
|
||||
<template v-if="!sending"><Fa :icon="faPaperPlane"/></template><template v-if="sending"><Fa icon="spinner .spin"/></template>
|
||||
<template v-if="!sending"><i class="fas fa-paper-plane"></i></template><template v-if="sending"><i class="fas fa-spinner fa-pulse fa-fw"></i></template>
|
||||
</button>
|
||||
<button class="_button" @click="chooseFile"><Fa :icon="faPhotoVideo"/></button>
|
||||
<button class="_button" @click="insertEmoji"><Fa :icon="faLaughSquint"/></button>
|
||||
<button class="_button" @click="chooseFile"><i class="fas fa-photo-video"></i></button>
|
||||
<button class="_button" @click="insertEmoji"><i class="fas fa-laugh-squint"></i></button>
|
||||
<input ref="file" type="file" @change="onChangeFile"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, defineAsyncComponent } from 'vue';
|
||||
import { faPaperPlane, faPhotoVideo, faLaughSquint } from '@fortawesome/free-solid-svg-icons';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import * as autosize from 'autosize';
|
||||
import { formatTimeString } from '@/misc/format-time-string';
|
||||
@@ -51,7 +50,6 @@ export default defineComponent({
|
||||
typing: throttle(3000, () => {
|
||||
os.stream.send('typingOnMessaging', this.user ? { partner: this.user.id } : { group: this.group.id });
|
||||
}),
|
||||
faPaperPlane, faPhotoVideo, faLaughSquint
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<span class="read" v-if="isMe && message.isRead">{{ $ts.messageRead }}</span>
|
||||
</template>
|
||||
<MkTime :time="message.createdAt"/>
|
||||
<template v-if="message.is_edited"><Fa icon="pencil-alt"/></template>
|
||||
<template v-if="message.is_edited"><i class="fas fa-pencil-alt"></i></template>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
@@ -221,7 +221,7 @@ export default defineComponent({
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
> [data-icon] {
|
||||
> i {
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<div class="_content mk-messaging-room">
|
||||
<div class="body">
|
||||
<MkLoading v-if="fetching"/>
|
||||
<p class="empty" v-if="!fetching && messages.length == 0"><Fa :icon="faInfoCircle"/>{{ $ts.noMessagesYet }}</p>
|
||||
<p class="no-history" v-if="!fetching && messages.length > 0 && !existMoreMessages"><Fa :icon="faFlag"/>{{ $ts.noMoreHistory }}</p>
|
||||
<p class="empty" v-if="!fetching && messages.length == 0"><i class="fas fa-info-circle"></i>{{ $ts.noMessagesYet }}</p>
|
||||
<p class="no-history" v-if="!fetching && messages.length > 0 && !existMoreMessages"><i class="fas fa-flag"></i>{{ $ts.noMoreHistory }}</p>
|
||||
<button class="more _button" ref="loadMore" :class="{ fetching: fetchingMoreMessages }" v-show="existMoreMessages" @click="fetchMoreMessages" :disabled="fetchingMoreMessages">
|
||||
<template v-if="fetchingMoreMessages"><Fa icon="spinner" pulse fixed-width/></template>{{ fetchingMoreMessages ? $ts.loading : $ts.loadMore }}
|
||||
<template v-if="fetchingMoreMessages"><i class="fas fa-spinner fa-pulse fa-fw"></i></template>{{ fetchingMoreMessages ? $ts.loading : $ts.loadMore }}
|
||||
</button>
|
||||
<XList class="messages" :items="messages" v-slot="{ item: message }" direction="up" reversed>
|
||||
<XMessage :message="message" :is-group="group != null" :key="message.id"/>
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<transition name="fade">
|
||||
<div class="new-message" v-show="showIndicator">
|
||||
<button class="_buttonPrimary" @click="onIndicatorClick"><i><Fa :icon="faArrowCircleDown"/></i>{{ $ts.newMessageExists }}</button>
|
||||
<button class="_buttonPrimary" @click="onIndicatorClick"><i class="fas fa-arrow-circle-down"></i>{{ $ts.newMessageExists }}</button>
|
||||
</div>
|
||||
</transition>
|
||||
<XForm v-if="!fetching" :user="user" :group="group" ref="form"/>
|
||||
@@ -37,8 +37,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { faArrowCircleDown, faFlag, faUsers, faInfoCircle, faEllipsisH, faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faWindowMaximize } from '@fortawesome/free-regular-svg-icons';
|
||||
import XList from '@client/components/date-separated-list.vue';
|
||||
import XMessage from './messaging-room.message.vue';
|
||||
import XForm from './messaging-room.form.vue';
|
||||
@@ -75,14 +73,14 @@ const Component = defineComponent({
|
||||
userName: this.user,
|
||||
avatar: this.user,
|
||||
action: {
|
||||
icon: faEllipsisH,
|
||||
icon: 'fas fa-ellipsis'H,
|
||||
handler: this.menu,
|
||||
},
|
||||
} : {
|
||||
title: this.group.name,
|
||||
icon: faUsers,
|
||||
icon: 'fas fa-users',
|
||||
action: {
|
||||
icon: faEllipsisH,
|
||||
icon: 'fas fa-ellipsis'H,
|
||||
handler: this.menu,
|
||||
},
|
||||
} : null),
|
||||
@@ -103,7 +101,6 @@ const Component = defineComponent({
|
||||
&& this.existMoreMessages
|
||||
&& this.fetchMoreMessages()
|
||||
),
|
||||
faArrowCircleDown, faFlag, faInfoCircle
|
||||
};
|
||||
},
|
||||
|
||||
@@ -325,14 +322,14 @@ const Component = defineComponent({
|
||||
|
||||
os.modalMenu([this.inWindow ? undefined : {
|
||||
text: this.$ts.openInWindow,
|
||||
icon: faWindowMaximize,
|
||||
icon: 'fas fa-window-maximize',
|
||||
action: () => {
|
||||
os.pageWindow(path);
|
||||
this.$router.back();
|
||||
},
|
||||
}, this.inWindow ? undefined : {
|
||||
text: this.$ts.popout,
|
||||
icon: faExternalLinkAlt,
|
||||
icon: 'fas fa-external-link-alt',
|
||||
action: () => {
|
||||
popout(path);
|
||||
this.$router.back();
|
||||
@@ -356,7 +353,7 @@ export default Component;
|
||||
font-size: 0.8em;
|
||||
opacity: 0.5;
|
||||
|
||||
[data-icon] {
|
||||
i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
@@ -370,7 +367,7 @@ export default Component;
|
||||
color: var(--messagingRoomInfo);
|
||||
opacity: 0.5;
|
||||
|
||||
[data-icon] {
|
||||
i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
@@ -396,7 +393,7 @@ export default Component;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
> [data-icon] {
|
||||
> i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user