List Management

Welcome to Fans United List Management Widget. The widget allows staff members with sufficient permissions to create new custom or dynamic list content. Fans United List is a way to group in one place different kinds of entities like Classic Quiz, Either/Or, Poll, Top X, Match Quiz and so on. You can use this widget as it is and embed it in your platform, or you can use the Management Portal. With successful installation, you can create, edit, view list content and so on.

Installation and usage

The easiest way to use fansunited-widget-list is to install it from npm as follows:

npm  install  fansunited-widget-list

or:

yarn  add  fansunited-widget-list

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

import { ListManager } from  'fansunited-widget-list';

const  App = () => {
	return <ListManager 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 Joy UI which is based on headless unstyle react components. This means that the widget's CSS will NOT affect yours.

  • Easy translation in every language. For more information check our Translation heading.

Props

type  ListManagerProps = {
	fansUnitedApiKey: string;
	fansUnitedClientId: string;
	fansUnitedLanguage?: string;
	fansUnitedEnvironment?: string;
	labels?: LabelsModel;
	hideSignOutButton?: boolean;
};

Fans United List 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), Romanian (ro), Greek (el), Slovak (sk), Serbian (sr) and Hungarian (hu). If no value given it will be set to English (en).

  • fansUnitedEnvironment - You can run the widget in the following environments: staging, production, watg and yolo. If no value given it will be set to production (prod).

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

  • hideSignOutButton - The prop is used to hide the sign out button which is positioned on the top right corner on the main screen of the widget.

Translation

You can easily translate Fans United List 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 { ListManager } from  'fansunited-widget-list';

const labels = {
	userNotFound: 'User not found. Please try again.',
	create: 'Create',
	signOut: 'Sign out',
	back: 'Back',
	name: 'Name',
	type: 'Type',
	createdAt: 'Created at',
	updatedAt: 'Updated at',
	actions: 'Actions',
	expand: 'Expand',
	edit: 'Edit',
	delete: 'Delete',
	deleteListTitle: 'Delete List',
	deleteListDescription: 'Are you sure you want to delete',
	deleteListMessage: 'List deleted successfully!',
	deleteListErrorMessage: 'There was a problem deleting List. Please try again',
	close: 'Close',
	pageNo: 'Page No',
	getListsErrorMessage: 'There was a problem fetching lists',
	noListsFound: "No lists were found. You can create a list by clicking the button 'Create'",
	noContentAvailable: 'No content available',
	getListErrorMessage: 'There was a problem fetching list',
	manageListTitle: 'Manage List',
	manageListDescription: 'Create and customize your content list for games, classic quizzes, either ors and polls. Choose between a Custom list where you control the exact order of content, or a Dynamic list that automatically organizes content using sorting options like creation date or last update time.',
	id: 'ID',
	filters: 'Filters',
	selectContentTypePlaceholder: 'Select content type',
	status: 'Status',
	selectContentStatusPlaceholder: 'Select content status',
	sortOrder: 'Sort order',
	ascending: 'Ascending',
	descending: 'Descending',
	getEntitiesErrorMessage: 'An error occurred while fetching entities. Please try again later',
	contentSelectionTitle: 'Content selection',
	contentSelectionDescription: 'Select and organize your content. For Custom lists, you can search for a specific content by type and status and arrange them in your preferred order. For Dynamic lists, choose content by type and set the sorting options.';
	searchContentTitle: 'Search content',
	addAll: 'Add all',
	selectedContentTitle: 'Selected content',
	sortBy: 'Sort by',
	removeEntity: 'Remove entity',
	contentAddedToSelectedMessage: "added to 'Selected content'",
	allContentAddedToSelectedMessage:  "All content items are added to 'Selected content'",
	contentRemovedFromSelectedMesssage: "removed from 'Selected content'",
	save: 'Save',
	dynamicListContentEntityInfoMessage: 'Content created before 10 December 2024 and not updated afterwards will not be available.',
	createListMessage: 'You have successfully created List',
	createListErrorMessage: 'There was a problem creating List. Please try again',
	updateListMessage: 'You have successfully updated List',
	updateListErrorMessage: 'There was a problem updating List. Please try again',
	configuration: 'Configuration',
	widgetEmbedCodeTitle: 'Widget embed code',
	configureURLs: 'Configure URLs',
	classicQuizURL: 'Classic Quiz URL',
	eitherOrURL: 'Either/Or URL',
	pollURL: 'Poll URL',
	quizzesInfoMessage: "Widget supports dynamic content routing using placeholders. You can include {CONTENT_ID} in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/quizzes/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.",
	eitherOrsInfoMessage: "Widget supports dynamic content routing using placeholders. You can include {CONTENT_ID} in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/eitherors/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.",
	pollsInfoMessage: "Widget supports dynamic content routing using placeholders. You can include {CONTENT_ID} in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/polls/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.",
	copyToClipboard: 'Copy to clipboard',
	divElementTextInfo: "The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: ",
	widgetEmbedCodeNotAvailable: 'To configure embed code you need to first create your list.',
	language: 'language',
	loadMore: 'Load more',
};

const  App = () => {
return <ListManager fansUnitedApiKey={'your-api-key'} fansUnitedClientId={'your-client-id'} type="competition" labels={labels}/>
}

Here is all information about LabelsModel:

KeyDescriptionDefault Value
userNotFoundOn login screen when client gives invalid information about email or password.User not found. Please try again.
createUsed as label on create button and as a title in CreateGameScreen.Create
signOutUsed as label on sign out button.Sign out
backLabel next to the back button (left arrow).Back
nameLabel for name.Name
typeLabel for type.Type
createdAtLabel for created at.Created at
actionsLabel for actions.Actions
expandLabel for expand button tooltip.Expand
editLabel for edit action button.Edit
deleteLabel for delete action button.Delete
deleteListTitleTitle for delete list modal.Delete List
deleteListDescriptionDescription for delete list modal.Are you sure you want to delete
deleteListMessageToast successful message when deleting List.List deleted successfully!
deleteListErrorMessageToast error message when deleting List.There was a problem deleting List. Please try again
closeLabel for close button.Close
pageNoLabel before pagination buttons.Page No
getListsErrorMessageToast error message when request fails for fetching lists.There was a problem fetching lists
noListsFoundLabel when no lists has been found.No lists were found. You can create a list by clicking the button 'Create'
noContentAvailableLabel when no content for a list has been found.No content available
getListErrorMessageToast error message when request fails for fetching list.There was a problem fetching list
manageListTitleTitle on management screen.Manage List
manageListDescriptionDescription on management screen.Create and customize your content list for games, classic quizzes, either ors and polls. Choose between a Custom list where you control the exact order of content, or a Dynamic list that automatically organizes content using sorting options like creation date or last update time.
idLabel for ID read only input field.ID
filtersLabel for filters section header.Filters
selectContentTypePlaceholderPlaceholder for content type dropdown.Select content type
statusLabel for status filter.Status
selectContentStatusPlaceholderPlaceholder for content status dropdown.Select content status
sortOrderLabel for sort order filter.Sort order
ascendingLabel for sort order ascending option.Ascending
descendingLabel for sort order descending option.Descending
getEntitiesErrorMessageToast error message when request fails for fetching search entities.An error occurred while fetching entities. Please try again later
contentSelectionTitleTitle for content selection area header title.Content selection
contentSelectionDescriptionLabel for content selection area description.Select and organize your content. For Custom lists, you can search for a specific content by type and status and arrange them in your preferred order. For Dynamic lists, choose content by type and set the sorting options.
searchContentTitleTitle for search content area.Search content
addAllLabel for Add all button.Add all
selectedContentTitleLabel for selected content area.Selected content
sortByTitle for sort by dropdown.Sort by
removeEntityLabel for remove entity button tooltip.Remove entity
contentAddedToSelectedMessageToast message when a content item is added to selected items.added to 'Selected content'
contentAddedToSelectedMessageToast message when all content items are added to selected items.All content items are added to 'Selected content'
contentRemovedFromSelectedMesssageToast message when a content item is removed from selected items.removed from 'Selected content'
saveLabel for save button.Save
dynamicListContentEntityInfoMessageLabel for info alert about dynamic list content.Content created before 10 December 2024 and not updated afterwards will not be available.
createListMessageToast successful message when creating List.You have successfully created List
createListErrorMessageToast error message when creating List.There was a problem creating List. Please try again
updateListMessageToast successful message when updating List.You have successfully updated List
updateListErrorMessageToast error message when updating List.There was a problem updating List. Please try again
configurationLabel for configuration acordion in side barConfiguration
widgetEmbedCodeTitleLabel for embed code acordion in side barWidget embed code
configureURLsLabel for urls' switch button in embed code acordionConfigure URLs
classicQuizURLTitle for classic quiz url inputClassic Quiz URL
eitherOrURLTitle for either/or game url inputEither/Or URL
pollURLTitle for poll url inputPoll URL
quizzesInfoMessageInfo message for classic quiz inputWidget supports dynamic content routing using placeholders. You can include CONTENT_ID in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/quizzes/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.
eitherOrsInfoMessageInfo message for either/or inputWidget supports dynamic content routing using placeholders. You can include CONTENT_ID in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/eitherors/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.
pollsInfoMessageInfo message for poll inputWidget supports dynamic content routing using placeholders. You can include CONTENT_ID in your URL pattern to create personalized content paths. For example, if your website has a quiz page at 'https://yoursite.com/polls/{CONTENT_ID}/play', entering this pattern will automatically replace the placeholder with the appropriate ID when users interact with your widget.
copyToClipboardDiv text button tooltip text in embed code acordionCopy to clipboard
divElementTextInfoHelper text for div content in embed code acordionThe generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation:
widgetEmbedCodeNotAvailableParagraph when trying to configure widget embed code for not created ListTo configure embed code you need to first create your list.
languageLabel for language filterLanguage
loadMoreLabel for load more buttonLoad more