mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge remote-tracking branch 'origin/3505-display-social-media-favicons-on-profile' into 3505-display-social-media-favicons-on-profile
# Conflicts: # webapp/components/SocialMedia/SocialMedia.vue # webapp/pages/profile/_id/_slug.vue
This commit is contained in:
commit
ef03319e19
@ -87,7 +87,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</base-card>
|
</base-card>
|
||||||
<ds-space />
|
<ds-space />
|
||||||
<ds-heading tag="h3" soft style="text-align: center; margin-bottom: 10px;">
|
<ds-heading tag="h3" soft style="text-align: center; margin-bottom: 10px">
|
||||||
{{ $t('profile.network.title') }}
|
{{ $t('profile.network.title') }}
|
||||||
</ds-heading>
|
</ds-heading>
|
||||||
<follow-list
|
<follow-list
|
||||||
@ -103,23 +103,7 @@
|
|||||||
type="following"
|
type="following"
|
||||||
@fetchAllConnections="fetchAllConnections"
|
@fetchAllConnections="fetchAllConnections"
|
||||||
/>
|
/>
|
||||||
<ds-space v-if="user.socialMedia && user.socialMedia.length" margin="large">
|
<social-media :user-name="userName" :user="user" />
|
||||||
<base-card style="position: relative; height: auto;">
|
|
||||||
<ds-space margin="x-small">
|
|
||||||
<ds-text tag="h5" color="soft">
|
|
||||||
{{ $t('profile.socialMedia') }} {{ userName | truncate(15) }}?
|
|
||||||
</ds-text>
|
|
||||||
<template>
|
|
||||||
<ds-space v-for="link in socialMediaLinks" :key="link.username" margin="x-small">
|
|
||||||
<a :href="link.url" target="_blank">
|
|
||||||
<img :src="link.favicon" alt="Link:" height="22" width="22" />
|
|
||||||
{{ link.username }}
|
|
||||||
</a>
|
|
||||||
</ds-space>
|
|
||||||
</template>
|
|
||||||
</ds-space>
|
|
||||||
</base-card>
|
|
||||||
</ds-space>
|
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
|
|
||||||
<ds-flex-item :width="{ base: '100%', sm: 3, md: 5, lg: 3 }">
|
<ds-flex-item :width="{ base: '100%', sm: 3, md: 5, lg: 3 }">
|
||||||
@ -243,6 +227,7 @@ import { muteUser, unmuteUser } from '~/graphql/settings/MutedUsers'
|
|||||||
import { blockUser, unblockUser } from '~/graphql/settings/BlockedUsers'
|
import { blockUser, unblockUser } from '~/graphql/settings/BlockedUsers'
|
||||||
import PostMutations from '~/graphql/PostMutations'
|
import PostMutations from '~/graphql/PostMutations'
|
||||||
import UpdateQuery from '~/components/utils/UpdateQuery'
|
import UpdateQuery from '~/components/utils/UpdateQuery'
|
||||||
|
import SocialMedia from '~/components/SocialMedia/SocialMedia'
|
||||||
|
|
||||||
const tabToFilterMapping = ({ tab, id }) => {
|
const tabToFilterMapping = ({ tab, id }) => {
|
||||||
return {
|
return {
|
||||||
@ -254,6 +239,7 @@ const tabToFilterMapping = ({ tab, id }) => {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
SocialMedia,
|
||||||
PostTeaser,
|
PostTeaser,
|
||||||
HcFollowButton,
|
HcFollowButton,
|
||||||
HcCountTo,
|
HcCountTo,
|
||||||
@ -292,17 +278,6 @@ export default {
|
|||||||
user() {
|
user() {
|
||||||
return this.User ? this.User[0] : {}
|
return this.User ? this.User[0] : {}
|
||||||
},
|
},
|
||||||
socialMediaLinks() {
|
|
||||||
const { socialMedia = [] } = this.user
|
|
||||||
return socialMedia.map((socialMedia) => {
|
|
||||||
const { url } = socialMedia
|
|
||||||
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n])?(?:www\.)?([^:/\n?]+)/g)
|
|
||||||
const [domain] = matches || []
|
|
||||||
const favicon = domain ? `${domain}/favicon.ico` : null
|
|
||||||
const username = url.split('/').pop()
|
|
||||||
return { url, username, favicon }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
userName() {
|
userName() {
|
||||||
const { name } = this.user || {}
|
const { name } = this.user || {}
|
||||||
return name || this.$t('profile.userAnonym')
|
return name || this.$t('profile.userAnonym')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user