-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi standings overlay and add option to go full-width on the ge…
…neric overlay
- Loading branch information
Showing
9 changed files
with
108 additions
and
16 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
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
72 changes: 72 additions & 0 deletions
72
website/src/components/broadcast/roots/MultiStandingsOverlay.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,72 @@ | ||
<template> | ||
<GenericOverlay class="multi-standings-overlay" :title="title || 'Standings'" :full="full"> | ||
<div class="all-standings-holder"> | ||
<div class="standings-holder" v-for="standings in standingsGroups" :key="standings.title"> | ||
<Standings :event="event" :stage="standings.group" :use-codes="useCodes" :override-show-columns="showColumns" | ||
:tie-text="standings && standings.tieText" :title="standings.short || standings.title"></Standings> | ||
|
||
<!-- event: Object,--> | ||
<!-- stage: String,--> | ||
<!-- title: String,--> | ||
<!-- tieText: String,--> | ||
<!-- showMapDiff: Boolean--> | ||
</div> | ||
</div> | ||
</GenericOverlay> | ||
</template> | ||
|
||
<script> | ||
import { ReactiveArray, ReactiveRoot, ReactiveThing } from "@/utils/reactive"; | ||
import GenericOverlay from "@/components/broadcast/roots/GenericOverlay"; | ||
import Standings from "@/components/broadcast/Standings"; | ||
export default { | ||
name: "MultiStandingsOverlay", | ||
components: { GenericOverlay, Standings }, | ||
props: ["broadcast", "title", "stageCodes", "showColumns", "useCodes", "full"], | ||
computed: { | ||
event() { | ||
if (!this.broadcast || !this.broadcast.event) return null; | ||
return ReactiveRoot(this.broadcast.event.id, { | ||
theme: ReactiveThing("theme"), | ||
teams: ReactiveArray("teams", { | ||
theme: ReactiveThing("theme") | ||
}) | ||
}); | ||
}, | ||
blocks() { | ||
if (!this.event || !this.event.blocks) return null; | ||
try { | ||
const blocks = JSON.parse(this.event.blocks); | ||
return blocks || null; | ||
} catch (e) { | ||
return null; | ||
} | ||
}, | ||
standingsGroups() { | ||
if (!this.stageCodes?.length) return this.blocks?.standings; | ||
return (this.blocks?.standings || []).filter(standings => this.stageCodes.some(code => standings.group === code || standings.key === code)); | ||
} | ||
}, | ||
metaInfo() { | ||
return { | ||
title: `Multi Standings ${this.stageCodes} | ${this.broadcast?.code || this.broadcast?.name || ""}` | ||
}; | ||
} | ||
}; | ||
</script> | ||
<style scoped> | ||
.standings >>> .team-name { | ||
color: inherit !important; | ||
} | ||
.all-standings-holder { | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: flex-start; | ||
width: 100%; | ||
} | ||
.standings >>> .standings-header .team-name { | ||
margin-right: 1.5em; | ||
} | ||
</style> |
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