fansunited-frontend-components 0.0.23-RC1 → 0.0.23-RC2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +379 -79
- package/components.js +22437 -21887
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -289,26 +289,26 @@ const signInCTA: SignInCTADetails = {
|
|
|
289
289
|
onClick: () => {
|
|
290
290
|
// Handle sign-in logic
|
|
291
291
|
console.log("Sign in clicked");
|
|
292
|
-
}
|
|
292
|
+
},
|
|
293
293
|
};
|
|
294
294
|
|
|
295
295
|
// Sign-in with URL navigation
|
|
296
296
|
const signInCTA: SignInCTADetails = {
|
|
297
297
|
defaultLabel: "Login",
|
|
298
298
|
url: "https://your-auth-provider.com/login",
|
|
299
|
-
target: "_blank" // or "_self"
|
|
299
|
+
target: "_blank", // or "_self"
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
// Custom sign-in component
|
|
303
303
|
const signInCTA: SignInCTADetails = {
|
|
304
|
-
component: <CustomSignInButton
|
|
304
|
+
component: <CustomSignInButton />,
|
|
305
305
|
};
|
|
306
306
|
|
|
307
307
|
<ClassicQuizPlay
|
|
308
308
|
{...otherProps}
|
|
309
309
|
userIsLoggedIn={false}
|
|
310
310
|
signInCTA={signInCTA}
|
|
311
|
-
|
|
311
|
+
/>;
|
|
312
312
|
```
|
|
313
313
|
|
|
314
314
|
**Sign-in Priority Order:**
|
|
@@ -390,6 +390,7 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
390
390
|
Interactive poll voting component with real-time results, multiple choice support, and customizable templates. Perfect for engaging audiences with opinion polls, surveys, and voting campaigns.
|
|
391
391
|
|
|
392
392
|
**Key Features:**
|
|
393
|
+
|
|
393
394
|
- Single and multiple choice voting
|
|
394
395
|
- Real-time vote results and percentages
|
|
395
396
|
- Three responsive templates (Standard, Split, Overlay)
|
|
@@ -453,7 +454,7 @@ import { SignInCTADetails } from "fansunited-frontend-core";
|
|
|
453
454
|
|
|
454
455
|
// Custom sign-in component
|
|
455
456
|
const signInCTA: SignInCTADetails = {
|
|
456
|
-
component: <CustomSignInButton
|
|
457
|
+
component: <CustomSignInButton />,
|
|
457
458
|
};
|
|
458
459
|
|
|
459
460
|
// Basic sign-in with onClick handler
|
|
@@ -462,21 +463,17 @@ const signInCTA: SignInCTADetails = {
|
|
|
462
463
|
onClick: () => {
|
|
463
464
|
// Handle sign-in logic
|
|
464
465
|
console.log("Sign in clicked");
|
|
465
|
-
}
|
|
466
|
+
},
|
|
466
467
|
};
|
|
467
468
|
|
|
468
469
|
// Sign-in with URL navigation
|
|
469
470
|
const signInCTA: SignInCTADetails = {
|
|
470
471
|
defaultLabel: "Login to participate",
|
|
471
472
|
url: "https://your-auth-provider.com/login",
|
|
472
|
-
target: "_blank"
|
|
473
|
+
target: "_blank",
|
|
473
474
|
};
|
|
474
475
|
|
|
475
|
-
<PollVote
|
|
476
|
-
{...otherProps}
|
|
477
|
-
userIsLoggedIn={false}
|
|
478
|
-
signInCTA={signInCTA}
|
|
479
|
-
/>
|
|
476
|
+
<PollVote {...otherProps} userIsLoggedIn={false} signInCTA={signInCTA} />;
|
|
480
477
|
```
|
|
481
478
|
|
|
482
479
|
**Sign-in Priority Order:**
|
|
@@ -555,6 +552,7 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
555
552
|
Lead collection component for capturing user information with customizable forms, branding, and success actions. Perfect for newsletter signups, contact forms, and user registration flows.
|
|
556
553
|
|
|
557
554
|
**Key Features:**
|
|
555
|
+
|
|
558
556
|
- Customizable form fields (name, email, phone, country, gender, custom fields)
|
|
559
557
|
- Consent management and privacy policy integration
|
|
560
558
|
- Custom branding and theming support
|
|
@@ -565,30 +563,30 @@ Lead collection component for capturing user information with customizable forms
|
|
|
565
563
|
|
|
566
564
|
#### Required Props
|
|
567
565
|
|
|
568
|
-
| Prop | Type | Description
|
|
569
|
-
| ---------- | -------------------- |
|
|
566
|
+
| Prop | Type | Description |
|
|
567
|
+
| ---------- | -------------------- | ------------------------------- |
|
|
570
568
|
| `entityId` | `string` | Lead collection form identifier |
|
|
571
|
-
| `sdk` | `FansUnitedSDKModel` | SDK instance
|
|
572
|
-
| `template` | `WidgetTemplate` | Layout template
|
|
573
|
-
| `language` | `LanguageType` | Display language
|
|
569
|
+
| `sdk` | `FansUnitedSDKModel` | SDK instance |
|
|
570
|
+
| `template` | `WidgetTemplate` | Layout template |
|
|
571
|
+
| `language` | `LanguageType` | Display language |
|
|
574
572
|
|
|
575
573
|
#### Optional Props
|
|
576
574
|
|
|
577
|
-
| Prop | Type
|
|
578
|
-
| ---------------------------- |
|
|
579
|
-
| `themeOptions` | `CustomThemeOptions`
|
|
580
|
-
| `fields` | `LeadField[]`
|
|
581
|
-
| `labels` | `LeadLabels`
|
|
582
|
-
| `imagePosition` | `"left" \| "right"`
|
|
583
|
-
| `defaultImagePlaceholderUrl` | `string`
|
|
584
|
-
| `phoneCountryCode` | `string`
|
|
585
|
-
| `onSuccessCTA` | `OnSuccessCTADetails`
|
|
586
|
-
| `customFields` | `LeadCustomField[]`
|
|
587
|
-
| `consents` | `LeadConsent[]`
|
|
588
|
-
| `content` | `ContentInfo`
|
|
589
|
-
| `campaign` | `CampaignInfo`
|
|
590
|
-
| `branding` | `BrandingInfo`
|
|
591
|
-
| `images` | `ImagesModel`
|
|
575
|
+
| Prop | Type | Description |
|
|
576
|
+
| ---------------------------- | --------------------- | ----------------------------------------- |
|
|
577
|
+
| `themeOptions` | `CustomThemeOptions` | Theme configuration |
|
|
578
|
+
| `fields` | `LeadField[]` | Form fields to display |
|
|
579
|
+
| `labels` | `LeadLabels` | Custom labels for form elements |
|
|
580
|
+
| `imagePosition` | `"left" \| "right"` | Image position (STANDARD template only) |
|
|
581
|
+
| `defaultImagePlaceholderUrl` | `string` | URL for default image placeholder |
|
|
582
|
+
| `phoneCountryCode` | `string` | Default country code for phone fields |
|
|
583
|
+
| `onSuccessCTA` | `OnSuccessCTADetails` | Success page call to action configuration |
|
|
584
|
+
| `customFields` | `LeadCustomField[]` | Additional custom form fields |
|
|
585
|
+
| `consents` | `LeadConsent[]` | Consent checkboxes for privacy compliance |
|
|
586
|
+
| `content` | `ContentInfo` | Content metadata |
|
|
587
|
+
| `campaign` | `CampaignInfo` | Campaign information |
|
|
588
|
+
| `branding` | `BrandingInfo` | Branding configuration |
|
|
589
|
+
| `images` | `ImagesModel` | Image assets |
|
|
592
590
|
|
|
593
591
|
#### Templates
|
|
594
592
|
|
|
@@ -621,7 +619,11 @@ const overlayProps: CollectLeadProps = {
|
|
|
621
619
|
Configure which fields to display and their behavior:
|
|
622
620
|
|
|
623
621
|
```tsx
|
|
624
|
-
import {
|
|
622
|
+
import {
|
|
623
|
+
LeadField,
|
|
624
|
+
LeadCustomField,
|
|
625
|
+
LeadConsent,
|
|
626
|
+
} from "fansunited-frontend-core";
|
|
625
627
|
|
|
626
628
|
// Standard form fields
|
|
627
629
|
const fields: LeadField[] = [
|
|
@@ -629,7 +631,7 @@ const fields: LeadField[] = [
|
|
|
629
631
|
"email",
|
|
630
632
|
"phoneNumber",
|
|
631
633
|
"country",
|
|
632
|
-
"gender"
|
|
634
|
+
"gender",
|
|
633
635
|
];
|
|
634
636
|
|
|
635
637
|
// Custom fields for additional data collection
|
|
@@ -639,27 +641,27 @@ const customFields: LeadCustomField[] = [
|
|
|
639
641
|
label: "Company Name",
|
|
640
642
|
type: "input",
|
|
641
643
|
required: true,
|
|
642
|
-
placeholder: "Enter your company name"
|
|
644
|
+
placeholder: "Enter your company name",
|
|
643
645
|
},
|
|
644
646
|
{
|
|
645
647
|
key: "message",
|
|
646
648
|
label: "Message",
|
|
647
649
|
type: "textarea",
|
|
648
650
|
required: false,
|
|
649
|
-
placeholder: "Tell us about your needs..."
|
|
650
|
-
}
|
|
651
|
+
placeholder: "Tell us about your needs...",
|
|
652
|
+
},
|
|
651
653
|
];
|
|
652
654
|
|
|
653
655
|
// Consent checkboxes for privacy compliance
|
|
654
656
|
const consents: LeadConsent[] = [
|
|
655
657
|
{
|
|
656
658
|
id: "marketing",
|
|
657
|
-
label: "I agree to receive marketing communications"
|
|
659
|
+
label: "I agree to receive marketing communications",
|
|
658
660
|
},
|
|
659
661
|
{
|
|
660
662
|
id: "newsletter",
|
|
661
|
-
label: "Subscribe to our newsletter"
|
|
662
|
-
}
|
|
663
|
+
label: "Subscribe to our newsletter",
|
|
664
|
+
},
|
|
663
665
|
];
|
|
664
666
|
|
|
665
667
|
<CollectLead
|
|
@@ -667,7 +669,7 @@ const consents: LeadConsent[] = [
|
|
|
667
669
|
fields={fields}
|
|
668
670
|
customFields={customFields}
|
|
669
671
|
consents={consents}
|
|
670
|
-
|
|
672
|
+
/>;
|
|
671
673
|
```
|
|
672
674
|
|
|
673
675
|
#### Custom Labels
|
|
@@ -693,13 +695,14 @@ const labels: LeadLabels = {
|
|
|
693
695
|
formPhoneNumberPlaceholder: "Enter your phone number",
|
|
694
696
|
submitButtonLabel: "Subscribe Now",
|
|
695
697
|
successTitle: "Welcome Aboard!",
|
|
696
|
-
successDescription:
|
|
698
|
+
successDescription:
|
|
699
|
+
"Thank you for joining our community. Check your email for next steps.",
|
|
697
700
|
privacyPolicyUrlLabel: "Privacy Policy",
|
|
698
701
|
termsAndConditionsUrlLabel: "Terms & Conditions",
|
|
699
|
-
presentedByLabel: "Powered by"
|
|
702
|
+
presentedByLabel: "Powered by",
|
|
700
703
|
};
|
|
701
704
|
|
|
702
|
-
<CollectLead {...otherProps} labels={labels}
|
|
705
|
+
<CollectLead {...otherProps} labels={labels} />;
|
|
703
706
|
```
|
|
704
707
|
|
|
705
708
|
#### Success Actions
|
|
@@ -715,22 +718,22 @@ const onSuccessCTA: OnSuccessCTADetails = {
|
|
|
715
718
|
onClick: () => {
|
|
716
719
|
// Handle post-submission logic
|
|
717
720
|
window.location.href = "/dashboard";
|
|
718
|
-
}
|
|
721
|
+
},
|
|
719
722
|
};
|
|
720
723
|
|
|
721
724
|
// Success action with URL navigation
|
|
722
725
|
const onSuccessCTA: OnSuccessCTADetails = {
|
|
723
726
|
defaultLabel: "Visit Our Website",
|
|
724
727
|
url: "https://your-website.com",
|
|
725
|
-
target: "_blank"
|
|
728
|
+
target: "_blank",
|
|
726
729
|
};
|
|
727
730
|
|
|
728
731
|
// Custom success component
|
|
729
732
|
const onSuccessCTA: OnSuccessCTADetails = {
|
|
730
|
-
component: <CustomSuccessButton
|
|
733
|
+
component: <CustomSuccessButton />,
|
|
731
734
|
};
|
|
732
735
|
|
|
733
|
-
<CollectLead {...otherProps} onSuccessCTA={onSuccessCTA}
|
|
736
|
+
<CollectLead {...otherProps} onSuccessCTA={onSuccessCTA} />;
|
|
734
737
|
```
|
|
735
738
|
|
|
736
739
|
#### Examples
|
|
@@ -747,7 +750,7 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
747
750
|
template={WidgetTemplate.STANDARD}
|
|
748
751
|
language="en"
|
|
749
752
|
fields={["fullName", "email"]}
|
|
750
|
-
|
|
753
|
+
/>;
|
|
751
754
|
```
|
|
752
755
|
|
|
753
756
|
##### Advanced Lead Form
|
|
@@ -765,28 +768,28 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
765
768
|
key: "company",
|
|
766
769
|
label: "Company",
|
|
767
770
|
type: "input",
|
|
768
|
-
required: true
|
|
769
|
-
}
|
|
771
|
+
required: true,
|
|
772
|
+
},
|
|
770
773
|
]}
|
|
771
774
|
consents={[
|
|
772
775
|
{
|
|
773
776
|
id: "marketing",
|
|
774
|
-
label: "I agree to receive marketing emails"
|
|
775
|
-
}
|
|
777
|
+
label: "I agree to receive marketing emails",
|
|
778
|
+
},
|
|
776
779
|
]}
|
|
777
780
|
labels={{
|
|
778
781
|
title: "Get Early Access",
|
|
779
782
|
submitButtonLabel: "Join Waitlist",
|
|
780
783
|
successTitle: "You're In!",
|
|
781
|
-
successDescription: "We'll notify you when we launch."
|
|
784
|
+
successDescription: "We'll notify you when we launch.",
|
|
782
785
|
}}
|
|
783
786
|
onSuccessCTA={{
|
|
784
787
|
defaultLabel: "Learn More",
|
|
785
788
|
url: "https://example.com/learn-more",
|
|
786
|
-
target: "_blank"
|
|
789
|
+
target: "_blank",
|
|
787
790
|
}}
|
|
788
791
|
themeOptions={{
|
|
789
|
-
mode: "dark"
|
|
792
|
+
mode: "dark",
|
|
790
793
|
}}
|
|
791
794
|
/>
|
|
792
795
|
```
|
|
@@ -796,6 +799,7 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
796
799
|
Interactive personality quiz component that matches users with personas based on their answers. Features comprehensive result displays with persona matching, detailed explanations, and customizable templates.
|
|
797
800
|
|
|
798
801
|
**Key Features:**
|
|
802
|
+
|
|
799
803
|
- Personality matching algorithm with percentage scores
|
|
800
804
|
- Multiple persona results with detailed descriptions
|
|
801
805
|
- Tabbed result interface with top match highlighting
|
|
@@ -808,12 +812,12 @@ Interactive personality quiz component that matches users with personas based on
|
|
|
808
812
|
|
|
809
813
|
#### Required Props
|
|
810
814
|
|
|
811
|
-
| Prop | Type | Description
|
|
812
|
-
| ---------- | -------------------- |
|
|
813
|
-
| `entityId` | `string` | Personality Quiz identifier
|
|
814
|
-
| `sdk` | `FansUnitedSDKModel` | SDK instance
|
|
815
|
-
| `template` | `WidgetTemplate` | Layout template
|
|
816
|
-
| `language` | `LanguageType` | Display language
|
|
815
|
+
| Prop | Type | Description |
|
|
816
|
+
| ---------- | -------------------- | --------------------------- |
|
|
817
|
+
| `entityId` | `string` | Personality Quiz identifier |
|
|
818
|
+
| `sdk` | `FansUnitedSDKModel` | SDK instance |
|
|
819
|
+
| `template` | `WidgetTemplate` | Layout template |
|
|
820
|
+
| `language` | `LanguageType` | Display language |
|
|
817
821
|
|
|
818
822
|
#### Optional Props
|
|
819
823
|
|
|
@@ -831,7 +835,10 @@ Interactive personality quiz component that matches users with personas based on
|
|
|
831
835
|
#### Templates
|
|
832
836
|
|
|
833
837
|
```tsx
|
|
834
|
-
import {
|
|
838
|
+
import {
|
|
839
|
+
WidgetTemplate,
|
|
840
|
+
PersonalityQuizPlayProps,
|
|
841
|
+
} from "fansunited-frontend-core";
|
|
835
842
|
|
|
836
843
|
// Standard template with optional image positioning
|
|
837
844
|
const standardProps: PersonalityQuizPlayProps = {
|
|
@@ -889,7 +896,7 @@ import { SignInCTADetails } from "fansunited-frontend-core";
|
|
|
889
896
|
|
|
890
897
|
// Custom sign-in component
|
|
891
898
|
const signInCTA: SignInCTADetails = {
|
|
892
|
-
component: <CustomSignInButton
|
|
899
|
+
component: <CustomSignInButton />,
|
|
893
900
|
};
|
|
894
901
|
|
|
895
902
|
// Basic sign-in with onClick handler
|
|
@@ -898,21 +905,21 @@ const signInCTA: SignInCTADetails = {
|
|
|
898
905
|
onClick: () => {
|
|
899
906
|
// Handle sign-in logic
|
|
900
907
|
console.log("Sign in clicked");
|
|
901
|
-
}
|
|
908
|
+
},
|
|
902
909
|
};
|
|
903
910
|
|
|
904
911
|
// Sign-in with URL navigation
|
|
905
912
|
const signInCTA: SignInCTADetails = {
|
|
906
913
|
defaultLabel: "Login to discover your personality",
|
|
907
914
|
url: "https://your-auth-provider.com/login",
|
|
908
|
-
target: "_blank"
|
|
915
|
+
target: "_blank",
|
|
909
916
|
};
|
|
910
917
|
|
|
911
918
|
<PersonalityQuizPlay
|
|
912
919
|
{...otherProps}
|
|
913
920
|
userIsLoggedIn={false}
|
|
914
921
|
signInCTA={signInCTA}
|
|
915
|
-
|
|
922
|
+
/>;
|
|
916
923
|
```
|
|
917
924
|
|
|
918
925
|
**Sign-in Priority Order:**
|
|
@@ -941,7 +948,7 @@ const leads: LeadsOptions = {
|
|
|
941
948
|
phoneCountryCode: "1", // Default country code for phone fields
|
|
942
949
|
};
|
|
943
950
|
|
|
944
|
-
<PersonalityQuizPlay {...otherProps} leads={leads}
|
|
951
|
+
<PersonalityQuizPlay {...otherProps} leads={leads} />;
|
|
945
952
|
```
|
|
946
953
|
|
|
947
954
|
#### Answer Explanations
|
|
@@ -949,13 +956,11 @@ const leads: LeadsOptions = {
|
|
|
949
956
|
Enable detailed explanations for quiz answers and persona matching:
|
|
950
957
|
|
|
951
958
|
```tsx
|
|
952
|
-
<PersonalityQuizPlay
|
|
953
|
-
{...otherProps}
|
|
954
|
-
showAnswerExplanations={true}
|
|
955
|
-
/>
|
|
959
|
+
<PersonalityQuizPlay {...otherProps} showAnswerExplanations={true} />
|
|
956
960
|
```
|
|
957
961
|
|
|
958
962
|
When enabled, users will see:
|
|
963
|
+
|
|
959
964
|
- Explanations for each answer choice
|
|
960
965
|
- Detailed persona descriptions
|
|
961
966
|
- Matching algorithm insights
|
|
@@ -974,7 +979,7 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
974
979
|
sdk={sdkInstance}
|
|
975
980
|
template={WidgetTemplate.STANDARD}
|
|
976
981
|
language="en"
|
|
977
|
-
|
|
982
|
+
/>;
|
|
978
983
|
```
|
|
979
984
|
|
|
980
985
|
##### Advanced Personality Quiz
|
|
@@ -1004,9 +1009,9 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
1004
1009
|
colorSchemes: {
|
|
1005
1010
|
dark: {
|
|
1006
1011
|
textPrimary: "#ffffff",
|
|
1007
|
-
surface: "#1a1a1a"
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1012
|
+
surface: "#1a1a1a",
|
|
1013
|
+
},
|
|
1014
|
+
},
|
|
1010
1015
|
}}
|
|
1011
1016
|
/>
|
|
1012
1017
|
```
|
|
@@ -1027,9 +1032,303 @@ import { WidgetTemplate } from "fansunited-frontend-core";
|
|
|
1027
1032
|
customFontFamily: {
|
|
1028
1033
|
light: {
|
|
1029
1034
|
primary: "Inter, sans-serif",
|
|
1030
|
-
secondary: "Roboto, sans-serif"
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1035
|
+
secondary: "Roboto, sans-serif",
|
|
1036
|
+
},
|
|
1037
|
+
},
|
|
1038
|
+
}}
|
|
1039
|
+
/>
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
### MatchQuizPlay
|
|
1043
|
+
|
|
1044
|
+
Interactive match prediction quiz component that allows users to make predictions on various football match markets. Features multiple fixture types, real-time countdown timers, points system, and comprehensive result tracking with leaderboards.
|
|
1045
|
+
|
|
1046
|
+
**Key Features:**
|
|
1047
|
+
|
|
1048
|
+
- Multiple prediction markets (1X2, Correct Score, Player Markets, Over/Under Goals, Corners, etc.)
|
|
1049
|
+
- Real-time countdown timer for prediction cutoff
|
|
1050
|
+
- Points system with loyalty integration
|
|
1051
|
+
- Leaderboard and ranking system
|
|
1052
|
+
- Prediction summary and editing capabilities
|
|
1053
|
+
- Three responsive templates (Standard, Split, Overlay)
|
|
1054
|
+
- Lead collection integration
|
|
1055
|
+
- Authentication support
|
|
1056
|
+
- Custom theming and branding
|
|
1057
|
+
- Detailed prediction results and explanations
|
|
1058
|
+
|
|
1059
|
+
#### Required Props
|
|
1060
|
+
|
|
1061
|
+
| Prop | Type | Description |
|
|
1062
|
+
| ---------- | -------------------- | --------------------- |
|
|
1063
|
+
| `entityId` | `string` | Match Quiz identifier |
|
|
1064
|
+
| `sdk` | `FansUnitedSDKModel` | SDK instance |
|
|
1065
|
+
| `template` | `WidgetTemplate` | Layout template |
|
|
1066
|
+
| `language` | `LanguageType` | Display language |
|
|
1067
|
+
|
|
1068
|
+
#### Optional Props
|
|
1069
|
+
|
|
1070
|
+
| Prop | Type | Description |
|
|
1071
|
+
| ---------------------------- | -------------------- | ------------------------------------------------- |
|
|
1072
|
+
| `themeOptions` | `CustomThemeOptions` | Theme configuration |
|
|
1073
|
+
| `leads` | `LeadsOptions` | Lead collection settings |
|
|
1074
|
+
| `imagePosition` | `"left" \| "right"` | Image position (STANDARD template only) |
|
|
1075
|
+
| `defaultImagePlaceholderUrl` | `string` | URL for default image placeholder |
|
|
1076
|
+
| `userIsLoggedIn` | `boolean` | Determine if the user is logged in |
|
|
1077
|
+
| `signInCTA` | `SignInCTADetails` | Sign in call to action button configuration |
|
|
1078
|
+
| `showCountdown` | `boolean` | Show countdown timer when Match Quiz is open |
|
|
1079
|
+
| `showTeamLabels` | `boolean` | Show team name labels in fixture components |
|
|
1080
|
+
| `showPoints` | `boolean` | Show points display for each fixture |
|
|
1081
|
+
| `showPredictionDetails` | `boolean` | Show detailed prediction results after completion |
|
|
1082
|
+
|
|
1083
|
+
#### Templates
|
|
1084
|
+
|
|
1085
|
+
```tsx
|
|
1086
|
+
import { WidgetTemplate, MatchQuizPlayProps } from "fansunited-frontend-core";
|
|
1087
|
+
|
|
1088
|
+
// Standard template with optional image positioning
|
|
1089
|
+
const standardProps: MatchQuizPlayProps = {
|
|
1090
|
+
template: WidgetTemplate.STANDARD,
|
|
1091
|
+
imagePosition: "left", // or 'right'
|
|
1092
|
+
// ... other props
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
// Split template - side-by-side layout
|
|
1096
|
+
const splitProps: MatchQuizPlayProps = {
|
|
1097
|
+
template: WidgetTemplate.SPLIT,
|
|
1098
|
+
// imagePosition not available for non-standard templates
|
|
1099
|
+
// ... other props
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
// Overlay template - full-screen immersive experience
|
|
1103
|
+
const overlayProps: MatchQuizPlayProps = {
|
|
1104
|
+
template: WidgetTemplate.OVERLAY,
|
|
1105
|
+
// ... other props
|
|
1106
|
+
};
|
|
1107
|
+
```
|
|
1108
|
+
|
|
1109
|
+
#### Supported Markets
|
|
1110
|
+
|
|
1111
|
+
MatchQuizPlay supports a wide variety of football prediction markets:
|
|
1112
|
+
|
|
1113
|
+
**Match Result Markets:**
|
|
1114
|
+
|
|
1115
|
+
- `FT_1X2` - Full Time 1X2 (Home Win, Draw, Away Win)
|
|
1116
|
+
- `HT_1X2` - Half Time 1X2
|
|
1117
|
+
|
|
1118
|
+
**Score Markets:**
|
|
1119
|
+
|
|
1120
|
+
- `CORRECT_SCORE` - Exact final score prediction
|
|
1121
|
+
- `CORRECT_SCORE_HT` - Exact half-time score prediction
|
|
1122
|
+
- `CORRECT_SCORE_ADVANCED` - Advanced correct score with alternative points
|
|
1123
|
+
|
|
1124
|
+
**Player Markets:**
|
|
1125
|
+
|
|
1126
|
+
- `PLAYER_SCORE_FIRST_GOAL` - First goalscorer prediction
|
|
1127
|
+
- `PLAYER_SCORE` - Anytime goalscorer
|
|
1128
|
+
- `PLAYER_YELLOW_CARD` - Player to receive yellow card
|
|
1129
|
+
- `PLAYER_RED_CARD` - Player to receive red card
|
|
1130
|
+
- `PLAYER_SCORE_HATTRICK` - Player to score hat-trick
|
|
1131
|
+
- `PLAYER_SCORE_TWICE` - Player to score twice
|
|
1132
|
+
|
|
1133
|
+
**Over/Under Markets:**
|
|
1134
|
+
|
|
1135
|
+
- `OVER_GOALS_0_5` to `OVER_GOALS_6_5` - Total goals over/under
|
|
1136
|
+
- `OVER_CORNERS_6_5` to `OVER_CORNERS_13_5` - Total corners over/under
|
|
1137
|
+
|
|
1138
|
+
**Special Markets:**
|
|
1139
|
+
|
|
1140
|
+
- `CORNERS_MATCH` - Total corners in the match
|
|
1141
|
+
- `PENALTY_MATCH` - Penalty awarded in the match
|
|
1142
|
+
- `RED_CARD_MATCH` - Red card shown in the match
|
|
1143
|
+
|
|
1144
|
+
#### Game Status States
|
|
1145
|
+
|
|
1146
|
+
Match quizzes have 5 distinct status states:
|
|
1147
|
+
|
|
1148
|
+
- **`PENDING`** - Not yet open for predictions
|
|
1149
|
+
- **`OPEN`** - Ready for predictions (default state)
|
|
1150
|
+
- **`LIVE`** - Match has started, no new predictions accepted
|
|
1151
|
+
- **`CLOSED`** - Match finished, backend resolving predictions
|
|
1152
|
+
- **`SETTLED`** - Predictions resolved, leaderboard available
|
|
1153
|
+
|
|
1154
|
+
#### Countdown Timer
|
|
1155
|
+
|
|
1156
|
+
Enable countdown timer to show time remaining for predictions:
|
|
1157
|
+
|
|
1158
|
+
```tsx
|
|
1159
|
+
<MatchQuizPlay {...otherProps} showCountdown={true} />
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
The countdown timer:
|
|
1163
|
+
|
|
1164
|
+
- Displays when Match Quiz status is `OPEN`
|
|
1165
|
+
- Shows days, hours, minutes, and seconds remaining
|
|
1166
|
+
- Uses `predictionsCutoffTime` from the Match Quiz data
|
|
1167
|
+
- Automatically hides when cutoff time is reached
|
|
1168
|
+
|
|
1169
|
+
#### Points System
|
|
1170
|
+
|
|
1171
|
+
Enable points display to show potential rewards:
|
|
1172
|
+
|
|
1173
|
+
```tsx
|
|
1174
|
+
<MatchQuizPlay {...otherProps} showPoints={true} />
|
|
1175
|
+
```
|
|
1176
|
+
|
|
1177
|
+
Points system features:
|
|
1178
|
+
|
|
1179
|
+
- Shows potential points for each fixture
|
|
1180
|
+
- Displays earned vs possible points
|
|
1181
|
+
- Integrates with loyalty system configuration
|
|
1182
|
+
- Supports alternative point structures for advanced markets
|
|
1183
|
+
- Mobile-friendly tooltip display
|
|
1184
|
+
|
|
1185
|
+
#### Prediction Details
|
|
1186
|
+
|
|
1187
|
+
Show detailed prediction results and explanations:
|
|
1188
|
+
|
|
1189
|
+
```tsx
|
|
1190
|
+
<MatchQuizPlay {...otherProps} showPredictionDetails={true} />
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
When enabled, users see:
|
|
1194
|
+
|
|
1195
|
+
- Tabulated interface
|
|
1196
|
+
- Correct vs incorrect prediction highlighting
|
|
1197
|
+
- Detailed market results
|
|
1198
|
+
- Points breakdown per fixture
|
|
1199
|
+
|
|
1200
|
+
#### Sign in Configuration
|
|
1201
|
+
|
|
1202
|
+
Control user authentication and quiz access using the `userIsLoggedIn` and `signInCTA` props.
|
|
1203
|
+
|
|
1204
|
+
```tsx
|
|
1205
|
+
import { SignInCTADetails } from "fansunited-frontend-core";
|
|
1206
|
+
|
|
1207
|
+
// Custom sign-in component
|
|
1208
|
+
const signInCTA: SignInCTADetails = {
|
|
1209
|
+
component: <CustomSignInButton />,
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
// Basic sign-in with onClick handler
|
|
1213
|
+
const signInCTA: SignInCTADetails = {
|
|
1214
|
+
defaultLabel: "Sign in to predict",
|
|
1215
|
+
onClick: () => {
|
|
1216
|
+
// Handle sign-in logic
|
|
1217
|
+
console.log("Sign in clicked");
|
|
1218
|
+
},
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
// Sign-in with URL navigation
|
|
1222
|
+
const signInCTA: SignInCTADetails = {
|
|
1223
|
+
defaultLabel: "Login to join the competition",
|
|
1224
|
+
url: "https://your-auth-provider.com/login",
|
|
1225
|
+
target: "_blank",
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
<MatchQuizPlay {...otherProps} userIsLoggedIn={false} signInCTA={signInCTA} />;
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
**Sign-in Priority Order:**
|
|
1232
|
+
|
|
1233
|
+
1. **Custom Component** - If `signInCTA.component` is provided, it will be rendered
|
|
1234
|
+
2. **Click Handler** - If `signInCTA.onClick` is provided, a button with the handler will be rendered
|
|
1235
|
+
3. **URL Navigation** - If `signInCTA.url` is provided, a button will be rendered and clicking will navigate to the URL
|
|
1236
|
+
4. **Disabled** - If no `signInCTA` is provided, a disabled button will be shown
|
|
1237
|
+
|
|
1238
|
+
**Behavior:**
|
|
1239
|
+
|
|
1240
|
+
- When `userIsLoggedIn` is `false` and the quiz requires authentication (`authRequirement: "REGISTERED"`), the sign-in screen will be displayed instead of the quiz
|
|
1241
|
+
|
|
1242
|
+
#### Lead Collection
|
|
1243
|
+
|
|
1244
|
+
Capture user information before or after making predictions:
|
|
1245
|
+
|
|
1246
|
+
```tsx
|
|
1247
|
+
import { LeadsOptions } from "fansunited-frontend-core";
|
|
1248
|
+
|
|
1249
|
+
const leads: LeadsOptions = {
|
|
1250
|
+
position: "before", // "before" | "after"
|
|
1251
|
+
fields: ["fullName", "email"], // Available: "fullName" | "firstName" | "lastName" | "email" | "gender" | "country" | "phoneCountryCode" | "phoneNumber"
|
|
1252
|
+
campaignId: "match-quiz-2024",
|
|
1253
|
+
campaignName: "Football Prediction Campaign",
|
|
1254
|
+
phoneCountryCode: "44", // Default country code for phone fields
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
<MatchQuizPlay {...otherProps} leads={leads} />;
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
#### Examples
|
|
1261
|
+
|
|
1262
|
+
##### Basic Match Quiz
|
|
1263
|
+
|
|
1264
|
+
```tsx
|
|
1265
|
+
import { MatchQuizPlay } from "fansunited-frontend-components";
|
|
1266
|
+
import { WidgetTemplate } from "fansunited-frontend-core";
|
|
1267
|
+
|
|
1268
|
+
<MatchQuizPlay
|
|
1269
|
+
entityId="match-quiz-123"
|
|
1270
|
+
sdk={sdkInstance}
|
|
1271
|
+
template={WidgetTemplate.STANDARD}
|
|
1272
|
+
language="en"
|
|
1273
|
+
/>;
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
##### Advanced Match Quiz
|
|
1277
|
+
|
|
1278
|
+
```tsx
|
|
1279
|
+
<MatchQuizPlay
|
|
1280
|
+
entityId="match-quiz-123"
|
|
1281
|
+
sdk={sdkInstance}
|
|
1282
|
+
template={WidgetTemplate.OVERLAY}
|
|
1283
|
+
language="en"
|
|
1284
|
+
showCountdown={true}
|
|
1285
|
+
showTeamLabels={true}
|
|
1286
|
+
showPoints={true}
|
|
1287
|
+
showPredictionDetails={true}
|
|
1288
|
+
userIsLoggedIn={false}
|
|
1289
|
+
signInCTA={{
|
|
1290
|
+
defaultLabel: "Sign in to compete",
|
|
1291
|
+
onClick: () => handleSignIn(),
|
|
1292
|
+
}}
|
|
1293
|
+
leads={{
|
|
1294
|
+
position: "after",
|
|
1295
|
+
fields: ["fullName", "email"],
|
|
1296
|
+
campaignId: "match-prediction-campaign",
|
|
1297
|
+
campaignName: "Football Predictions 2024",
|
|
1298
|
+
phoneCountryCode: "44",
|
|
1299
|
+
}}
|
|
1300
|
+
themeOptions={{
|
|
1301
|
+
mode: "dark",
|
|
1302
|
+
colorSchemes: {
|
|
1303
|
+
dark: {
|
|
1304
|
+
textPrimary: "#ffffff",
|
|
1305
|
+
surface: "#1a1a1a",
|
|
1306
|
+
},
|
|
1307
|
+
},
|
|
1308
|
+
}}
|
|
1309
|
+
/>
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
##### Customized Layout
|
|
1313
|
+
|
|
1314
|
+
```tsx
|
|
1315
|
+
<MatchQuizPlay
|
|
1316
|
+
entityId="match-quiz-123"
|
|
1317
|
+
sdk={sdkInstance}
|
|
1318
|
+
template={WidgetTemplate.STANDARD}
|
|
1319
|
+
imagePosition="right"
|
|
1320
|
+
language="en"
|
|
1321
|
+
showCountdown={true}
|
|
1322
|
+
showTeamLabels={false}
|
|
1323
|
+
showPoints={true}
|
|
1324
|
+
themeOptions={{
|
|
1325
|
+
mode: "light",
|
|
1326
|
+
customFontFamily: {
|
|
1327
|
+
light: {
|
|
1328
|
+
primary: "Inter, sans-serif",
|
|
1329
|
+
secondary: "Roboto, sans-serif",
|
|
1330
|
+
},
|
|
1331
|
+
},
|
|
1033
1332
|
}}
|
|
1034
1333
|
/>
|
|
1035
1334
|
```
|
|
@@ -1042,6 +1341,7 @@ This package exports the following components:
|
|
|
1042
1341
|
- **`PollVote`** - Interactive polling with real-time results
|
|
1043
1342
|
- **`CollectLead`** - Lead collection forms with custom fields
|
|
1044
1343
|
- **`PersonalityQuizPlay`** - Personality assessment with persona matching
|
|
1344
|
+
- **`MatchQuizPlay`** - Football match prediction quiz with multiple markets
|
|
1045
1345
|
|
|
1046
1346
|
## Related Packages
|
|
1047
1347
|
|