tf-checkout-react 1.3.37 → 1.3.38-beta.2

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.37",
2
+ "version": "1.3.38-beta.2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/.DS_Store CHANGED
Binary file
Binary file
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable react/no-unescaped-entities */
2
2
  import './style.css'
3
3
 
4
+ import Modal from '@mui/material/Modal'
4
5
  import { AxiosError } from 'axios'
5
6
  import _get from 'lodash/get'
6
7
  import _map from 'lodash/map'
@@ -8,8 +9,8 @@ import React, { useEffect, useRef, useState } from 'react'
8
9
 
9
10
  import { getConfirmationData } from '../../api'
10
11
  import { IReferralPromotion } from '../../types'
11
- import SocialButtons from './social-buttons'
12
12
  import { createMarkup } from '../../utils'
13
+ import SocialButtons from './social-buttons'
13
14
 
14
15
  export interface IShareButton {
15
16
  mainLabel: string;
@@ -101,6 +102,12 @@ export const ConfirmationContainer = ({
101
102
  })()
102
103
  }, [])
103
104
 
105
+ const [showCopyModal, setShowCopyModal] = useState(false)
106
+
107
+ const onClose = () => {
108
+ setShowCopyModal(false)
109
+ }
110
+
104
111
  const onChangeShareLink = (e: React.ChangeEvent<HTMLInputElement>) => {
105
112
  const newData = { ...data, personal_share_link: e.target.value }
106
113
  setData(newData)
@@ -112,11 +119,28 @@ export const ConfirmationContainer = ({
112
119
  } = confirmationLabels
113
120
  return (
114
121
  <div className="confirmation-page">
122
+ <Modal
123
+ open={showCopyModal}
124
+ onClose={onClose}
125
+ aria-labelledby="modal-modal-title"
126
+ aria-describedby="modal-modal-description"
127
+ className="success-copy-modal"
128
+ >
129
+ <div className='message-copy-success-box'>
130
+ <div className='message-copy-success'>
131
+ <span>{"Copied to your clipboard! Now paste your link in a Snapchat message, "}</span>
132
+ <span>{"your Instagram bio, Whatsapp, Facebook or a text :)"}</span>
133
+ </div>
134
+ <div className="footer">
135
+ <button className='footer-button' type='button' onClick={onClose}>OK</button>
136
+ </div>
137
+ </div>
138
+ </Modal>
115
139
  {data && (
116
140
  <>
117
141
  <div className='header-container'>
118
142
  <div className='header-product-image'>
119
- <img className='product-image' src={data.product_image}/>
143
+ <img alt='' className='product-image' src={data.product_image}/>
120
144
  </div>
121
145
  <div className="header-product-text">
122
146
  <p className="title">{ confirmationTitle }</p>
@@ -194,6 +218,7 @@ export const ConfirmationContainer = ({
194
218
  navigator.clipboard.writeText(
195
219
  _get(inputRef, 'current.value')
196
220
  )
221
+ setShowCopyModal(true)
197
222
  onLinkCopied()
198
223
  }}
199
224
  >
@@ -235,6 +260,9 @@ export const ConfirmationContainer = ({
235
260
  </div>
236
261
  </div>
237
262
  ))}
263
+ <div className='note-pricing-section'>
264
+ ^ This is based on the most expensive ticket in your order.
265
+ </div>
238
266
  </div>
239
267
  </div>
240
268
  </>
@@ -1,11 +1,12 @@
1
- import React from 'react';
2
- import { IShareButton } from'./index'
1
+ import React from 'react'
2
+
3
3
  import config from './config'
4
+ import { IShareButton } from'./index'
4
5
 
5
6
  const SocialComponent = ({ mainLabel, subLabel, platform, shareData }: IShareButton) => {
6
7
  const Component = config(platform)?.component
7
8
  const Icon = config(platform)?.icon
8
-
9
+
9
10
  return (
10
11
  <>
11
12
  {Component && (
@@ -30,11 +31,10 @@ interface SocialButtonsTypes {
30
31
  name: string;
31
32
  appId: string;
32
33
  showDefaultShareButtons: boolean;
33
- shareButtons: IShareButton[]
34
+ shareButtons: IShareButton[];
34
35
  }
35
36
 
36
- const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => {
37
- return (
37
+ const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => (
38
38
  <>
39
39
  <div className="convenient_buttons">
40
40
  or use one of these convenient buttons:
@@ -65,7 +65,7 @@ const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareB
65
65
  subLabel='Facebook'
66
66
  platform='messenger'
67
67
  shareData={{
68
- appId: appId,
68
+ appId,
69
69
  url: shareLink
70
70
  }}
71
71
  />
@@ -87,8 +87,11 @@ const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareB
87
87
  {(showDefaultShareButtons || shareButtons.length) && (
88
88
  <p>We <strong>never</strong> post on Facebook without your permission!</p>
89
89
  )}
90
+ <p className='note-message'>
91
+ <span>*Please note, only purchases made from a different Ticket Fairy account can count towards your referrals</span>
92
+ <span> so please make sure you ask your friends to buy their own tickets using their own Ticket Fairy account!</span>
93
+ </p>
90
94
  </>
91
95
  )
92
- }
93
96
 
94
97
  export default SocialButtons
@@ -594,7 +594,7 @@ export const TicketsContainer = ({
594
594
  />
595
595
  ) : null}
596
596
  {showWaitingList && event.salesStarted && !hideWaitingList && (
597
- <WaitingList tickets={tickets} eventId={eventId} />
597
+ <WaitingList tickets={tickets} eventId={eventId} defaultMaxQuantity={event.waitingListMaxQuantity} />
598
598
  )}
599
599
  {codeIsLoading ? (
600
600
  <Loader />
@@ -16,6 +16,7 @@ import './style.css'
16
16
  interface WaitingListProps {
17
17
  tickets: any;
18
18
  eventId: number;
19
+ defaultMaxQuantity: number;
19
20
  }
20
21
 
21
22
  interface WaitingListFields {
@@ -34,7 +35,7 @@ const generateQuantity = (n: number) => {
34
35
  return quantityList
35
36
  }
36
37
 
37
- const WaitingList = ({ tickets = {}, eventId }: WaitingListProps) => {
38
+ const WaitingList = ({ tickets = {}, eventId, defaultMaxQuantity = 10 }: WaitingListProps) => {
38
39
  const isWindowDefined = typeof window !== 'undefined'
39
40
  const userData =
40
41
  isWindowDefined && window.localStorage.getItem('user_data')
@@ -117,7 +118,7 @@ const WaitingList = ({ tickets = {}, eventId }: WaitingListProps) => {
117
118
  value: '',
118
119
  disabled: true,
119
120
  },
120
- ...generateQuantity(10),
121
+ ...generateQuantity(defaultMaxQuantity ?? 10),
121
122
  ]}
122
123
  />
123
124
  </div>
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- exports.__esModule = true;
50
- exports.PhoneNumberField = void 0;
51
- var TextField_1 = require("@mui/material/TextField");
52
- var debounce_1 = require("lodash/debounce");
53
- var get_1 = require("lodash/get");
54
- var react_1 = require("react");
55
- var api_1 = require("../../api");
56
- exports.PhoneNumberField = function (_a) {
57
- var label = _a.label, _b = _a.type, type = _b === void 0 ? 'text' : _b, field = _a.field, _c = _a.form, errors = _c.errors, setFieldError = _c.setFieldError, setStatus = _c.setStatus;
58
- var error = get_1["default"](errors, field.name);
59
- // eslint-disable-next-line react-hooks/exhaustive-deps
60
- var debounceCb = react_1.useCallback(debounce_1["default"](function (cb) { return void cb(); }, 1000), []);
61
- react_1.useEffect(function () {
62
- var _a;
63
- if (field.value) {
64
- setStatus((_a = {}, _a[field.name] = true, _a));
65
- }
66
- debounceCb(function () { return __awaiter(void 0, void 0, void 0, function () {
67
- var error_1, message;
68
- var _a;
69
- return __generator(this, function (_b) {
70
- switch (_b.label) {
71
- case 0:
72
- _b.trys.push([0, 3, 4, 5]);
73
- if (!field.value) return [3 /*break*/, 2];
74
- return [4 /*yield*/, api_1.validatePhoneNumber(field.value)];
75
- case 1:
76
- _b.sent();
77
- _b.label = 2;
78
- case 2:
79
- setFieldError(field.name, '');
80
- return [3 /*break*/, 5];
81
- case 3:
82
- error_1 = _b.sent();
83
- message = get_1["default"](error_1, 'response.data.message', 'Invalid phone number');
84
- setFieldError(field.name, message);
85
- return [3 /*break*/, 5];
86
- case 4:
87
- setStatus((_a = {}, _a[field.name] = false, _a));
88
- return [7 /*endfinally*/];
89
- case 5: return [2 /*return*/];
90
- }
91
- });
92
- }); });
93
- // eslint-disable-next-line
94
- }, [field.value]);
95
- return (react_1["default"].createElement(TextField_1["default"], __assign({}, field, { id: field.name, label: label, type: type, fullWidth: true, error: !!error, helperText: error, value: field.value || '', inputProps: { pattern: '[+0-9]/d+' } })));
96
- };