Match Quiz management

Welcome to Fans United Match Quiz Management Widget. The widget allows staff members with sufficient permissions to create new Match Quiz games/editions. You can use this widget as it is and embed it in your platform, or you can use the Management Panel to create games. Match Quiz is a game where users must predict a specified number of fixtures for one match for a prize. With successful installation, you can create and edit a Match Quiz game or see the report about specific game.

Installation and usage

The easiest way to use Fans United Match Quiz Widget is to install it from npm as follows:

npm  install  fansunited-widget-match-quiz

or:

yarn  add  fansunited-widget-match-quiz

Here is an example how you can integrate Fans United Match Quiz Management Widget:

import  'fansunited-widget-match-quiz/style.css';
import { MatchQuizManager } from  'fansunited-widget-match-quiz';

const  App = () => {

return <MatchQuizManager fansUnitedApiKey={'your-api-key'} fansUnitedClientId={'your-client-id'}/>

}

Notes

  • The widget is bundled as a React component and its usage is as simple as the above example

  • Don't worry about your project's CSS. The widget's styling is done with Tailwind CSS and all classes are prefixed to avoid collisions with your existing CSS. This means that the widget's CSS will NOT affect yours. One important thing is that you need to import style.css file from package folder:

import 'fansunited-widget-match-quiz/style.css';

N.B: If you are using an entry point for importing all your stylings, you need to import fansunited-widget-match-quiz/style.css there as well

Props

type  MatchQuizManagerProps = {
	fansUnitedApiKey: string;
	fansUnitedClientId: string;
	fansUnitedLanguage?: string;
	labels?: LabelsModel;
};

Fans United Match Quiz Management Widget depends on Fans United JS SDK and Fans United Client API. Thats why fansUnitedApiKey and fansUnitedClientId are required. They will be provided to you from Fans United team. For other optional props here is some information:

  • fansUnitedLanguage - for our sports APIs FansUnited platform supports different languages. For now they are Bulgarian (bg), English (en) and Romanian (ro). If no value given it will be set to English (en).

  • labels - you can easily translate all labels, UI messages, descriptions, placeholders and etc. with this prop. By default, Fans United Match Quiz Management Widget is available in English so if no value is given, the widget will be translated in English.

Translation

You can easily translate Fans United Match Quiz Management Widget in your language! You just need to pass an object to labels prop with concrete keys and values and that's it! Here's an example how you can do it:

import 'fansunited-widget-match-quiz/style.css';
import { MatchQuizManager } from  'fansunited-widget-match-quiz';

const  labels = {
	userNotFound: 'User not found. Please try again.',
	clientConfigErrorMessage: "There was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.",
	featureDisabled: 'Feature disabled!',
	noPermissionMessage: 'You have no permission for this feature!',
	tryAgainButton: 'Try again',
	noGamesFound: "No games were found. You can create a game by clicking the button 'Create game'",
	createEdition: 'Create game',
	name: 'Name',
	status: 'Status',
	creationDate: 'Created at',
	acceptUntil: 'Accept Until',
	actions: 'Actions',
	upcoming: 'Upcoming',
	inProgress: 'In progress',
	finished: 'Finished',
	pending: 'Pending',
	settled: 'Settled',
	live: 'Live',
	open: 'Open',
	canceled: 'Canceled',
	closed: 'Closed',
	edit: 'Edit',
	report: 'Report',
	timeFormat: 'DD-MM-YYYY HH:mm',
	previous: 'Previous',
	next: 'Next',
	namePlaceholder: 'Please provide a name for your Match Quiz edition.',
	description: 'Description',
	descriptionPlaceholder: 'Please describe your game.',
	matchSelection: 'Match selection',
	matchSelectionDescription: 'Type a team and select one of the next matches. When you choose a match the defaults market will be displayed.',
	selectTeamPlaceholder: 'Type your team...',
	selectTeamNoTeamFound: 'No Team Found',
	selectTeamNoMatchesFound: 'No matches were found',
	atleastThreeCharsMessage: 'Team input must be at least 3 characters',
	marketSelection: 'Market Selection',
	chosenMarkets: 'Chosen markets',
	otherMarkets: 'Other markets',
	marketSelectionCreateGameDescription: 'Drag and drop what market users can predict for the specified match. The default markets are automatically dropped in chosen markets.',
	marketSelectionEditGameDescription: 'You can add, remove or change loaded markets.',
	markets: 'Markets:',
	marketFt1x2: 'Full time',
	marketHt1x2: 'Half time',
	marketBothTeamsScore: 'Both teams score',
	marketDoubleChance: 'Double chance',
	marketHtFt: 'Half time/Full time',
	marketRedCardMatch: 'Red card in match',
	marketPenaltyMatch: 'Pentalty in match',
	marketCornersMatch: 'Corners in match',
	marketCorrectScore: 'Correct score',
	marketPlayerScore: 'Player score',
	marketPlayerYellowCard: 'Yellow card for player',
	marketPlayerRedCard: 'Red card for player',
	marketPlayerScoreFirstGoal: 'Player to score first goal',
	marketPlayerScoreTwice: 'Player to score twice',
	marketPlayerScoreHattrick: 'Player to score hattrick',
	marketOverZeroGoals: 'Over zero goals',
	marketOverOneGoals: 'Over one goals',
	marketOverTwoGoals: 'Over two goals',
	marketOverThreeGoals: 'Over three goals',
	marketOverFourGoals: 'Over four goals',
	marketOverFiveGoals: 'Over five goals',
	marketOverSixGoals: 'Over six goals',
	marketOverSixCorners: 'Over six corners',
	marketOverSevenCorners: 'Over seven corners',
	marketOverEightCorners: 'Over eight corners',
	marketOverNineCorners: 'Over nine corners',
	marketOverTenCorners: 'Over ten corners',
	marketOverElevenCorners: 'Over eleven corners',
	marketOverTwelveCorners: 'Over twelve corners',
	marketOverThirteenCorners: 'Over thirteen corners',
	gameStatus: 'Game status',
	createGameStatusDescription: 'The provided choices are PENDING and OPEN. Keep in mind that if you choose OPEN you can NOT edit your game.',
	editGameStatusDescription: 'The provided choices are PENDING, OPEN and CANCELED. Keep in mind that if you choose OPEN you can NOT edit your game anymore and if you choose CANCELED the game will be canceled.',
	rules: 'Rules',
	rulesDescription: 'Describe your rules for participating in the game. You can type plain text or html tags.',
	flags: 'Flags',
	flagsPlaceholder: 'Type your flag and hit enter',
	repeatedFlagMessage: 'You have entered a repeated flag. Please enter a different one.',
	cutoffTime: 'Cutoff time',
	createCutoffTimeDescription: 'Predictions will be accepted until this time. If not provided it will be automatically generated 15 minutes from the first match played.',
	editCutoffTimeDescription: "Predictions will be accepted until this time. You need to provide a cutoff time to be able to edit the game. Keep in mind that cutoff time should be ATLEAST 15 minutes before match's kickoff time.",
	editGame: 'Edit game',
	back: 'Back',
	reportFor: 'Report for',
	position: 'Position',
	points: 'Points',
	predictions: 'Predictions',
	gameNotSettledMessage: 'Game is not settled and there is no leaderboard yet.',
	clear: 'Clear',
	loadingMessage: 'Loading...',
	createGameMessage: 'You have successfully created a game.',
	editGameMessage: 'You have successfully edited a game.',
	clearCutoffMessage: 'You have cleared your cutoff time.',
	selectMatchErrorMessage: 'You need to select a match to be able to manage a game.',
	chooseGameCutoffTimeMessage: 'You need to choose a date to edit the game.',
	minimumMarketMessage: 'You need to choose at least ONE market to be able to manage a game.',
	invalidCutoffTimeMessage: 'The provided match starts before cutoff time. Please choose cutoff time that is before the chosen match kickoff time.',
	createGameErrorMessage:  'There was a problem with creating the game. Please try again.',
	editGameErrorMessage:  'There was a problem with editing the game. Please try again.',
	leaderboardErrorMessage:  'There was a problem with displaying leaderboard. Please try again.',
	gamePredictionsErrorMessage:  'There was a problem with getting predictions for users. Please try again.',
};

const  App = () => {

return (
	<MatchQuizManager fansUnitedApiKey={'your-api-key'} fansUnitedClientId={'your-client-id'} labels={labels}
/>
);
}

Here is all information about LabelsModel:

KeyDescriptionDefault Value
userNotFoundOn login screen when client gives invalid information about email or passwordUser not found. Please try again.
clientConfigErrorMessagereact-toastify error message when client is providing invalid value to fansUnitedApiKey or fansUnitedClientId propThere was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.
featureDisabledTitle for NoPermissionModal. This Modal is displayed when client does NOT have permission to use Fans United Match Quiz WidgetFeature disabled!
noPermissionMessageDescription for NoPermissionModal. This Modal is displayed when client does NOT have permission to use Fans United Match Quiz WidgetYou have no permission for this feature!
tryAgainButtonButton for NoPermissionModal. This Modal is displayed when client does NOT have permission to use Fans United Match Quiz Widget. When clicking the button, client will be redirected to Login screenTry again
noGamesFoundWhen there are no created games for specific client, this message will appear on screen.No games were found. You can create a game by clicking the button 'Create game'.
createEditionUsed as label on create button and as a title on screen when creating a game.Create game
nameLabel for name of a game or participantName
statusDisplayed in header of list of games. Status of a gameStatus
creationDateDisplayed in header of list of games. Date of created game in same format as given for timeFormat propCreation Date
acceptUntilDisplayed in header of list of games. Date of predictions cutoff in same format as given for timeFormat propAccept until
actionsDisplayed in header of list of games. Two icon buttons with different actions.Actions
upcomingStatus of match for gameUpcoming
inProgressStatus of match for gameIn progress
finishedStatus of match for gameFinished
pendingStatus for specific game.Pending
settledStatus for specific game.Settled
liveStatus for specific game.Live
openStatus for specific game.Open
canceledStatus for specific game.Canceled
closedStatus for specific game.Closed
editTooltip for icon button edit.Edit
reportTooltip for icon button report.Report
timeFormatTimeformat for displaying dates. Widgets uses dayjs as a date dependency.DD.MM.YYYY, HH:mm
marketsMarkets title. It will appear on each game below the match name.Markets:
previousLabel for pagination button.Previous
nextLabel for pagination button.Next
namePlaceholderPlaceholder/desciption about input field for game name when creating/editing a game.Please provide a name for your Match Quiz edition.
descriptionTitle for desciption input field when creating/editing a game.Description
descriptionPlaceholderPlaceholder/desciption about input field for game description when creating/editing a game.Please describe your game.
matchSelectionTitle for match selection sectionMatch selection
matchSelectionDescriptionDescription about match selection sectionType a team and select one of the next matches. When you choose a match the defaults market will be displayed.
selectTeamPlaceholderPlaceholder for option search input fieldType your team...
selectTeamNoTeamFoundWhen you insert a name of a team that does not support your competition scope given by your features in Client APINo Team Found
atleastThreeCharsMessageDisplayed message when you start to type a name of a team.Team input must be at least 3 characters
selectTeamNoMatchesFoundWhen you choose a team from your search result, but it next 5 matches does not support your competition scope given by your features in Client APINo matches were found
marketSelectionTitle for market selection section.Market Selection
marketSelectionCreateGameDescriptionDescription about market selection when client creates a game.Drag and drop what market users can predict for the specified match. The default markets are automatically dropped in chosen markets.
marketSelectionEditGameDescriptionDescription about market selection when client edits a game.You can add, remove or change loaded markets.
chosenMarketsTitle for default (or chosen) markets column when creating (or editing) a game.Chosen markets
otherMarketsTitle for other (not chosen) markets column when creating (or editing) a game.Other markets
marketFt1x2Label for market full TimeFull time
marketHt1x2Label for market half TimeHalf time
marketBothTeamsScoreLabel for market both teams scoreBoth teams score
marketDoubleChanceLabel for market double chanceDouble chance
marketHtFtLabel for market half time/full timeHalf time/Full time
marketRedCardMatchLabel for market read card matchRed card in match
marketPenaltyMatchLabel for market penalty matchPentalty in match
marketCornersMatchLabel for market corners matchCorners in match
marketCorrectScoreLabel for market correct scoreCorrect score
marketPlayerScoreLabel for market player scorePlayer score
marketPlayerYellowCardLabel for market player yellow cardYellow card for player
marketPlayerRedCardLabel for market player red cardRed card for player
marketPlayerScoreFirstGoalLabel for market player score first goalPlayer to score first goal
marketPlayerScoreTwiceLabel for market player score twicePlayer to score twice
marketPlayerScoreHattrickLabel for market player score hattrickPlayer to score hattrick
marketOverZeroGoalsLabel for market over zero goalsOver zero goals
marketOverOneGoalsLabel for market over one goalsOver one goals
marketOverTwoGoalsLabel for market over two goalsOver two goals
marketOverThreeGoalsLabel for market over three goalsOver three goals
marketOverFourGoalsLabel for market over four goalsOver four goals
marketOverFiveGoalsLabel for market over five goalsOver five goals
marketOverSixGoalsLabel for market over six goalsOver six goals
marketOverSixCornersLabel for market over six cornersOver six corners
marketOverSevenCornersLabel for market over seven cornersOver seven corners
marketOverEightCornersLabel for market over eight cornersOver eight corners
marketOverNineCornersLabel for market over nine cornersOver nine corners
marketOverTenCornersLabel for market over ten cornersOver ten corners
marketOverElevenCornersLabel for market over eleven cornersOver eleven corners
marketOverTwelveCornersLabel for market over twelve cornersOver twelve corners
marketOverThirteenCornersLabel for market over thirteen cornersOver thirteen corners
gameStatusTitle for choosing a game status.Game status
createGameStatusDescriptionDescription about choosing a game status.This will be displayed when you CREATE a game!The provided choices are PENDING and OPEN. Keep in mind that if you choose OPEN you can NOT edit your game.
editGameStatusDescriptionDescription about choosing a game status.This will be displayed when you EDIT a game!The provided choices are PENDING, OPEN and CANCELED. Keep in mind that if you choose OPEN you can NOT edit your game anymore and if you choose CANCELED the game will be canceled.
rulesTitle for choosing game rules.Rules
rulesDescriptionDescription for choosing game rules.Describe your rules for participating in the game. You can type plain text or html tags.
flagsTitle for choosing game flags.Flags
flagsPlaceholderPlaceholder on input field for game flagsType your flag and hit enter
repeatedFlagMessagereact-toastify warning message when client submits same flag.You have entered a repeated flag. Please enter a different one.
cutoffTimeTitle for choosing a cutoff time for game.Cutoff time
createCutoffTimeDescriptionDescription about choosing a cutoff time for creating a game.Predictions will be accepted until this time. If not provided it will be automatically generated 15 minutes from the first match played.
editCutoffTimeDescriptionDescription about choosing a cutoff time for editing a game.Predictions will be accepted until this time. You need to provide a cutoff time to be able to edit the game. Keep in mind that cutoff time should be ATLEAST 15 minutes before match`s kickoff time.
editGameUsed as label on create button and as a title on screen when editing a game.Edit game
backTooltip content for back button (left arrow positioned on top-right corner). You can go back when you create/edit a game or when you visit report screen.Back
reportForLabel positioned on top left side of the screen. Part of Report screen title.Report for
positionLabel in header's report tablePosition
pointsLabel in header's report tablePoints
predictionsLabel in header's report tablePredictions
gameNotSettledMessageModel message when client clicks on report button for game that is NOT settled.Game is not settled and there is no leaderboard yet.
clearTooltip for clearing button (circled X). Button clears current choosen game cuttof time.Clear
loadingMessageWhen creating/editing a game or searching of teams displaying a react-toastify loading message.Loading...
createGameMessageWhen creating a game displaying a react-toastify successful message for created game.You have successfully created a game.
editGameMessageWhen editing a game displaying a react-toastify successful message for edited game.You have successfully edited a game.
clearCutoffMessageWhen clearing a cutoff time for a game displaying a react-toastify informational message for cleared input field about cutoff time for gameYou have cleared your cutoff time.
selectMatchErrorMessagereact-toastify warning message when client tries to create or edit a game without selecting a matchYou need to select a match to be able to manage a game.
chooseGameCutoffTimeMessagereact-toastify warning message when client tries to edit a game without choosing a prediction cutoff time.You need to choose a date to edit the game.
minimumMarketMessagereact-toastify warning message when client tries to create or edit a game without choosing any markets.You need to choose at least ONE market to be able to manage a game.
invalidCutoffTimeMessageWhen creating/editing a game displaying a react-toastify warning message about invalid cutoff time for game.The provided match starts before cutoff time. Please choose cutoff time that is before the chosen match kickoff time.
createGameErrorMessageWhen creating a game displaying a react-toastify error message.There was a problem with creating the game. Please try again.
editGameErrorMessageWhen editing a game displaying a react-toastify error message.There was a problem with editing the game. Please try again.
leaderboardErrorMessagereact-toastify error message when client goes to report screen and widget fails to load the leaderboard.There was a problem with displaying leaderboard. Please try again.
gamePredictionsErrorMessagereact-toastify error message when client goes to report screen and widget fails to load the users` predictions.There was a problem with getting predictions for users. Please try again.