99 icon =" ghost"
1010 ></b-icon >
1111 <a :href =" `https://kusama.subscan.io/account/${id}`" target =" _blank"
12- ><Identity :address =" id" :inline =" true"
12+ ><Identity ref = " identity " :address =" id" :inline =" true"
1313 /></a >
1414 </p >
1515 <Sharing v-if =" !sharingVisible" label =" Check this awesome Profile on %23KusamaNetwork %23KodaDot" :iframe =" iframeSettings" />
3232</template >
3333
3434<script lang="ts">
35- import { Component , Prop , Vue , Watch } from ' vue-property-decorator' ;
35+ import { Component , Vue } from ' vue-property-decorator' ;
3636import { getInstance } from ' @/components/rmrk/service/RmrkService' ;
3737import { notificationTypes , showNotification } from ' @/utils/notification' ;
3838import {
3939 defaultSortBy ,
4040 sanitizeObjectArray
4141} from ' @/components/rmrk/utils' ;
4242import {
43- Collection ,
4443 CollectionWithMeta ,
4544 NFTWithMeta ,
4645 Pack
4746} from ' @/components/rmrk/service/scheme' ;
4847import isShareMode from ' @/utils/isShareMode' ;
48+ import Identity from ' ../components/shared/format/Identity.vue' ;
4949
5050const components = {
5151 GalleryCardList : () => import (' @/components/rmrk/Gallery/GalleryCardList.vue' ),
@@ -55,7 +55,23 @@ const components = {
5555
5656const eq = (tab : string ) => (el : string ) => tab === el
5757
58- @Component ({ components })
58+ @Component <Profile >({
59+ components ,
60+ metaInfo() {
61+ return {
62+ meta: [
63+ { property: ' og:title' , content: this .name },
64+ { property: ' og:type' , content: ' website' },
65+ { property: ' og:image' , vmid: ' og:image' , content: this .firstNFT as string },
66+ { property: ' og:video' , vmid: ' og:video' , content: this .firstNFT as string },
67+ { property: ' twitter:title' , content: this .name },
68+ { property: ' twitter:image' , vmid: ' twitter:image' , content: this .firstNFT as string },
69+ { property: ' twitter:card' , content: ' summary_large_image' },
70+ ]
71+ };
72+ },
73+
74+ })
5975export default class Profile extends Vue {
6076 public activeTab: string = ' nft' ;
6177 protected id: string = ' ' ;
@@ -114,12 +130,19 @@ export default class Profile extends Vue {
114130 return { width: ' 100%' , height: ' 100vh' , customUrl: this .customUrl }
115131 }
116132
133+ get firstNFT() {
134+ return !! this .nfts [0 ] && !! this .nfts [0 ].image ? this .nfts [0 ].image : ' ' ;
135+ }
136+
137+ get name() {
138+ return ((this .$refs [' identity' ] as Identity ).name as string );
139+ }
140+
117141 public checkActiveTab() {
118142 if (this .$route .params .tab && [' nft' , ' collection' , ' pack' ].some (eq (this .$route .params .tab ))) {
119143 this .activeTab = this .$route .params .tab ;
120144 }
121145 }
122-
123146}
124147 </script >
125148
0 commit comments