@popmenu/common-ui 0.150.2 → 0.151.1

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.
Files changed (73) hide show
  1. package/build/cjs/components/Avatar/Avatar.d.ts +1 -1
  2. package/build/cjs/components/BrowserSilhouette/BrowserSilhouette.d.ts +2 -2
  3. package/build/cjs/components/Checkbox/Checkbox.d.ts +1 -1
  4. package/build/cjs/components/Chip/Chip.d.ts +1 -1
  5. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +2 -1
  6. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +2 -1
  7. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +2 -1
  8. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.d.ts +2 -2
  9. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +2 -1
  10. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +13 -2
  11. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +2 -1
  12. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +2 -1
  13. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +2 -1
  14. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +2 -1
  15. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationLogoContainer.d.ts +2 -0
  16. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +2 -1
  17. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationVipBenefitRows.d.ts +2 -0
  18. package/build/cjs/components/IconButton/IconButton.d.ts +1 -1
  19. package/build/cjs/components/Paper/Paper.d.ts +1 -1
  20. package/build/cjs/components/PaperContent/PaperContent.d.ts +1 -1
  21. package/build/cjs/components/Radio/Radio.d.ts +1 -1
  22. package/build/cjs/components/Switch/Switch.d.ts +1 -1
  23. package/build/cjs/components/TabPanel/TabPanel.d.ts +2 -2
  24. package/build/cjs/components/ToggleButton/ToggleButton.d.ts +1 -1
  25. package/build/cjs/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
  26. package/build/cjs/components/Tooltip/Tooltip.d.ts +1 -1
  27. package/build/cjs/index.js +192 -48
  28. package/build/cjs/index.js.map +1 -1
  29. package/build/esm/components/Avatar/Avatar.d.ts +1 -1
  30. package/build/esm/components/BrowserSilhouette/BrowserSilhouette.d.ts +2 -2
  31. package/build/esm/components/Checkbox/Checkbox.d.ts +1 -1
  32. package/build/esm/components/Chip/Chip.d.ts +1 -1
  33. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +2 -1
  34. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +13 -5
  35. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -1
  36. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +2 -1
  37. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +2 -1
  38. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.d.ts +2 -2
  39. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +12 -4
  40. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -1
  41. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +2 -1
  42. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +20 -10
  43. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
  44. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +13 -2
  45. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +2 -1
  46. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +7 -5
  47. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -1
  48. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +2 -1
  49. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +79 -15
  50. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
  51. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +2 -1
  52. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +4 -2
  53. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -1
  54. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +2 -1
  55. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +8 -2
  56. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -1
  57. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationLogoContainer.d.ts +2 -0
  58. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationLogoContainer.js +30 -0
  59. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationLogoContainer.js.map +1 -0
  60. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +2 -1
  61. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationVipBenefitRows.d.ts +2 -0
  62. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationVipBenefitRows.js +33 -0
  63. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationVipBenefitRows.js.map +1 -0
  64. package/build/esm/components/IconButton/IconButton.d.ts +1 -1
  65. package/build/esm/components/Paper/Paper.d.ts +1 -1
  66. package/build/esm/components/PaperContent/PaperContent.d.ts +1 -1
  67. package/build/esm/components/Radio/Radio.d.ts +1 -1
  68. package/build/esm/components/Switch/Switch.d.ts +1 -1
  69. package/build/esm/components/TabPanel/TabPanel.d.ts +2 -2
  70. package/build/esm/components/ToggleButton/ToggleButton.d.ts +1 -1
  71. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
  72. package/build/esm/components/Tooltip/Tooltip.d.ts +1 -1
  73. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { IconProps } from '../Icon/IconProps';
2
3
  export type FollowerAuthenticationDialogProps = {
3
4
  open: boolean;
4
5
  state: ReducerState;
@@ -9,10 +10,16 @@ export type FollowerAuthenticationDialogProps = {
9
10
  loading: boolean;
10
11
  graphics: Record<`${ReducerStateValue}`, string>;
11
12
  logos: Record<'popmenu' | 'facebook' | 'google' | 'apple', ReactNode>;
13
+ logoUrl?: string;
12
14
  showCloseButton?: boolean;
13
15
  showAppleButton?: boolean;
14
16
  showFacebookButton?: boolean;
15
17
  showGoogleButton?: boolean;
18
+ showV2?: boolean;
19
+ signUpBackgroundImageUrl?: string;
20
+ vipBenefitRows?: FollowerAuthenticationVipBenefitRow[];
21
+ showSubscribeEmail?: boolean;
22
+ showSubscribeSms?: boolean;
16
23
  onActionButtonClick: (eventType: ClickEventType, values?: Record<string, string>) => void;
17
24
  };
18
25
  export type ReducerState = {
@@ -24,10 +31,14 @@ export type ReducerState = {
24
31
  };
25
32
  };
26
33
  export type ReducerStateValue = 'initial' | 'signUp' | 'emailFound' | 'indirectUserFound' | 'emailAuthCode' | 'emailPasswordSignIn' | 'phoneFound' | 'phoneAuthCode' | 'phonePasswordSignIn' | 'welcome' | 'requirePhone';
27
- export type ClickEventType = 'submit-form' | 'click-close' | 'code-sent' | 'request-auth-code-email' | 'request-auth-code-sms' | 'close' | 'use-different-account' | 'sign-in-with-password' | 'sign-in-with-facebook' | 'sign-in-with-google' | 'sign-in-with-apple';
28
- export type MessageKey = `${ReducerStateValue}Title` | `${ReducerStateValue}Info` | 'requirePhoneInputLabel' | 'requirePhoneCtaButtonLabel' | 'indirectUserFoundLabel' | 'indirectUserFoundCtaButtonLabel' | 'indirectUserFoundCtaButtonLabelAlt' | 'signUpPhoneErrorText' | 'signUpPhoneInputLabel' | 'signUpNameInputLabel' | 'signUpEmailErrorText' | 'signUpEmailInputLabel' | 'signUpLocationErrorText' | 'signUpLocationInputLabel' | 'signUpBirthdaySectionLabel' | 'signUpMonthInputLabel' | 'signUpDayInputLabel' | 'signUp' | 'signUpFinePrint' | 'emailFoundInputLabel' | 'emailFoundCtaButtonLabel' | 'phoneFoundInputLabel' | 'phoneFoundCtaButtonLabel' | 'emailAuthCodeInputLabel' | 'phoneAuthCodeInputLabel' | 'resendAuthCode' | 'or' | 'popmenuLogoAlt' | 'continueWithFacebookButtonLabel' | 'continueWithGoogleButtonLabel' | 'continueWithAppleButtonLabel' | 'initialCtaButtonLabel' | 'initialInputLabel' | 'passwordInputLabel' | 'poweredBy' | 'done' | 'signIn' | 'signInWithPassword';
34
+ export type ClickEventType = 'submit-form' | 'click-close' | 'code-sent' | 'request-auth-code-email' | 'request-auth-code-sms' | 'close' | 'use-different-account' | 'sign-in-with-password' | 'sign-in-with-facebook' | 'sign-in-with-google' | 'sign-in-with-apple' | 'open-terms-of-service' | 'open-privacy-policy';
35
+ export type MessageKey = `${ReducerStateValue}Title` | `${ReducerStateValue}Info` | 'requirePhoneInputLabel' | 'requirePhoneCtaButtonLabel' | 'indirectUserFoundLabel' | 'indirectUserFoundCtaButtonLabel' | 'indirectUserFoundCtaButtonLabelAlt' | 'signUpPhoneErrorText' | 'signUpPhoneInputLabel' | 'signUpNameInputLabel' | 'signUpEmailErrorText' | 'signUpEmailInputLabel' | 'signUpLocationErrorText' | 'signUpLocationInputLabel' | 'signUpBirthdaySectionLabel' | 'signUpMonthInputLabel' | 'signUpDayInputLabel' | 'signUp' | 'signUpFinePrint' | 'emailFoundInputLabel' | 'emailFoundCtaButtonLabel' | 'phoneFoundInputLabel' | 'phoneFoundCtaButtonLabel' | 'emailAuthCodeInputLabel' | 'phoneAuthCodeInputLabel' | 'resendAuthCode' | 'or' | 'popmenuLogoAlt' | 'continueWithFacebookButtonLabel' | 'continueWithGoogleButtonLabel' | 'continueWithAppleButtonLabel' | 'initialCtaButtonLabel' | 'initialInputLabel' | 'passwordInputLabel' | 'poweredBy' | 'done' | 'signIn' | 'signInWithPassword' | 'termsOfServiceButtonLabel' | 'subscribeEmailCheckboxLabel' | 'subscribeSmsCheckboxLabel' | 'privacyPolicyText' | 'privacyPolicyButtonLabel';
29
36
  type LocationOption = {
30
37
  label: string;
31
38
  value: string;
32
39
  };
40
+ type FollowerAuthenticationVipBenefitRow = {
41
+ icon: IconProps['icon'];
42
+ text: string;
43
+ };
33
44
  export {};
@@ -1 +1,2 @@
1
- export declare const FollowerAuthenticationFooter: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationFooter: () => React.JSX.Element;
@@ -1,12 +1,14 @@
1
- import { Box, Typography } from '@material-ui/core';
1
+ import { Box, Typography, Button } from '@material-ui/core';
2
2
  import React from 'react';
3
3
  import { useFollowerAuthenticationDialogContext } from './context.js';
4
4
 
5
5
  const FollowerAuthenticationFooter = () => {
6
- const { messages, logos } = useFollowerAuthenticationDialogContext();
7
- return (React.createElement(Box, { display: "flex", gridGap: 8 },
8
- React.createElement(Typography, { variant: "body2" }, messages.poweredBy),
9
- logos.popmenu));
6
+ const { messages, logos, onActionButtonClick, showV2 } = useFollowerAuthenticationDialogContext();
7
+ return (React.createElement(Box, { display: "flex", flexDirection: "column", gridGap: 4 },
8
+ React.createElement(Box, { display: "flex", justifyContent: "center", gridGap: 8 },
9
+ React.createElement(Typography, { variant: showV2 ? 'caption' : 'body2' }, messages.poweredBy),
10
+ logos.popmenu),
11
+ showV2 && (React.createElement(Button, { onClick: () => onActionButtonClick('open-terms-of-service'), style: { textDecoration: 'underline', fontSize: '0.75rem' }, variant: "text" }, messages.termsOfServiceButtonLabel))));
10
12
  };
11
13
 
12
14
  export { FollowerAuthenticationFooter };
@@ -1 +1 @@
1
- {"version":3,"file":"FollowerAuthenticationFooter.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.tsx"],"sourcesContent":["import { Box, Typography } from '@material-ui/core'\nimport React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\n\nexport const FollowerAuthenticationFooter = () => {\n const { messages, logos } = useFollowerAuthenticationDialogContext()\n return (\n <Box display=\"flex\" gridGap={8}>\n <Typography variant=\"body2\">{messages.poweredBy}</Typography>\n {logos.popmenu}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,4BAA4B,GAAG,MAAK;IAC/C,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,sCAAsC,EAAE;IACpE,QACE,KAAC,CAAA,aAAA,CAAA,GAAG,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,CAAC,EAAA;QAC5B,KAAC,CAAA,aAAA,CAAA,UAAU,IAAC,OAAO,EAAC,OAAO,EAAE,EAAA,QAAQ,CAAC,SAAS,CAAc;AAC5D,QAAA,KAAK,CAAC,OAAO,CACV;AAEV;;;;"}
1
+ {"version":3,"file":"FollowerAuthenticationFooter.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.tsx"],"sourcesContent":["import { Box, Button, Typography } from '@material-ui/core'\nimport React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\n\nexport const FollowerAuthenticationFooter = () => {\n const { messages, logos, onActionButtonClick, showV2 } = useFollowerAuthenticationDialogContext()\n return (\n <Box display=\"flex\" flexDirection=\"column\" gridGap={4}>\n <Box display=\"flex\" justifyContent=\"center\" gridGap={8}>\n <Typography variant={showV2 ? 'caption' : 'body2'}>{messages.poweredBy}</Typography>\n {logos.popmenu}\n </Box>\n {showV2 && (\n <Button\n onClick={() => onActionButtonClick('open-terms-of-service')}\n style={{ textDecoration: 'underline', fontSize: '0.75rem' }}\n variant=\"text\"\n >\n {messages.termsOfServiceButtonLabel}\n </Button>\n )}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,4BAA4B,GAAG,MAAK;AAC/C,IAAA,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,sCAAsC,EAAE;AACjG,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAA;AACnD,QAAA,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAA;AACpD,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAC,EAAA,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,IAAG,QAAQ,CAAC,SAAS,CAAc;YACnF,KAAK,CAAC,OAAO,CACV;AACL,QAAA,MAAM,KACL,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EACL,OAAO,EAAE,MAAM,mBAAmB,CAAC,uBAAuB,CAAC,EAC3D,KAAK,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC3D,OAAO,EAAC,MAAM,EAAA,EAEb,QAAQ,CAAC,yBAAyB,CAC5B,CACV,CACG;AAEV;;;;"}
@@ -1 +1,2 @@
1
- export declare const FollowerAuthenticationForm: () => JSX.Element | null;
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationForm: () => React.JSX.Element | null;
@@ -1,16 +1,54 @@
1
1
  import React, { useRef, useState, useEffect } from 'react';
2
2
  import { useFollowerAuthenticationDialogContext } from './context.js';
3
- import { makeStyles, TextField, Button, MenuItem, Typography } from '@material-ui/core';
3
+ import { makeStyles, TextField, Button, Box, FormControlLabel, Typography, Checkbox, MenuItem } from '@material-ui/core';
4
4
 
5
- const useStyles = makeStyles(() => ({
5
+ const useStyles = makeStyles((theme) => ({
6
+ checkboxLabel: {
7
+ '& > a': {
8
+ textDecoration: 'underline',
9
+ },
10
+ fontSize: '0.75rem',
11
+ },
6
12
  form: {
13
+ alignItems: 'center',
7
14
  display: 'flex',
8
15
  flexDirection: 'column',
9
- alignItems: 'center',
10
- width: '100%',
11
16
  gridGap: 16,
17
+ width: '100%',
18
+ },
19
+ label: {
20
+ alignSelf: 'start',
21
+ fontSize: '0.85rem',
22
+ },
23
+ privacyPolicyButton: {
24
+ fontSize: '0.75rem',
25
+ margin: theme.spacing(0, 0.5),
26
+ padding: 0,
27
+ textDecoration: 'underline',
28
+ width: 'auto',
29
+ },
30
+ privacyPolicyText: {
31
+ fontSize: '0.75rem',
32
+ textAlign: 'center',
12
33
  },
13
34
  }));
35
+ function LocationAndBirthday({ checkFieldValidity, classes, loading, locationOptions, messages, showLocationErrorText, showV2, }) {
36
+ const locationSelect = (React.createElement(TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, id: "location-input", inputProps: { required: true }, name: "location" }, locationOptions.map((locationOption) => (React.createElement(MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)))));
37
+ if (showV2) {
38
+ return (React.createElement(React.Fragment, null,
39
+ React.createElement(Box, { display: "flex", flexDirection: "column", gridGap: 4, style: { width: '100%' } },
40
+ React.createElement(Typography, { className: classes.label }, messages.signUpBirthdaySectionLabel),
41
+ React.createElement(Box, { display: "flex", gridGap: 16 },
42
+ React.createElement(TextField, { disabled: loading, label: messages.signUpMonthInputLabel, id: "birthday-month-input", name: "birthdayMonth", style: { flex: 1 } }),
43
+ React.createElement(TextField, { disabled: loading, label: messages.signUpDayInputLabel, id: "birthday-date-input", name: "birthdayDate", style: { flex: 1 } }))),
44
+ locationSelect));
45
+ }
46
+ return (React.createElement(React.Fragment, null,
47
+ locationSelect,
48
+ React.createElement(Typography, { style: { alignSelf: 'start' } }, messages.signUpBirthdaySectionLabel),
49
+ React.createElement(TextField, { disabled: loading, label: messages.signUpMonthInputLabel, id: "birthday-month-input", name: "birthdayMonth" }),
50
+ React.createElement(TextField, { disabled: loading, label: messages.signUpDayInputLabel, id: "birthday-date-input", name: "birthdayDate" })));
51
+ }
14
52
  const northAmericanPhoneRegex = /^(\()?[2-9]{1}\d{2}(\))?[-\s.]?[2-9]{1}\d{2}[-\s.]?\d{4}$/;
15
53
  const ukPhoneRegex = /^((\+?44\s?|0044\s?)(\s?\d{3,5}|\(\d{3,5}\))(\s?\d{3,4})(\s?\d{3,4})$|^07\d{9}$)/;
16
54
  const validatePhoneNumber = (phone) => {
@@ -19,20 +57,27 @@ const validatePhoneNumber = (phone) => {
19
57
  return northAmericanPhoneRegex.test(phone) || ukPhoneRegex.test(phone);
20
58
  };
21
59
  const FollowerAuthenticationForm = () => {
22
- const { state, messages, locationOptions, onActionButtonClick, loading } = useFollowerAuthenticationDialogContext();
60
+ const { state, messages, locationOptions, onActionButtonClick, loading, showV2, showSubscribeEmail, showSubscribeSms, } = useFollowerAuthenticationDialogContext();
23
61
  const classes = useStyles();
24
62
  // sign-up form state
25
63
  const formRef = useRef(null);
26
64
  const [formValidity, setFormValidity] = useState(false);
65
+ const [showNameErrorText, setShowNameErrorText] = useState();
27
66
  const [showPhoneErrorText, setShowPhoneErrorText] = useState();
28
67
  const [showEmailErrorText, setShowEmailErrorText] = useState();
29
68
  const [showLocationErrorText, setShowLocationErrorText] = useState();
69
+ const [signUpNameValue, setSignUpNameValue] = useState(state.context.name || '');
30
70
  const [signUpPhoneValue, setSignUpPhoneValue] = useState(state.context.phone || '');
31
71
  const [signUpEmailValue, setSignUpEmailValue] = useState(state.context.email || '');
32
72
  const checkFieldValidity = (e) => {
33
73
  const fieldName = e.target.name;
34
74
  const fieldValue = e.target.value;
35
75
  switch (fieldName) {
76
+ case 'name':
77
+ const isNameValid = fieldValue.length > 0;
78
+ setSignUpNameValue(fieldValue);
79
+ setShowNameErrorText(!isNameValid);
80
+ break;
36
81
  case 'phone':
37
82
  const isPhoneValid = validatePhoneNumber(fieldValue);
38
83
  setSignUpPhoneValue(fieldValue);
@@ -50,9 +95,10 @@ const FollowerAuthenticationForm = () => {
50
95
  }
51
96
  };
52
97
  useEffect(() => {
98
+ setSignUpNameValue(state.context.name || '');
53
99
  setSignUpPhoneValue(state.context.phone || '');
54
100
  setSignUpEmailValue(state.context.email || '');
55
- }, [state.context.phone, state.context.email]);
101
+ }, [state.context.name, state.context.phone, state.context.email]);
56
102
  useEffect(() => {
57
103
  // Validate pre-filled values (only in signUp state)
58
104
  if (state.value === 'signUp') {
@@ -66,18 +112,33 @@ const FollowerAuthenticationForm = () => {
66
112
  setShowEmailErrorText(!isEmailValid);
67
113
  }
68
114
  }
115
+ const hasValidName = Boolean(signUpNameValue) && !showNameErrorText;
69
116
  const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText;
70
117
  const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText;
71
118
  const locationField = formRef.current?.elements.namedItem('location');
72
119
  const hasValidLocation = locationField ? Boolean(locationField.value) : true;
73
- const hasValidContact = hasValidPhone || hasValidEmail;
120
+ const hasValidContact = showV2 ? hasValidName && hasValidPhone && hasValidEmail : hasValidPhone || hasValidEmail;
74
121
  setFormValidity(hasValidContact && hasValidLocation);
75
- }, [state.value, signUpPhoneValue, signUpEmailValue, showPhoneErrorText, showEmailErrorText, showLocationErrorText]);
122
+ }, [
123
+ showV2,
124
+ state.value,
125
+ signUpPhoneValue,
126
+ signUpEmailValue,
127
+ showPhoneErrorText,
128
+ showEmailErrorText,
129
+ showLocationErrorText,
130
+ signUpNameValue,
131
+ showNameErrorText,
132
+ ]);
76
133
  const handleSubmit = (e) => {
77
134
  e.preventDefault();
78
135
  const form = e.target;
79
136
  const formData = new FormData(form);
80
137
  const values = Object.fromEntries(formData.entries());
138
+ if (state.value === 'signUp') {
139
+ values.subscribeEmail = String(formData.has('subscribeEmail'));
140
+ values.subscribeSms = String(formData.has('subscribeSms'));
141
+ }
81
142
  onActionButtonClick('submit-form', values);
82
143
  };
83
144
  const formProps = {
@@ -95,17 +156,20 @@ const FollowerAuthenticationForm = () => {
95
156
  e.preventDefault();
96
157
  } },
97
158
  React.createElement(TextField, { disabled: loading, label: messages.signUpPhoneInputLabel, key: "phone-input", id: "phone-input", name: "phone", onChange: checkFieldValidity, error: showPhoneErrorText, helperText: showPhoneErrorText && messages.signUpPhoneErrorText, inputProps: {
98
- required: signUpEmailValue ? false : true,
159
+ required: showV2 || !signUpEmailValue,
99
160
  }, defaultValue: state.context.phone }),
100
- React.createElement(TextField, { disabled: loading, label: messages.signUpNameInputLabel, key: "name-input", id: "name-input", name: "name", inputProps: { required: true } }),
161
+ React.createElement(TextField, { disabled: loading, label: messages.signUpNameInputLabel, key: "name-input", id: "name-input", name: "name", onChange: checkFieldValidity, error: showNameErrorText, inputProps: { required: true }, defaultValue: state.context.name }),
101
162
  React.createElement(TextField, { disabled: loading, label: messages.signUpEmailInputLabel, key: "email-input", id: "email-input", name: "email", error: showEmailErrorText, helperText: showEmailErrorText && messages.signUpEmailErrorText, onChange: checkFieldValidity, inputProps: {
102
- required: signUpPhoneValue ? false : true,
163
+ required: showV2 || !signUpPhoneValue,
103
164
  type: 'email',
104
165
  }, defaultValue: state.context.email }),
105
- React.createElement(TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, key: "location-input", id: "location-input", inputProps: { required: true }, name: "location" }, locationOptions.map((locationOption) => (React.createElement(MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)))),
106
- React.createElement(Typography, { style: { alignSelf: 'start' } }, messages.signUpBirthdaySectionLabel),
107
- React.createElement(TextField, { disabled: loading, label: messages.signUpMonthInputLabel, key: "birthday-month-input", id: "birthday-month-input", name: "birthdayMonth" }),
108
- React.createElement(TextField, { disabled: loading, label: messages.signUpDayInputLabel, key: "birthday-date-input", id: "birthday-date-input", name: "birthdayDate" }),
166
+ React.createElement(LocationAndBirthday, { checkFieldValidity: checkFieldValidity, classes: classes, loading: loading, locationOptions: locationOptions, messages: messages, showLocationErrorText: showLocationErrorText, showV2: showV2 }),
167
+ React.createElement(Box, { display: "flex", flexDirection: "column", alignItems: "flex-start", gridGap: 2, width: "100%" },
168
+ showSubscribeEmail && (React.createElement(FormControlLabel, { style: { alignItems: 'flex-start' }, control: React.createElement(Checkbox, { id: "subscribe-email", name: "subscribeEmail", disabled: loading, color: "primary" }), label: React.createElement(Typography, { className: classes.checkboxLabel }, messages.subscribeEmailCheckboxLabel) })),
169
+ showSubscribeSms && (React.createElement(FormControlLabel, { style: { alignItems: 'flex-start' }, control: React.createElement(Checkbox, { id: "subscribe-sms", name: "subscribeSms", disabled: loading, color: "primary" }), label: React.createElement(Typography, { className: classes.checkboxLabel }, messages.subscribeSmsCheckboxLabel) }))),
170
+ showV2 && messages.privacyPolicyText && (React.createElement(Typography, { className: classes.privacyPolicyText },
171
+ messages.privacyPolicyText,
172
+ React.createElement(Button, { className: classes.privacyPolicyButton, onClick: () => onActionButtonClick('open-privacy-policy'), variant: "text" }, messages.privacyPolicyButtonLabel))),
109
173
  React.createElement(Button, { disabled: loading || !formValidity, type: "submit" }, messages.signUp)));
110
174
  case 'emailFound':
111
175
  return (React.createElement("form", { ...formProps },
@@ -1 +1 @@
1
- {"version":3,"file":"FollowerAuthenticationForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, useEffect, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Button, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\n\nconst useStyles = makeStyles(() => ({\n form: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n gridGap: 16,\n },\n}))\n\nconst northAmericanPhoneRegex = /^(\\()?[2-9]{1}\\d{2}(\\))?[-\\s.]?[2-9]{1}\\d{2}[-\\s.]?\\d{4}$/\nconst ukPhoneRegex = /^((\\+?44\\s?|0044\\s?)(\\s?\\d{3,5}|\\(\\d{3,5}\\))(\\s?\\d{3,4})(\\s?\\d{3,4})$|^07\\d{9}$)/\n\nconst validatePhoneNumber = (phone: string): boolean => {\n if (!phone) return false\n return northAmericanPhoneRegex.test(phone) || ukPhoneRegex.test(phone)\n}\n\nexport const FollowerAuthenticationForm = () => {\n const { state, messages, locationOptions, onActionButtonClick, loading } = useFollowerAuthenticationDialogContext()\n const classes = useStyles()\n\n // sign-up form state\n const formRef = useRef<HTMLFormElement>(null)\n const [formValidity, setFormValidity] = useState(false)\n const [showPhoneErrorText, setShowPhoneErrorText] = useState<boolean | undefined>()\n const [showEmailErrorText, setShowEmailErrorText] = useState<boolean | undefined>()\n const [showLocationErrorText, setShowLocationErrorText] = useState<boolean | undefined>()\n const [signUpPhoneValue, setSignUpPhoneValue] = useState(state.context.phone || '')\n const [signUpEmailValue, setSignUpEmailValue] = useState(state.context.email || '')\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'phone':\n const isPhoneValid = validatePhoneNumber(fieldValue)\n setSignUpPhoneValue(fieldValue)\n setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0)\n break\n case 'email':\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setSignUpEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n case 'location':\n setShowLocationErrorText(!fieldValue)\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n setSignUpPhoneValue(state.context.phone || '')\n setSignUpEmailValue(state.context.email || '')\n }, [state.context.phone, state.context.email])\n\n useEffect(() => {\n // Validate pre-filled values (only in signUp state)\n if (state.value === 'signUp') {\n if (signUpPhoneValue) {\n const isPhoneValid = validatePhoneNumber(signUpPhoneValue)\n setShowPhoneErrorText(!isPhoneValid)\n }\n if (signUpEmailValue) {\n const emailField = formRef.current?.elements.namedItem('email') as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setShowEmailErrorText(!isEmailValid)\n }\n }\n\n const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText\n const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText\n\n const locationField = formRef.current?.elements.namedItem('location') as HTMLInputElement\n const hasValidLocation = locationField ? Boolean(locationField.value) : true\n\n const hasValidContact = hasValidPhone || hasValidEmail\n setFormValidity(hasValidContact && hasValidLocation)\n }, [state.value, signUpPhoneValue, signUpEmailValue, showPhoneErrorText, showEmailErrorText, showLocationErrorText])\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const form = e.target as HTMLFormElement\n const formData = new FormData(form)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n onActionButtonClick('submit-form', values)\n }\n const formProps = {\n id: 'follower-authentication-form',\n className: classes.form,\n onSubmit: handleSubmit,\n }\n switch (state.value) {\n case 'initial':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.initialInputLabel}\n key=\"identifier-input\"\n id=\"identifier-input\"\n name=\"identifier\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.initialCtaButtonLabel}\n </Button>\n </form>\n )\n case 'signUp':\n return (\n <form\n ref={formRef}\n {...formProps}\n onInvalid={(e) => {\n e.preventDefault()\n }}\n >\n <TextField\n disabled={loading}\n label={messages.signUpPhoneInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n inputProps={{\n required: signUpEmailValue ? false : true,\n }}\n defaultValue={state.context.phone}\n />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n key=\"name-input\"\n id=\"name-input\"\n name=\"name\"\n inputProps={{ required: true }}\n />\n <TextField\n disabled={loading}\n label={messages.signUpEmailInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n onChange={checkFieldValidity}\n inputProps={{\n required: signUpPhoneValue ? false : true,\n type: 'email',\n }}\n defaultValue={state.context.email}\n />\n <TextField\n disabled={loading}\n select\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n key=\"location-input\"\n id=\"location-input\"\n inputProps={{ required: true }}\n name=\"location\"\n >\n {locationOptions.map((locationOption) => (\n <MenuItem data-cy={'option'} key={locationOption.value} value={locationOption.value}>\n {locationOption.label}\n </MenuItem>\n ))}\n </TextField>\n <Typography style={{ alignSelf: 'start' }}>{messages.signUpBirthdaySectionLabel}</Typography>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n key=\"birthday-month-input\"\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n />\n <TextField\n disabled={loading}\n label={messages.signUpDayInputLabel}\n key=\"birthday-date-input\"\n id=\"birthday-date-input\"\n name=\"birthdayDate\"\n />\n <Button disabled={loading || !formValidity} type=\"submit\">\n {messages.signUp}\n </Button>\n </form>\n )\n case 'emailFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.emailFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'emailAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailAuthCodeInputLabel}\n key=\"code-input\"\n id=\"code-input\"\n name=\"code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'indirectUserFound': {\n if (state.context.email) {\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n } else if (state.context.phone) {\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n } else return null\n }\n case 'emailPasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n key=\"password-input\"\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phoneFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.phoneFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'phoneAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneAuthCodeInputLabel}\n key=\"code-input\"\n id=\"code-input\"\n name=\"code\"\n autoComplete=\"one-time-code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phonePasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n key=\"password-input\"\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'requirePhone':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.requirePhoneInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.requirePhoneCtaButtonLabel}\n </Button>\n </form>\n )\n case 'welcome':\n return null\n default:\n return null\n }\n}\n"],"names":[],"mappings":";;;;AAIA,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO;AAClC,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,OAAO,EAAE,EAAE;AACZ,KAAA;AACF,CAAA,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,2DAA2D;AAC3F,MAAM,YAAY,GAAG,kFAAkF;AAEvG,MAAM,mBAAmB,GAAG,CAAC,KAAa,KAAa;AACrD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,KAAK;AACxB,IAAA,OAAO,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,CAAC;AAEM,MAAM,0BAA0B,GAAG,MAAK;AAC7C,IAAA,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,GAAG,sCAAsC,EAAE;AACnH,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;;AAG3B,IAAA,MAAM,OAAO,GAAG,MAAM,CAAkB,IAAI,CAAC;IAC7C,MAA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BAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,QAAQ,CAAC,kBAAkB,EAClC,GAAG,EAAC,gBAAgB,EACpB,EAAE,EAAC,gBAAgB,EACnB,IAAI,EAAC,UAAU,EACf,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAChC,CAAA;AACF,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAA,EACrC,QAAQ,CAAC,MAAM,CACT,CACJ;AAEX,QAAA,KAAK,cAAc;YACjB,QACE,iCAAU,SAAS,EAAA;AACjB,gBAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,QAAQ,CAAC,sBAAsB,EACtC,GAAG,EAAC,aAAa,EACjB,EAAE,EAAC,aAAa,EAChB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAC1B,CAAA;AACF,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAA,EACrC,QAAQ,CAAC,0BAA0B,CAC7B,CACJ;AAEX,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,IAAI;AACb,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;;;;"}
1
+ {"version":3,"file":"FollowerAuthenticationForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, ReactNode, useEffect, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Button, Checkbox, FormControlLabel, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\n\nconst useStyles = makeStyles((theme) => ({\n checkboxLabel: {\n '& > a': {\n textDecoration: 'underline',\n },\n fontSize: '0.75rem',\n },\n form: {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gridGap: 16,\n width: '100%',\n },\n label: {\n alignSelf: 'start',\n fontSize: '0.85rem',\n },\n privacyPolicyButton: {\n fontSize: '0.75rem',\n margin: theme.spacing(0, 0.5),\n padding: 0,\n textDecoration: 'underline',\n width: 'auto',\n },\n privacyPolicyText: {\n fontSize: '0.75rem',\n textAlign: 'center',\n },\n}))\n\ntype LocationAndBirthdayProps = {\n checkFieldValidity: ChangeEventHandler<HTMLInputElement>\n classes: { label: string }\n loading: boolean\n locationOptions: { label: string; value: string }[]\n messages: Record<MessageKey, ReactNode>\n showLocationErrorText: boolean | undefined\n showV2: boolean | undefined\n}\n\nfunction LocationAndBirthday({\n checkFieldValidity,\n classes,\n loading,\n locationOptions,\n messages,\n showLocationErrorText,\n showV2,\n}: LocationAndBirthdayProps) {\n const locationSelect = (\n <TextField\n disabled={loading}\n select\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n id=\"location-input\"\n inputProps={{ required: true }}\n name=\"location\"\n >\n {locationOptions.map((locationOption) => (\n <MenuItem data-cy={'option'} key={locationOption.value} value={locationOption.value}>\n {locationOption.label}\n </MenuItem>\n ))}\n </TextField>\n )\n\n if (showV2) {\n return (\n <>\n <Box display=\"flex\" flexDirection=\"column\" gridGap={4} style={{ width: '100%' }}>\n <Typography className={classes.label}>{messages.signUpBirthdaySectionLabel}</Typography>\n <Box display=\"flex\" gridGap={16}>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n style={{ flex: 1 }}\n />\n <TextField\n disabled={loading}\n label={messages.signUpDayInputLabel}\n id=\"birthday-date-input\"\n name=\"birthdayDate\"\n style={{ flex: 1 }}\n />\n </Box>\n </Box>\n {locationSelect}\n </>\n )\n }\n\n return (\n <>\n {locationSelect}\n <Typography style={{ alignSelf: 'start' }}>{messages.signUpBirthdaySectionLabel}</Typography>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n />\n <TextField disabled={loading} label={messages.signUpDayInputLabel} id=\"birthday-date-input\" name=\"birthdayDate\" />\n </>\n )\n}\n\nconst northAmericanPhoneRegex = /^(\\()?[2-9]{1}\\d{2}(\\))?[-\\s.]?[2-9]{1}\\d{2}[-\\s.]?\\d{4}$/\nconst ukPhoneRegex = /^((\\+?44\\s?|0044\\s?)(\\s?\\d{3,5}|\\(\\d{3,5}\\))(\\s?\\d{3,4})(\\s?\\d{3,4})$|^07\\d{9}$)/\n\nconst validatePhoneNumber = (phone: string): boolean => {\n if (!phone) return false\n return northAmericanPhoneRegex.test(phone) || ukPhoneRegex.test(phone)\n}\n\nexport const FollowerAuthenticationForm = () => {\n const {\n state,\n messages,\n locationOptions,\n onActionButtonClick,\n loading,\n showV2,\n showSubscribeEmail,\n showSubscribeSms,\n } = useFollowerAuthenticationDialogContext()\n const classes = useStyles()\n\n // sign-up form state\n const formRef = useRef<HTMLFormElement>(null)\n const [formValidity, setFormValidity] = useState(false)\n const [showNameErrorText, setShowNameErrorText] = useState<boolean | undefined>()\n const [showPhoneErrorText, setShowPhoneErrorText] = useState<boolean | undefined>()\n const [showEmailErrorText, setShowEmailErrorText] = useState<boolean | undefined>()\n const [showLocationErrorText, setShowLocationErrorText] = useState<boolean | undefined>()\n const [signUpNameValue, setSignUpNameValue] = useState(state.context.name || '')\n const [signUpPhoneValue, setSignUpPhoneValue] = useState(state.context.phone || '')\n const [signUpEmailValue, setSignUpEmailValue] = useState(state.context.email || '')\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'name':\n const isNameValid = fieldValue.length > 0\n setSignUpNameValue(fieldValue)\n setShowNameErrorText(!isNameValid)\n break\n case 'phone':\n const isPhoneValid = validatePhoneNumber(fieldValue)\n setSignUpPhoneValue(fieldValue)\n setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0)\n break\n case 'email':\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setSignUpEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n case 'location':\n setShowLocationErrorText(!fieldValue)\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n setSignUpNameValue(state.context.name || '')\n setSignUpPhoneValue(state.context.phone || '')\n setSignUpEmailValue(state.context.email || '')\n }, [state.context.name, state.context.phone, state.context.email])\n\n useEffect(() => {\n // Validate pre-filled values (only in signUp state)\n if (state.value === 'signUp') {\n if (signUpPhoneValue) {\n const isPhoneValid = validatePhoneNumber(signUpPhoneValue)\n setShowPhoneErrorText(!isPhoneValid)\n }\n if (signUpEmailValue) {\n const emailField = formRef.current?.elements.namedItem('email') as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setShowEmailErrorText(!isEmailValid)\n }\n }\n\n const hasValidName = Boolean(signUpNameValue) && !showNameErrorText\n const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText\n const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText\n\n const locationField = formRef.current?.elements.namedItem('location') as HTMLInputElement\n const hasValidLocation = locationField ? Boolean(locationField.value) : true\n\n const hasValidContact = showV2 ? hasValidName && hasValidPhone && hasValidEmail : hasValidPhone || hasValidEmail\n setFormValidity(hasValidContact && hasValidLocation)\n }, [\n showV2,\n state.value,\n signUpPhoneValue,\n signUpEmailValue,\n showPhoneErrorText,\n showEmailErrorText,\n showLocationErrorText,\n signUpNameValue,\n showNameErrorText,\n ])\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const form = e.target as HTMLFormElement\n const formData = new FormData(form)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n if (state.value === 'signUp') {\n values.subscribeEmail = String(formData.has('subscribeEmail'))\n values.subscribeSms = String(formData.has('subscribeSms'))\n }\n onActionButtonClick('submit-form', values)\n }\n const formProps = {\n id: 'follower-authentication-form',\n className: classes.form,\n onSubmit: handleSubmit,\n }\n switch (state.value) {\n case 'initial':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.initialInputLabel}\n key=\"identifier-input\"\n id=\"identifier-input\"\n name=\"identifier\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.initialCtaButtonLabel}\n </Button>\n </form>\n )\n case 'signUp':\n return (\n <form\n ref={formRef}\n {...formProps}\n onInvalid={(e) => {\n e.preventDefault()\n }}\n >\n <TextField\n disabled={loading}\n label={messages.signUpPhoneInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n inputProps={{\n required: showV2 || !signUpEmailValue,\n }}\n defaultValue={state.context.phone}\n />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n key=\"name-input\"\n id=\"name-input\"\n name=\"name\"\n onChange={checkFieldValidity}\n error={showNameErrorText}\n inputProps={{ required: true }}\n defaultValue={state.context.name}\n />\n <TextField\n disabled={loading}\n label={messages.signUpEmailInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n onChange={checkFieldValidity}\n inputProps={{\n required: showV2 || !signUpPhoneValue,\n type: 'email',\n }}\n defaultValue={state.context.email}\n />\n <LocationAndBirthday\n checkFieldValidity={checkFieldValidity}\n classes={classes}\n loading={loading}\n locationOptions={locationOptions}\n messages={messages}\n showLocationErrorText={showLocationErrorText}\n showV2={showV2}\n />\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"flex-start\" gridGap={2} width=\"100%\">\n {showSubscribeEmail && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-email\" name=\"subscribeEmail\" disabled={loading} color=\"primary\" />}\n label={\n <Typography className={classes.checkboxLabel}>{messages.subscribeEmailCheckboxLabel}</Typography>\n }\n />\n )}\n {showSubscribeSms && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-sms\" name=\"subscribeSms\" disabled={loading} color=\"primary\" />}\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeSmsCheckboxLabel}</Typography>}\n />\n )}\n </Box>\n {showV2 && messages.privacyPolicyText && (\n <Typography className={classes.privacyPolicyText}>\n {messages.privacyPolicyText}\n <Button\n className={classes.privacyPolicyButton}\n onClick={() => onActionButtonClick('open-privacy-policy')}\n variant=\"text\"\n >\n {messages.privacyPolicyButtonLabel}\n </Button>\n </Typography>\n )}\n <Button disabled={loading || !formValidity} type=\"submit\">\n {messages.signUp}\n </Button>\n </form>\n )\n case 'emailFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.emailFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'emailAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailAuthCodeInputLabel}\n key=\"code-input\"\n id=\"code-input\"\n name=\"code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'indirectUserFound': {\n if (state.context.email) {\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n } else if (state.context.phone) {\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n } else return null\n }\n case 'emailPasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n key=\"email-input\"\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n key=\"password-input\"\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phoneFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.phoneFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'phoneAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneAuthCodeInputLabel}\n key=\"code-input\"\n id=\"code-input\"\n name=\"code\"\n autoComplete=\"one-time-code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phonePasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n key=\"password-input\"\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'requirePhone':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.requirePhoneInputLabel}\n key=\"phone-input\"\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.requirePhoneCtaButtonLabel}\n </Button>\n </form>\n )\n case 'welcome':\n return null\n default:\n return null\n }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACvC,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,WAAW;AAC5B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE,OAAO;AAClB,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,mBAAmB,EAAE;AACnB,QAAA,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC;AAC7B,QAAA,OAAO,EAAE,CAAC;AACV,QAAA,cAAc,EAAE,WAAW;AAC3B,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,iBAAiB,EAAE;AACjB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,SAAS,EAAE,QAAQ;AACpB,KAAA;AACF,CAAA,CAAC,CAAC;AAYH,SAAS,mBAAmB,CAAC,EAC3B,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,eAAe,EACf,QAAQ,EACR,qBAAqB,EACrB,MAAM,GACmB,EAAA;AACzB,IAAA,MAAM,cAAc,IAClB,oBAAC,SAAS,EAAA,EACR,QAAQ,EAAE,OAAO,EACjB,MAAM,QACN,QAAQ,EAA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"}
@@ -1 +1,2 @@
1
- export declare const FollowerAuthenticationGraphic: () => JSX.Element | null;
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationGraphic: () => React.JSX.Element | null;
@@ -3,12 +3,14 @@ import { useFollowerAuthenticationDialogContext } from './context.js';
3
3
  import { Box } from '@material-ui/core';
4
4
 
5
5
  const FollowerAuthenticationGraphic = () => {
6
- const { state, graphics } = useFollowerAuthenticationDialogContext();
6
+ const { state, graphics, showV2 } = useFollowerAuthenticationDialogContext();
7
+ if (showV2 && state.value === 'signUp')
8
+ return null;
7
9
  const graphic = graphics[state.value];
8
10
  if (!graphic)
9
11
  return null;
10
12
  return (React.createElement(Box, null,
11
- React.createElement("img", { src: graphic, alt: "" })));
13
+ React.createElement("img", { src: graphic, alt: "", style: showV2 ? { width: 95, height: 95 } : undefined })));
12
14
  };
13
15
 
14
16
  export { FollowerAuthenticationGraphic };
@@ -1 +1 @@
1
- {"version":3,"file":"FollowerAuthenticationGraphic.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box } from '@material-ui/core'\n\nexport const FollowerAuthenticationGraphic = () => {\n const { state, graphics } = useFollowerAuthenticationDialogContext()\n const graphic = graphics[state.value]\n if (!graphic) return null\n return (\n <Box>\n <img src={graphic} alt=\"\" />\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,6BAA6B,GAAG,MAAK;IAChD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,sCAAsC,EAAE;IACpE,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,IAAA,IAAI,CAAC,OAAO;AAAE,QAAA,OAAO,IAAI;IACzB,QACE,oBAAC,GAAG,EAAA,IAAA;QACF,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,EAAE,EAAA,CAAG,CACxB;AAEV;;;;"}
1
+ {"version":3,"file":"FollowerAuthenticationGraphic.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box } from '@material-ui/core'\n\nexport const FollowerAuthenticationGraphic = () => {\n const { state, graphics, showV2 } = useFollowerAuthenticationDialogContext()\n if (showV2 && state.value === 'signUp') return null\n\n const graphic = graphics[state.value]\n if (!graphic) return null\n return (\n <Box>\n <img src={graphic} alt=\"\" style={showV2 ? { width: 95, height: 95 } : undefined} />\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,6BAA6B,GAAG,MAAK;IAChD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,sCAAsC,EAAE;AAC5E,IAAA,IAAI,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAEnD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,IAAA,IAAI,CAAC,OAAO;AAAE,QAAA,OAAO,IAAI;IACzB,QACE,oBAAC,GAAG,EAAA,IAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,EAAE,EAAC,KAAK,EAAE,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,SAAS,EAAI,CAAA,CAC/E;AAEV;;;;"}
@@ -1 +1,2 @@
1
- export declare const FollowerAuthenticationInfo: () => JSX.Element | null;
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationInfo: () => React.JSX.Element | null;
@@ -3,12 +3,18 @@ import { useFollowerAuthenticationDialogContext } from './context.js';
3
3
  import { Box, Typography } from '@material-ui/core';
4
4
 
5
5
  const FollowerAuthenticationInfo = () => {
6
- const { state, messages } = useFollowerAuthenticationDialogContext();
6
+ const { state, messages, showV2 } = useFollowerAuthenticationDialogContext();
7
+ if (showV2 && state.value === 'signUp')
8
+ return null;
7
9
  const info = messages[`${state.value}Info`];
10
+ const last4Digits = state.context.phone?.slice(-4);
8
11
  if (!info)
9
12
  return null;
10
13
  return (React.createElement(Box, null,
11
- React.createElement(Typography, { align: "center" }, info)));
14
+ React.createElement(Typography, { align: "center" }, info),
15
+ showV2 && state.value === 'phoneAuthCode' && (React.createElement(Typography, { align: "center", variant: "h5", style: { marginTop: 16 } },
16
+ "***-***-",
17
+ last4Digits))));
12
18
  };
13
19
 
14
20
  export { FollowerAuthenticationInfo };
@@ -1 +1 @@
1
- {"version":3,"file":"FollowerAuthenticationInfo.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\n\nexport const FollowerAuthenticationInfo = () => {\n const { state, messages } = useFollowerAuthenticationDialogContext()\n const info = messages[`${state.value}Info` as MessageKey]\n\n if (!info) return null\n return (\n <Box>\n <Typography align=\"center\">{info}</Typography>\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,0BAA0B,GAAG,MAAK;IAC7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,sCAAsC,EAAE;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAA,EAAG,KAAK,CAAC,KAAK,CAAoB,IAAA,CAAA,CAAC;AAEzD,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,IAAI;IACtB,QACE,oBAAC,GAAG,EAAA,IAAA;QACF,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,KAAK,EAAC,QAAQ,IAAE,IAAI,CAAc,CAC1C;AAEV;;;;"}
1
+ {"version":3,"file":"FollowerAuthenticationInfo.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\n\nexport const FollowerAuthenticationInfo = () => {\n const { state, messages, showV2 } = useFollowerAuthenticationDialogContext()\n if (showV2 && state.value === 'signUp') return null\n\n const info = messages[`${state.value}Info` as MessageKey]\n const last4Digits = state.context.phone?.slice(-4)\n\n if (!info) return null\n return (\n <Box>\n <Typography align=\"center\">{info}</Typography>\n {showV2 && state.value === 'phoneAuthCode' && (\n <Typography align=\"center\" variant=\"h5\" style={{ marginTop: 16 }}>\n ***-***-{last4Digits}\n </Typography>\n )}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,0BAA0B,GAAG,MAAK;IAC7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,sCAAsC,EAAE;AAC5E,IAAA,IAAI,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAEnD,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAA,EAAG,KAAK,CAAC,KAAK,CAAoB,IAAA,CAAA,CAAC;AACzD,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;AAElD,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,IAAI;IACtB,QACE,oBAAC,GAAG,EAAA,IAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAA,EAAE,IAAI,CAAc;QAC7C,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe,KACxC,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAA;;AACrD,YAAA,WAAW,CACT,CACd,CACG;AAEV;;;;"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationLogoContainer: () => React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { makeStyles, Box } from '@material-ui/core';
3
+ import { useFollowerAuthenticationDialogContext } from './context.js';
4
+
5
+ const useStyles = makeStyles((theme) => ({
6
+ main: {
7
+ [theme.breakpoints.down('sm')]: {
8
+ display: 'none',
9
+ },
10
+ backgroundColor: theme.palette.common.white,
11
+ backgroundPosition: 'center top',
12
+ backgroundSize: 'cover',
13
+ height: '100%',
14
+ padding: theme.spacing(5),
15
+ width: '100%',
16
+ },
17
+ logo: {
18
+ maxWidth: '100%',
19
+ },
20
+ }));
21
+ const FollowerAuthenticationLogoContainer = () => {
22
+ const classes = useStyles();
23
+ const { logoUrl, signUpBackgroundImageUrl } = useFollowerAuthenticationDialogContext();
24
+ return (React.createElement(Box, { className: classes.main, style: {
25
+ backgroundImage: signUpBackgroundImageUrl ? `url(${JSON.stringify(signUpBackgroundImageUrl)})` : 'none',
26
+ } }, logoUrl && React.createElement("img", { alt: "", className: classes.logo, src: logoUrl })));
27
+ };
28
+
29
+ export { FollowerAuthenticationLogoContainer };
30
+ //# sourceMappingURL=FollowerAuthenticationLogoContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FollowerAuthenticationLogoContainer.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationLogoContainer.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, makeStyles } from '@material-ui/core'\nimport { useFollowerAuthenticationDialogContext } from './context'\n\nconst useStyles = makeStyles((theme) => ({\n main: {\n [theme.breakpoints.down('sm')]: {\n display: 'none',\n },\n backgroundColor: theme.palette.common.white,\n backgroundPosition: 'center top',\n backgroundSize: 'cover',\n height: '100%',\n padding: theme.spacing(5),\n width: '100%',\n },\n logo: {\n maxWidth: '100%',\n },\n}))\n\nexport const FollowerAuthenticationLogoContainer = () => {\n const classes = useStyles()\n const { logoUrl, signUpBackgroundImageUrl } = useFollowerAuthenticationDialogContext()\n\n return (\n <Box\n className={classes.main}\n style={{\n backgroundImage: signUpBackgroundImageUrl ? `url(${JSON.stringify(signUpBackgroundImageUrl)})` : 'none',\n }}\n >\n {logoUrl && <img alt=\"\" className={classes.logo} src={logoUrl} />}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;AAIA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACvC,IAAA,IAAI,EAAE;QACJ,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAA,OAAO,EAAE,MAAM;AAChB,SAAA;AACD,QAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;AAC3C,QAAA,kBAAkB,EAAE,YAAY;AAChC,QAAA,cAAc,EAAE,OAAO;AACvB,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,EAAE,MAAM;AACjB,KAAA;AACF,CAAA,CAAC,CAAC;AAEI,MAAM,mCAAmC,GAAG,MAAK;AACtD,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;IAC3B,MAAM,EAAE,OAAO,EAAE,wBAAwB,EAAE,GAAG,sCAAsC,EAAE;IAEtF,QACE,KAAC,CAAA,aAAA,CAAA,GAAG,EACF,EAAA,SAAS,EAAE,OAAO,CAAC,IAAI,EACvB,KAAK,EAAE;AACL,YAAA,eAAe,EAAE,wBAAwB,GAAG,OAAO,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAA,CAAA,CAAG,GAAG,MAAM;AACxG,SAAA,EAAA,EAEA,OAAO,IAAI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAC,EAAE,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAI,CAAA,CAC7D;AAEV;;;;"}
@@ -1 +1,2 @@
1
- export declare const FollowerAuthenticationTitle: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationTitle: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FollowerAuthenticationVipBenefitRows: () => React.JSX.Element | null;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { useFollowerAuthenticationDialogContext } from './context.js';
3
+ import { makeStyles, Box } from '@material-ui/core';
4
+ import { Icon } from '../Icon/Icon.js';
5
+ import { Typography } from '../Typography/Typography.js';
6
+
7
+ const useStyles = makeStyles((theme) => ({
8
+ main: {
9
+ display: 'flex',
10
+ flexDirection: 'column',
11
+ gridGap: theme.spacing(1.5),
12
+ width: '100%',
13
+ },
14
+ vipBenefitRows: {
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ flexDirection: 'row',
18
+ gridGap: theme.spacing(2),
19
+ },
20
+ }));
21
+ const FollowerAuthenticationVipBenefitRows = () => {
22
+ const classes = useStyles();
23
+ const { vipBenefitRows, showV2, state } = useFollowerAuthenticationDialogContext();
24
+ const isInitialOrSignUpState = state.value === 'initial' || state.value === 'signUp';
25
+ if (!showV2 || !vipBenefitRows || !isInitialOrSignUpState)
26
+ return null;
27
+ return (React.createElement(Box, { className: classes.main }, vipBenefitRows.map((row, index) => (React.createElement(Box, { key: index, className: classes.vipBenefitRows },
28
+ React.createElement(Icon, { icon: row.icon, size: "large", "aria-hidden": "true" }),
29
+ React.createElement(Typography, null, row.text))))));
30
+ };
31
+
32
+ export { FollowerAuthenticationVipBenefitRows };
33
+ //# sourceMappingURL=FollowerAuthenticationVipBenefitRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FollowerAuthenticationVipBenefitRows.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationVipBenefitRows.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, makeStyles } from '@material-ui/core'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n\nconst useStyles = makeStyles((theme) => ({\n main: {\n display: 'flex',\n flexDirection: 'column',\n gridGap: theme.spacing(1.5),\n width: '100%',\n },\n vipBenefitRows: {\n display: 'flex',\n alignItems: 'center',\n flexDirection: 'row',\n gridGap: theme.spacing(2),\n },\n}))\n\nexport const FollowerAuthenticationVipBenefitRows = () => {\n const classes = useStyles()\n const { vipBenefitRows, showV2, state } = useFollowerAuthenticationDialogContext()\n const isInitialOrSignUpState = state.value === 'initial' || state.value === 'signUp'\n\n if (!showV2 || !vipBenefitRows || !isInitialOrSignUpState) return null\n\n return (\n <Box className={classes.main}>\n {vipBenefitRows.map((row, index) => (\n <Box key={index} className={classes.vipBenefitRows}>\n <Icon icon={row.icon} size=\"large\" aria-hidden=\"true\" />\n <Typography>{row.text}</Typography>\n </Box>\n ))}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACvC,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AAC3B,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,cAAc,EAAE;AACd,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,aAAa,EAAE,KAAK;AACpB,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1B,KAAA;AACF,CAAA,CAAC,CAAC;AAEI,MAAM,oCAAoC,GAAG,MAAK;AACvD,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;IAC3B,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,sCAAsC,EAAE;AAClF,IAAA,MAAM,sBAAsB,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AAEpF,IAAA,IAAI,CAAC,MAAM,IAAI,CAAC,cAAc,IAAI,CAAC,sBAAsB;AAAE,QAAA,OAAO,IAAI;AAEtE,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EACzB,EAAA,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MAC7B,oBAAC,GAAG,EAAA,EAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,cAAc,EAAA;AAChD,QAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAC,OAAO,EAAA,aAAA,EAAa,MAAM,EAAG,CAAA;QACxD,KAAC,CAAA,aAAA,CAAA,UAAU,EAAE,IAAA,EAAA,GAAG,CAAC,IAAI,CAAc,CAC/B,CACP,CAAC,CACE;AAEV;;;;"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { IconButtonProps } from './IconButtonProps';
3
- export declare const IconButton: React.ForwardRefExoticComponent<Pick<IconButtonProps, "color" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "size" | "translate" | "hidden" | "disabled" | "form" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "value" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "action" | "disableFocusRipple" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "edge" | keyof import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core").IconButtonTypeMap<{}, "button">>> & React.RefAttributes<HTMLButtonElement>>;
3
+ export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;