Skip to content

Commit

Permalink
Update demos
Browse files Browse the repository at this point in the history
Drarig29 committed Apr 9, 2023
1 parent 668aae1 commit ed31fc4
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions demo/with-api.html
Original file line number Diff line number Diff line change
@@ -37,22 +37,20 @@
imageUrl: 'https://github.githubassets.com/pinned-octocat.svg',
})));

window.bracketsViewer.onMatchClicked = match => console.log(match)

await window.bracketsViewer.render({
stages: data.stage,
matches: data.match,
matchGames: data.match_game,
participants: data.participant,
}, {
// This is optional.
customRoundName: (info, t) => {
// You have a reference to `t` in order to translate things.
// Returning `undefined` will fallback to the default round name in the current language.

if (info.fractionOfFinal === 1 / 2)
return `${t(`abbreviations.${info.group}`)} Semi Finals`
},
onMatchClick: match => console.log('A match was clicked', match),
selector: '#example',
participantOriginPlacement: 'before',
separatedChildCountLabel: true,
10 changes: 8 additions & 2 deletions demo/with-local-storage.html
Original file line number Diff line number Diff line change
@@ -46,14 +46,20 @@
imageUrl: 'https://github.githubassets.com/pinned-octocat.svg',
})));

window.bracketsViewer.onMatchClicked = match => console.log(match)

await window.bracketsViewer.render({
stages: data.stage,
matches: data.match,
matchGames: data.match_game,
participants: data.participant,
}, {
customRoundName: (info, t) => {
// You have a reference to `t` in order to translate things.
// Returning `undefined` will fallback to the default round name in the current language.

if (info.fractionOfFinal === 1 / 2)
return `${t(`abbreviations.${info.group}`)} Semi Finals`
},
onMatchClick: match => console.log('A match was clicked', match),
selector: '#example',
participantOriginPlacement: 'before',
separatedChildCountLabel: true,

0 comments on commit ed31fc4

Please sign in to comment.