-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local API: Add support for home tab on channels (#6033)
* Add support for home tab on channels * Remove some unneeded code * Add setting to hide channel home tab * Switch to Composition API * Add Play All link when possible, parse more types * fix typo for home tab aria-controls Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com> * move distraction free hide home setting * Filter home data for setting featured channels * fix publish date parsing * Add support for shelf subtitle * run lint-fix * add jsdoc for added function * implement code suggestions, fix lockupview * add support for parsing subtitle and playlistId for richshelf * exclude home tab for IV * implement code suggestions, change `Play all` to `View playlist` Co-Authored-By: PikachuEXE <1018543+PikachuEXE@users.noreply.github.com> * remove lockupview case since #6196 will handle parsing it in this function * use list icon instead of bookmark icon Co-Authored-By: PikachuEXE <1018543+PikachuEXE@users.noreply.github.com> * open all details by default * add case 'ALBUM' for lockupView parsing * change default page to home page when local api is enabled and home page isnt hidden when entering a channel url --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> Co-authored-by: PikachuEXE <1018543+PikachuEXE@users.noreply.github.com>
- Loading branch information
1 parent
c2217d1
commit 719fcc0
Showing
15 changed files
with
458 additions
and
122 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
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,35 @@ | ||
.shelfTitle { | ||
font-size: 24px; | ||
cursor: pointer; | ||
} | ||
|
||
.shelfTitle::marker { | ||
font-size: 20px; | ||
color: var(--accent-color); | ||
} | ||
|
||
.shelfUnderline { | ||
border-color: var(--primary-color); | ||
} | ||
|
||
.playAllSpan { | ||
font-size: 18px; | ||
margin-inline-start: 10px; | ||
} | ||
|
||
.playAllLink { | ||
font-style: italic; | ||
padding-block: 5px; | ||
padding-inline: 7px; | ||
border-radius: 10px; | ||
text-decoration: none; | ||
} | ||
|
||
.playAllLink:hover { | ||
background-color: var(--bg-color); | ||
} | ||
|
||
.shelfSubtitle { | ||
font-style: italic; | ||
color: var(--tertiary-text-color); | ||
} |
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,77 @@ | ||
<template> | ||
<div> | ||
<div | ||
v-for="(shelf, index) in filteredShelves" | ||
:key="index" | ||
> | ||
<details | ||
open | ||
> | ||
<summary | ||
class="shelfTitle" | ||
> | ||
{{ shelf.title }} | ||
<span | ||
v-if="shelf.playlistId" | ||
class="playAllSpan" | ||
> | ||
<router-link | ||
class="playAllLink" | ||
:to="{ | ||
path: `/playlist/${shelf.playlistId}` | ||
}" | ||
> | ||
<FontAwesomeIcon | ||
class="thumbnail" | ||
:icon="['fas', 'list']" | ||
/> | ||
{{ $t('Channel.Home.View Playlist') }} | ||
</router-link> | ||
</span> | ||
<hr class="shelfUnderline"> | ||
</summary> | ||
<p | ||
v-if="shelf.subtitle" | ||
class="shelfSubtitle" | ||
> | ||
{{ shelf.subtitle }} | ||
</p> | ||
<FtElementList | ||
:data="shelf.content" | ||
:use-channels-hidden-preference="false" | ||
:display="shelf.isCommunity ? 'list' : null" | ||
/> | ||
</details> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed } from 'vue' | ||
import FtElementList from '../FtElementList/FtElementList.vue' | ||
import store from '../../store/index' | ||
const props = defineProps({ | ||
shelves: { | ||
type: Array, | ||
default: () => [] | ||
} | ||
}) | ||
/** @type {import('vue').ComputedRef<bool>} */ | ||
const hideFeaturedChannels = computed(() => { | ||
return store.getters.getHideFeaturedChannels | ||
}) | ||
const filteredShelves = computed(() => { | ||
let shelves = props.shelves | ||
if (hideFeaturedChannels.value) { | ||
shelves = shelves.filter(shelf => shelf.content[0].type !== 'channel') | ||
} | ||
return shelves.filter(shelf => shelf.content.length > 0) | ||
}) | ||
</script> | ||
|
||
<style scoped src="./ChannelHome.css" /> |
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
Oops, something went wrong.