-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search: Add hashtags to results (#3780)
* Add hashtags to search results * add global count , implement changes from code review Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com> * use h3 for title of hashtag element * implement suggestions from code review * use hashtag.text, move url update logic * encodeURI for hashtag url --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
- Loading branch information
1 parent
6f2a535
commit c7025b6
Showing
10 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/renderer/components/ft-list-hashtag/ft-list-hashtag.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { defineComponent } from 'vue' | ||
import { formatNumber } from '../../helpers/utils' | ||
|
||
export default defineComponent({ | ||
name: 'FtListHashtag', | ||
props: { | ||
data: { | ||
type: Object, | ||
required: true | ||
}, | ||
appearance: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
data: function () { | ||
return { | ||
title: '', | ||
url: '', | ||
channelCount: 0, | ||
parsedChannelCount: '', | ||
videoCount: 0, | ||
parsedVideosCount: '' | ||
} | ||
}, | ||
computed: { | ||
listType: function () { | ||
return this.$store.getters.getListType | ||
} | ||
}, | ||
created: function () { | ||
this.parseData() | ||
}, | ||
methods: { | ||
parseData: function () { | ||
this.title = this.data.title | ||
this.channelCount = this.data.channelCount | ||
this.parsedChannelCount = formatNumber(this.channelCount) | ||
this.videoCount = this.data.videoCount | ||
this.parsedVideosCount = formatNumber(this.videoCount) | ||
this.url = `/hashtag/${encodeURIComponent(this.data.title.substring(1))}` | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@use '../../scss-partials/_ft-list-item'; | ||
|
||
.hashtagImage { | ||
color: var(--primary-text-color); | ||
font-size: 150px; | ||
} |
51 changes: 51 additions & 0 deletions
51
src/renderer/components/ft-list-hashtag/ft-list-hashtag.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<div | ||
class="ft-list-hashtag ft-list-item" | ||
:class="{ | ||
list: listType === 'list', | ||
grid: listType === 'grid', | ||
[appearance]: true | ||
}" | ||
> | ||
<div class="channelThumbnail"> | ||
<router-link | ||
tabindex="-1" | ||
aria-hidden="true" | ||
:to="url" | ||
> | ||
<font-awesome-icon | ||
class="hashtagImage" | ||
:icon="['fas', 'hashtag']" | ||
/> | ||
</router-link> | ||
</div> | ||
<div class="info"> | ||
<router-link | ||
class="title" | ||
:to="url" | ||
> | ||
<h3 class="h3Title"> | ||
{{ title }} | ||
</h3> | ||
</router-link> | ||
<div class="infoLine"> | ||
<span | ||
v-if="channelCount" | ||
class="channelCount" | ||
> | ||
{{ $tc('Global.Counts.Channel Count', channelCount, {count: parsedChannelCount}) }} | ||
</span> | ||
<span | ||
v-if="videoCount" | ||
class="videoCount" | ||
> | ||
<template v-if="channelCount"> • </template> | ||
{{ $tc('Global.Counts.Video Count', videoCount, {count: parsedVideosCount}) }} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script src="./ft-list-hashtag.js" /> | ||
<style scoped lang="scss" src="./ft-list-hashtag.scss" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters