Skip to content

Commit

Permalink
Remove demo hastag mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Oct 27, 2023
1 parent 587d5d7 commit c0f87e4
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions src/pages/r4-page-channel-tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ export default class R4PageChannelTracks extends BaseChannel {
searchParams: {type: Object, state: true},
}

constructor() {
super()
// this.channel = null
// this.tracks = []
// this.query = {}
}

async connectedCallback() {
super.connectedCallback()
const {data, error} = await sdk.channels.readChannel(this.slug)
Expand All @@ -45,7 +38,7 @@ export default class R4PageChannelTracks extends BaseChannel {
get queryWithDefaults() {
const q = {...this.query}
if (q.filters?.length) {
q.filters = [...q.filters, this.defaultFilters]
q.filters = [...q.filters, ...this.defaultFilters]
} else {
q.filters = this.defaultFilters
}
Expand Down Expand Up @@ -199,26 +192,17 @@ export default class R4PageChannelTracks extends BaseChannel {

renderTracksMenu() {
if (!this.tracks) return null

let filter = JSON.stringify({column: 'tags', operator: 'neq', value: '{}'})
const tagsHref = `${this.tracksOrigin}?filters=[${filter}]`
filter = JSON.stringify({column: 'tags', operator: 'contains', value: 'jazz'})
const jazzTagHref = `${this.tracksOrigin}?filters=[${filter}]`
filter = JSON.stringify({column: 'mentions', operator: 'neq', value: '{}'})
const mentionsHref = `${this.tracksOrigin}?filters=[${filter}]`

return html`
<menu>
<li><a href=${this.channelOrigin}>${this.slug}</a></li>
<li><a href=${this.channelOrigin}>@${this.slug}</a></li>
<li><r4-button-play .channel=${this.channel} label=" Play all"></r4-button-play></li>
<li>
<r4-supabase-filter-search
@input=${this.onSearchFilter}
placeholder="${this.count + ' tracks'}"
.filter=${this.searchFilter}
placeholder="channel tracks"
@input=${this.onSearchFilter}
></r4-supabase-filter-search>
</li>
<li>${this.renderTracksCount()}</li>
<li>
<r4-button-play
.tracks=${this.tracks}
Expand All @@ -228,17 +212,9 @@ export default class R4PageChannelTracks extends BaseChannel {
search=${this.searchQuery}
></r4-button-play>
</li>
<li><a href=${mentionsHref} label>@Mentions</a></li>
<li><a href=${tagsHref} label>#Tags</a></li>
<li><a href=${jazzTagHref} label>#jazz</a></li>
</menu>
`
}
renderTracksCount() {
if (this.query.filters) {
return html`${this.count} tracks`
}
}

createTagUrl(tag) {
const filter = JSON.stringify({column: 'tags', operator: 'contains', value: tag})
Expand Down

0 comments on commit c0f87e4

Please sign in to comment.