feat: Add link to the Twitter profile of the sender (#1597)

This commit is contained in:
Pranav Raj S 2021-01-05 10:06:40 +05:30 committed by GitHub
parent a2d6fa0f74
commit 1266f0ab8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,13 @@
</div> </div>
<spinner v-if="isPending" size="tiny" /> <spinner v-if="isPending" size="tiny" />
<div v-if="isATweet && isIncoming && sender" class="sender--info"> <a
v-if="isATweet && isIncoming && sender"
class="sender--info"
:href="twitterProfileLink"
target="_blank"
rel="noopener noreferrer nofollow"
>
<woot-thumbnail <woot-thumbnail
:src="sender.thumbnail" :src="sender.thumbnail"
:username="sender.name" :username="sender.name"
@ -51,7 +57,7 @@
<div class="sender--available-name"> <div class="sender--available-name">
{{ sender.name }} {{ sender.name }}
</div> </div>
</div> </a>
</div> </div>
</li> </li>
</template> </template>
@ -104,6 +110,11 @@ export default {
} = this; } = this;
return contentType; return contentType;
}, },
twitterProfileLink() {
const additionalAttributes = this.sender.additional_attributes || {};
const { screen_name: screenName } = additionalAttributes;
return `https://twitter.com/${screenName}`;
},
alignBubble() { alignBubble() {
return !this.data.message_type ? 'left' : 'right'; return !this.data.message_type ? 'left' : 'right';
}, },
@ -181,8 +192,9 @@ export default {
} }
.sender--info { .sender--info {
display: flex;
align-items: center; align-items: center;
color: var(--b-700);
display: inline-flex;
padding: var(--space-smaller) 0; padding: var(--space-smaller) 0;
.sender--available-name { .sender--available-name {