Skip to content

Commit

Permalink
Hide score buttons when using shared scoreboard link.
Browse files Browse the repository at this point in the history
  • Loading branch information
krazkidd committed Sep 28, 2023
1 parent 7847c48 commit 45c9874
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/scoreboard/ScoreboardTeamTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import type { CardPassThroughOptions } from 'primevue/card';
import type { Team } from "~~/types";
const props = defineProps<{
const props = withDefaults(defineProps<{
team: Team | undefined,
score: number
}>();
score: number,
showButtons?: boolean
}>(), {
showButtons: false
});
const emit = defineEmits<{
(e: "addRun"): void;
Expand All @@ -24,7 +27,12 @@ const cardPassThroughOptions = computed(() => ({
color: props.team ? `#${props.team!.jerseyTextColor}` : '',
backgroundColor: props.team ? `#${props.team!.jerseyColor}` : '',
}
}
},
content: {
class: {
hidden: !props.showButtons
}
},
} as CardPassThroughOptions));
const buttonPassThroughOptions = {
Expand Down
2 changes: 2 additions & 0 deletions pages/scoreboard/[[id]].vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const fakeTeam = {
<ScoreboardTeamTile
:team="team"
:score="scoreboard?.teamScore ?? 0"
:show-buttons="!route.params.id"
@add-run="incrementTeamScore(1)"
@remove-run="incrementTeamScore(-1)"
class="m-1 w-64"
Expand All @@ -40,6 +41,7 @@ const fakeTeam = {
<ScoreboardTeamTile
:team="fakeTeam"
:score="scoreboard?.otherTeamScore ?? 0"
:show-buttons="!route.params.id"
@add-run="incrementOtherTeamScore(1)"
@remove-run="incrementOtherTeamScore(-1)"
class="m-1 w-64"
Expand Down

0 comments on commit 45c9874

Please sign in to comment.