@cuemath/leap 3.3.21 → 3.3.23-link.0
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/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +42 -40
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +70 -64
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +54 -29
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +48 -28
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +79 -76
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +97 -94
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +160 -143
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +22 -12
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +64 -59
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-container.js +17 -15
- package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +170 -153
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +19 -17
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/parent-dashboard/api/cancel-subscription.js +9 -0
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +20 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +96 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +40 -34
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +21 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +80 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +23 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +55 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +59 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +93 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +1 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +63 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +1 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +65 -0
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +161 -138
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +86 -78
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +2 -3
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellation-reason-constant.js","sources":["../../../../../src/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.ts"],"sourcesContent":["export const cancellationReasonNoTutor = {\n title: 'We’re sorry to see you go!',\n description: 'Tell us why youʼre canceling.',\n reasons: [\n { id: 'Looking for more affordable options', label: 'Looking for more affordable options' },\n { id: 'Taking too long to find a tutor match', label: 'Taking too long to find a tutor match' },\n { id: 'I found a better option elsewhere', label: 'I found a better option elsewhere' },\n { id: 'I donʼt have the right device/ setup', label: 'I donʼt have the right device/ setup' },\n {\n id: 'No longer interested in online tutoring',\n label: 'No longer interested in online tutoring',\n },\n { id: 'other', label: 'Something else' },\n ],\n};\n\nexport const cancellationReasonWithTutor = {\n title: 'We’re sorry to see you go!',\n description: 'Tell us why youʼre canceling.',\n reasons: [\n {\n id: 'The tutor doesnʼt seem like a good fit',\n label: 'The tutor doesnʼt seem like a good fit',\n },\n { id: 'Looking for more affordable options', label: 'Looking for more affordable options' },\n { id: 'Taking too long to find a tutor match', label: 'Taking too long to find a tutor match' },\n { id: 'I found a better option elsewhere', label: 'I found a better option elsewhere' },\n {\n id: 'No longer interested in online tutoring',\n label: 'No longer interested in online tutoring',\n },\n { id: 'I donʼt have the right device/ setup', label: 'I donʼt have the right device/ setup' },\n { id: 'other', label: 'Something else' },\n ],\n};\n\nexport const cancellationReasonAfterTrial = {\n title: 'We’re sorry to see you go!',\n description: 'Tell us why youʼre canceling.',\n reasons: [\n { id: 'Looking for more affordable options', label: 'Looking for more affordable options' },\n { id: 'I found a better option elsewhere', label: 'I found a better option elsewhere' },\n {\n id: 'No longer interested in online tutoring',\n label: 'No longer interested in online tutoring',\n },\n {\n id: 'I want to try other options first',\n label: 'I want to try other options first',\n },\n { id: 'other', label: 'Something else' },\n ],\n};\n"],"names":["cancellationReasonNoTutor","cancellationReasonWithTutor","cancellationReasonAfterTrial"],"mappings":"AAAO,MAAMA,IAA4B;AAAA,EACvC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACP,EAAE,IAAI,uCAAuC,OAAO,sCAAsC;AAAA,IAC1F,EAAE,IAAI,yCAAyC,OAAO,wCAAwC;AAAA,IAC9F,EAAE,IAAI,qCAAqC,OAAO,oCAAoC;AAAA,IACtF,EAAE,IAAI,wCAAwC,OAAO,uCAAuC;AAAA,IAC5F;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA,EAAE,IAAI,SAAS,OAAO,iBAAiB;AAAA,EACzC;AACF,GAEaC,IAA8B;AAAA,EACzC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACP;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA,EAAE,IAAI,uCAAuC,OAAO,sCAAsC;AAAA,IAC1F,EAAE,IAAI,yCAAyC,OAAO,wCAAwC;AAAA,IAC9F,EAAE,IAAI,qCAAqC,OAAO,oCAAoC;AAAA,IACtF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA,EAAE,IAAI,wCAAwC,OAAO,uCAAuC;AAAA,IAC5F,EAAE,IAAI,SAAS,OAAO,iBAAiB;AAAA,EACzC;AACF,GAEaC,IAA+B;AAAA,EAC1C,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACP,EAAE,IAAI,uCAAuC,OAAO,sCAAsC;AAAA,IAC1F,EAAE,IAAI,qCAAqC,OAAO,oCAAoC;AAAA,IACtF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA,EAAE,IAAI,SAAS,OAAO,iBAAiB;AAAA,EACzC;AACF;"}
|
package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import t from "../../../ui/layout/flex-view.js";
|
|
3
|
+
const s = o(t)`
|
|
4
|
+
max-width: 560px;
|
|
5
|
+
border: ${({ theme: e }) => `1px solid ${e.colors.BLACK_5}`};
|
|
6
|
+
`, x = o(t)`
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
max-height: 468px;
|
|
9
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
10
|
+
max-height: unset;
|
|
11
|
+
overflow-y: hidden;
|
|
12
|
+
}
|
|
13
|
+
`, h = o(t)`
|
|
14
|
+
padding-top: 0;
|
|
15
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
16
|
+
max-height: 300px;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
}
|
|
19
|
+
`, m = o(t)`
|
|
20
|
+
padding-bottom: 24px;
|
|
21
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
22
|
+
border-top: ${({ theme: e }) => `1px solid ${e.colors.BLACK_5}`};
|
|
23
|
+
padding-bottom: 40px;
|
|
24
|
+
}
|
|
25
|
+
`, c = o.textarea(({ theme: e }) => {
|
|
26
|
+
const {
|
|
27
|
+
colors: { WHITE: i, WHITE_T_38: r, BLACK_2: n, BLACK_5: a },
|
|
28
|
+
layout: { gutter: p }
|
|
29
|
+
} = e;
|
|
30
|
+
return `border: 1px solid ${a};
|
|
31
|
+
width: 100%;
|
|
32
|
+
min-height: ${p * 5}px;
|
|
33
|
+
padding: 16px;
|
|
34
|
+
background-color: ${n};
|
|
35
|
+
white-space: pre-line;
|
|
36
|
+
font-family: 'Untitled Sans Regular';
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
line-height: 24px;
|
|
40
|
+
color: ${i};
|
|
41
|
+
resize: none;
|
|
42
|
+
outline: none;
|
|
43
|
+
&::placeholder {
|
|
44
|
+
color: ${r};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:focus {
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
s as Container,
|
|
54
|
+
h as ContentWrapper,
|
|
55
|
+
m as FooterWrapper,
|
|
56
|
+
x as OuterWrapper,
|
|
57
|
+
c as StyledTextArea
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=cancellation-reason-styled.js.map
|
package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellation-reason-styled.js","sources":["../../../../../src/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Container = styled(FlexView)`\n max-width: 560px;\n border: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n`;\n\nexport const OuterWrapper = styled(FlexView)`\n overflow-y: auto;\n max-height: 468px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: unset;\n overflow-y: hidden;\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)`\n padding-top: 0;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: 300px;\n overflow-y: auto;\n }\n`;\n\nexport const FooterWrapper = styled(FlexView)`\n padding-bottom: 24px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n border-top: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n padding-bottom: 40px;\n }\n`;\n\nexport const StyledTextArea = styled.textarea(({ theme }) => {\n const {\n colors: { WHITE, WHITE_T_38, BLACK_2, BLACK_5 },\n layout: { gutter },\n } = theme;\n\n return `border: 1px solid ${BLACK_5};\n width: 100%;\n min-height: ${gutter * 5}px;\n padding: 16px;\n background-color: ${BLACK_2};\n white-space: pre-line;\n font-family: 'Untitled Sans Regular';\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ${WHITE};\n resize: none;\n outline: none;\n &::placeholder {\n color: ${WHITE_T_38};\n }\n\n &:focus {\n outline: none;\n }\n`;\n});\n"],"names":["Container","styled","FlexView","theme","OuterWrapper","ContentWrapper","FooterWrapper","StyledTextArea","WHITE","WHITE_T_38","BLACK_2","BLACK_5","gutter"],"mappings":";;AAIa,MAAAA,IAAYC,EAAOC,CAAQ;AAAA;AAAA,YAE5B,CAAC,EAAE,OAAAC,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA,GAGjDC,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCE,IAAiBJ,EAAOC,CAAQ;AAAA;AAAA,IAEzC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCG,IAAgBL,EAAOC,CAAQ;AAAA;AAAA,IAExC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA,kBAClC,CAAC,EAAE,OAAAA,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA;AAAA;AAAA,GAKvDI,IAAiBN,EAAO,SAAS,CAAC,EAAE,OAAAE,QAAY;AACrD,QAAA;AAAA,IACJ,QAAQ,EAAE,OAAAK,GAAO,YAAAC,GAAY,SAAAC,GAAS,SAAAC,EAAQ;AAAA,IAC9C,QAAQ,EAAE,QAAAC,EAAO;AAAA,EACf,IAAAT;AAEJ,SAAO,qBAAqBQ,CAAO;AAAA;AAAA,gBAErBC,IAAS,CAAC;AAAA;AAAA,sBAEJF,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMlBF,CAAK;AAAA;AAAA;AAAA;AAAA,aAIHC,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,CAAC;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useState as f, useRef as W, useMemo as I, useCallback as c, useEffect as k } from "react";
|
|
3
|
+
import { useTheme as v } from "styled-components";
|
|
4
|
+
import B from "../../../auth/comps/pill-button/pill-button.js";
|
|
5
|
+
import h from "../../../ui/buttons/text-button/text-button.js";
|
|
6
|
+
import y from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import D from "../../../ui/modals/use-modal-actions.js";
|
|
8
|
+
import F from "../../../ui/modals/use-modal-params.js";
|
|
9
|
+
import G from "../../../ui/separator/separator.js";
|
|
10
|
+
import $ from "../../../ui/text/text.js";
|
|
11
|
+
import { EDeviceType as H } from "../../../ui/theme/constants.js";
|
|
12
|
+
import { cancellationReasonAfterTrial as L, cancellationReasonWithTutor as _, cancellationReasonNoTutor as j } from "./cancellation-reason-constant.js";
|
|
13
|
+
import { Container as K, OuterWrapper as N, ContentWrapper as P, StyledTextArea as V, FooterWrapper as q } from "./cancellation-reason-styled.js";
|
|
14
|
+
const z = E(() => {
|
|
15
|
+
const { withTutor: m, completedSessions: u, onCancel: d } = F(), { closeModal: b } = D(), [l, C] = f(""), [a, x] = f(""), s = W(null), { device: R } = v(), r = R <= H.MOBILE, g = I(() => u > 0 ? L : m ? _ : j, [u, m]), { title: T, description: p, reasons: A } = g, X = c((e) => C(e), []), M = c((e) => {
|
|
16
|
+
x(e.target.value);
|
|
17
|
+
}, []), t = l === "other", O = !l || t && !a.trim(), S = c(() => {
|
|
18
|
+
d(t ? a : l);
|
|
19
|
+
}, [d, t, a, l]);
|
|
20
|
+
return k(() => {
|
|
21
|
+
var e, i;
|
|
22
|
+
t && s.current && ((e = s.current) == null || e.focus(), (i = s.current) == null || i.scrollIntoView({ behavior: "smooth" }));
|
|
23
|
+
}, [t]), /* @__PURE__ */ n(K, { $background: "BLACK_2", $width: "100%", $borderColor: "BLACK_5", children: [
|
|
24
|
+
/* @__PURE__ */ n(N, { $flex: 1, children: [
|
|
25
|
+
/* @__PURE__ */ n(y, { $gutterX: r ? 1 : 2.5, $gapX: r ? 1.5 : 2.5, children: [
|
|
26
|
+
/* @__PURE__ */ o($, { $renderAs: "ah4-bold", $renderOnMobileAs: "ab1-bold", $color: "WHITE", children: T }),
|
|
27
|
+
p ? /* @__PURE__ */ n(w, { children: [
|
|
28
|
+
/* @__PURE__ */ o(G, { heightX: 0.25 }),
|
|
29
|
+
/* @__PURE__ */ o($, { $renderAs: "ub2", $renderOnMobileAs: "ub3", $color: "WHITE", children: p })
|
|
30
|
+
] }) : null
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ n(
|
|
33
|
+
P,
|
|
34
|
+
{
|
|
35
|
+
$flex: 1,
|
|
36
|
+
$gutterX: r ? 1 : 2.5,
|
|
37
|
+
$gapX: r ? 1 : 2.5,
|
|
38
|
+
$width: "100%",
|
|
39
|
+
$alignItems: "flex-start",
|
|
40
|
+
$flexRowGapX: 1,
|
|
41
|
+
children: [
|
|
42
|
+
A.map(({ id: e, label: i }) => /* @__PURE__ */ o(
|
|
43
|
+
B,
|
|
44
|
+
{
|
|
45
|
+
selected: l === e,
|
|
46
|
+
label: i,
|
|
47
|
+
id: e,
|
|
48
|
+
onClick: X,
|
|
49
|
+
isTransparent: !0
|
|
50
|
+
},
|
|
51
|
+
e
|
|
52
|
+
)),
|
|
53
|
+
t && /* @__PURE__ */ o(
|
|
54
|
+
V,
|
|
55
|
+
{
|
|
56
|
+
placeholder: "Tell us more about your experience...",
|
|
57
|
+
id: "text-area",
|
|
58
|
+
ref: s,
|
|
59
|
+
value: a,
|
|
60
|
+
onChange: M
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ n(
|
|
68
|
+
q,
|
|
69
|
+
{
|
|
70
|
+
$gutterX: r ? 1 : 2.5,
|
|
71
|
+
$gapX: r ? 1 : 2.5,
|
|
72
|
+
$flexDirection: "row",
|
|
73
|
+
$flexColumnGapX: 1.5,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ o(
|
|
76
|
+
h,
|
|
77
|
+
{
|
|
78
|
+
label: "Cancel Subscription",
|
|
79
|
+
onClick: S,
|
|
80
|
+
color: "ORANGE_4",
|
|
81
|
+
disabled: O
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ o(h, { label: "Close", onClick: b, color: "WHITE" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] });
|
|
89
|
+
}), ie = z;
|
|
90
|
+
export {
|
|
91
|
+
ie as default
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=cancellation-reason.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellation-reason.js","sources":["../../../../../src/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.tsx"],"sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport PillButton from '../../../auth/comps/pill-button/pill-button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useModalActions from '../../../ui/modals/use-modal-actions';\nimport useModalParams from '../../../ui/modals/use-modal-params';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport {\n cancellationReasonAfterTrial,\n cancellationReasonNoTutor,\n cancellationReasonWithTutor,\n} from './cancellation-reason-constant';\nimport * as Styled from './cancellation-reason-styled';\n\ninterface ICancelSubscriptionProps {\n withTutor: boolean;\n completedSessions: number;\n onCancel: (reason: string) => void;\n}\n\nconst CancellationReason = memo(() => {\n const { withTutor, completedSessions, onCancel } = useModalParams<ICancelSubscriptionProps>();\n const { closeModal } = useModalActions();\n\n const [reason, setReason] = useState('');\n const [otherReason, setOtherReason] = useState('');\n\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const config = useMemo(() => {\n if (completedSessions > 0) return cancellationReasonAfterTrial;\n\n return withTutor ? cancellationReasonWithTutor : cancellationReasonNoTutor;\n }, [completedSessions, withTutor]);\n const { title, description, reasons } = config;\n\n const handleSelectReason = useCallback((id: string) => setReason(id), []);\n\n const handleOtherReasonChange = useCallback((event: ChangeEvent<HTMLTextAreaElement>) => {\n setOtherReason(event.target.value);\n }, []);\n\n const isOtherReasonSelected = reason === 'other';\n const isSubmitDisabled = !reason || (isOtherReasonSelected && !otherReason.trim());\n\n const handleCancel = useCallback(() => {\n onCancel(isOtherReasonSelected ? otherReason : reason);\n }, [onCancel, isOtherReasonSelected, otherReason, reason]);\n\n useEffect(() => {\n if (isOtherReasonSelected && textAreaRef.current) {\n textAreaRef.current?.focus();\n textAreaRef.current?.scrollIntoView({ behavior: 'smooth' });\n }\n }, [isOtherReasonSelected]);\n\n return (\n <Styled.Container $background=\"BLACK_2\" $width=\"100%\" $borderColor=\"BLACK_5\">\n <Styled.OuterWrapper $flex={1}>\n <FlexView $gutterX={isMobile ? 1 : 2.5} $gapX={isMobile ? 1.5 : 2.5}>\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n {title}\n </Text>\n {description ? (\n <>\n <Separator heightX={0.25} />\n <Text $renderAs=\"ub2\" $renderOnMobileAs=\"ub3\" $color=\"WHITE\">\n {description}\n </Text>\n </>\n ) : null}\n </FlexView>\n <Styled.ContentWrapper\n $flex={1}\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $width={'100%'}\n $alignItems=\"flex-start\"\n $flexRowGapX={1}\n >\n {reasons.map(({ id, label }) => (\n <PillButton\n selected={reason === id}\n key={id}\n label={label}\n id={id}\n onClick={handleSelectReason}\n isTransparent\n />\n ))}\n {isOtherReasonSelected && (\n <Styled.StyledTextArea\n placeholder=\"Tell us more about your experience...\"\n id=\"text-area\"\n ref={textAreaRef}\n value={otherReason}\n onChange={handleOtherReasonChange}\n />\n )}\n </Styled.ContentWrapper>\n </Styled.OuterWrapper>\n <Styled.FooterWrapper\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $flexDirection=\"row\"\n $flexColumnGapX={1.5}\n >\n <TextButton\n label=\"Cancel Subscription\"\n onClick={handleCancel}\n color=\"ORANGE_4\"\n disabled={isSubmitDisabled}\n />\n\n <TextButton label=\"Close\" onClick={closeModal} color=\"WHITE\" />\n </Styled.FooterWrapper>\n </Styled.Container>\n );\n});\n\nexport default CancellationReason;\n"],"names":["CancellationReason","memo","withTutor","completedSessions","onCancel","useModalParams","closeModal","useModalActions","reason","setReason","useState","otherReason","setOtherReason","textAreaRef","useRef","device","useTheme","isMobile","EDeviceType","config","useMemo","cancellationReasonAfterTrial","cancellationReasonWithTutor","cancellationReasonNoTutor","title","description","reasons","handleSelectReason","useCallback","id","handleOtherReasonChange","event","isOtherReasonSelected","isSubmitDisabled","handleCancel","useEffect","_a","_b","jsxs","Styled.Container","Styled.OuterWrapper","FlexView","jsx","Text","Fragment","Separator","Styled.ContentWrapper","label","PillButton","Styled.StyledTextArea","Styled.FooterWrapper","TextButton","CancellationReason$1"],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useCallback as o, useMemo as M } from "react";
|
|
2
|
+
import P from "../../../ui/modals/use-modal-actions.js";
|
|
3
|
+
import { useCancelSubscriptionPatch as y } from "../../api/cancel-subscription.js";
|
|
4
|
+
import { invalidateParentHome as v } from "../../api/parent-home.js";
|
|
5
|
+
const A = ({
|
|
6
|
+
studentId: c,
|
|
7
|
+
demoId: a,
|
|
8
|
+
withTutor: e,
|
|
9
|
+
billingDetails: b,
|
|
10
|
+
completedSessions: t,
|
|
11
|
+
onRescheduleDemo: r,
|
|
12
|
+
onChangeTutor: p
|
|
13
|
+
}) => {
|
|
14
|
+
const { openModal: n } = P(), { payment_method_details: s } = b ?? {}, f = o(() => {
|
|
15
|
+
v(c), n("pla-cancellation-confirmation");
|
|
16
|
+
}, [n, c]), { patch: m } = y({
|
|
17
|
+
onComplete: f
|
|
18
|
+
}), C = o(
|
|
19
|
+
(l) => {
|
|
20
|
+
l && m(c, {
|
|
21
|
+
reason: l,
|
|
22
|
+
student_demo_id: a
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
[m, c, a]
|
|
26
|
+
), h = o(() => n("pla-cancellation-reason", {
|
|
27
|
+
withTutor: e,
|
|
28
|
+
completedSessions: t,
|
|
29
|
+
onCancel: (l) => C(l)
|
|
30
|
+
}), [t, C, n, e]), i = o(() => {
|
|
31
|
+
n("pla-cancel-subscription", {
|
|
32
|
+
withTutor: e,
|
|
33
|
+
completedSessions: t,
|
|
34
|
+
onSwitchTutor: () => a ? p(a) : void 0,
|
|
35
|
+
onReschedule: () => a ? r(a) : void 0,
|
|
36
|
+
onCancel: h
|
|
37
|
+
});
|
|
38
|
+
}, [
|
|
39
|
+
t,
|
|
40
|
+
a,
|
|
41
|
+
h,
|
|
42
|
+
p,
|
|
43
|
+
r,
|
|
44
|
+
n,
|
|
45
|
+
e
|
|
46
|
+
]), u = o(() => {
|
|
47
|
+
n("pla-view-payment-method", {
|
|
48
|
+
paymentMethodDetails: s,
|
|
49
|
+
onCancel: i
|
|
50
|
+
});
|
|
51
|
+
}, [i, n, s]);
|
|
52
|
+
return M(
|
|
53
|
+
() => ({
|
|
54
|
+
onCancelSubscription: i,
|
|
55
|
+
onViewPaymentMethod: u
|
|
56
|
+
}),
|
|
57
|
+
[i, u]
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
A as usePLAModalHandlers
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=use-pla-model-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-pla-model-handlers.js","sources":["../../../../../src/features/parent-dashboard/modals/hooks/use-pla-model-handlers.ts"],"sourcesContent":["import type { IBillingDetails } from '../../parent-dashboard-types';\n\nimport { useCallback, useMemo } from 'react';\n\nimport useModalActions from '../../../ui/modals/use-modal-actions';\nimport { useCancelSubscriptionPatch } from '../../api/cancel-subscription';\nimport { invalidateParentHome } from '../../api/parent-home';\n\ninterface IUsePLAModalHandlers {\n demoId?: string;\n completedSessions: number;\n studentId: string;\n withTutor: boolean;\n billingDetails: IBillingDetails | null;\n onRescheduleDemo: (demoId: string) => void;\n onChangeTutor: (demoId: string) => void;\n}\n\ninterface IUsePLAModalResponse {\n onCancelSubscription: () => void;\n onViewPaymentMethod: () => void;\n}\n\nexport const usePLAModalHandlers = ({\n studentId,\n demoId,\n withTutor,\n billingDetails,\n completedSessions,\n onRescheduleDemo,\n onChangeTutor,\n}: IUsePLAModalHandlers): IUsePLAModalResponse => {\n const { openModal } = useModalActions();\n\n const { payment_method_details: paymentMethodDetails } = billingDetails ?? {};\n\n const handleCancelConfirmation = useCallback(() => {\n invalidateParentHome(studentId);\n openModal('pla-cancellation-confirmation');\n }, [openModal, studentId]);\n\n const { patch: cancelSubscription } = useCancelSubscriptionPatch({\n onComplete: handleCancelConfirmation,\n });\n\n const handleCancelSubscriptionPatch = useCallback(\n (cancellationReason: string) => {\n if (!cancellationReason) return;\n\n cancelSubscription(studentId, {\n reason: cancellationReason,\n student_demo_id: demoId,\n });\n },\n [cancelSubscription, studentId, demoId],\n );\n\n const handleViewCancellationReason = useCallback(() => {\n return openModal('pla-cancellation-reason', {\n withTutor,\n completedSessions,\n onCancel: (reason: string) => handleCancelSubscriptionPatch(reason),\n });\n }, [completedSessions, handleCancelSubscriptionPatch, openModal, withTutor]);\n\n const handleCancelSubscription = useCallback(() => {\n openModal('pla-cancel-subscription', {\n withTutor,\n completedSessions,\n onSwitchTutor: () => (demoId ? onChangeTutor(demoId) : undefined),\n onReschedule: () => (demoId ? onRescheduleDemo(demoId) : undefined),\n onCancel: handleViewCancellationReason,\n });\n }, [\n completedSessions,\n demoId,\n handleViewCancellationReason,\n onChangeTutor,\n onRescheduleDemo,\n openModal,\n withTutor,\n ]);\n\n const handleViewPaymentMethod = useCallback(() => {\n openModal('pla-view-payment-method', {\n paymentMethodDetails,\n onCancel: handleCancelSubscription,\n });\n }, [handleCancelSubscription, openModal, paymentMethodDetails]);\n\n return useMemo(\n () => ({\n onCancelSubscription: handleCancelSubscription,\n onViewPaymentMethod: handleViewPaymentMethod,\n }),\n [handleCancelSubscription, handleViewPaymentMethod],\n );\n};\n"],"names":["usePLAModalHandlers","studentId","demoId","withTutor","billingDetails","completedSessions","onRescheduleDemo","onChangeTutor","openModal","useModalActions","paymentMethodDetails","handleCancelConfirmation","useCallback","invalidateParentHome","cancelSubscription","useCancelSubscriptionPatch","handleCancelSubscriptionPatch","cancellationReason","handleViewCancellationReason","reason","handleCancelSubscription","handleViewPaymentMethod","useMemo"],"mappings":";;;;AAuBO,MAAMA,IAAsB,CAAC;AAAA,EAClC,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,eAAAC;AACF,MAAkD;AAC1C,QAAA,EAAE,WAAAC,MAAcC,KAEhB,EAAE,wBAAwBC,MAAyBN,KAAkB,CAAA,GAErEO,IAA2BC,EAAY,MAAM;AACjD,IAAAC,EAAqBZ,CAAS,GAC9BO,EAAU,+BAA+B;AAAA,EAAA,GACxC,CAACA,GAAWP,CAAS,CAAC,GAEnB,EAAE,OAAOa,EAAmB,IAAIC,EAA2B;AAAA,IAC/D,YAAYJ;AAAA,EAAA,CACb,GAEKK,IAAgCJ;AAAA,IACpC,CAACK,MAA+B;AAC9B,MAAKA,KAELH,EAAmBb,GAAW;AAAA,QAC5B,QAAQgB;AAAA,QACR,iBAAiBf;AAAA,MAAA,CAClB;AAAA,IACH;AAAA,IACA,CAACY,GAAoBb,GAAWC,CAAM;AAAA,EAAA,GAGlCgB,IAA+BN,EAAY,MACxCJ,EAAU,2BAA2B;AAAA,IAC1C,WAAAL;AAAA,IACA,mBAAAE;AAAA,IACA,UAAU,CAACc,MAAmBH,EAA8BG,CAAM;AAAA,EAAA,CACnE,GACA,CAACd,GAAmBW,GAA+BR,GAAWL,CAAS,CAAC,GAErEiB,IAA2BR,EAAY,MAAM;AACjD,IAAAJ,EAAU,2BAA2B;AAAA,MACnC,WAAAL;AAAA,MACA,mBAAAE;AAAA,MACA,eAAe,MAAOH,IAASK,EAAcL,CAAM,IAAI;AAAA,MACvD,cAAc,MAAOA,IAASI,EAAiBJ,CAAM,IAAI;AAAA,MACzD,UAAUgB;AAAA,IAAA,CACX;AAAA,EAAA,GACA;AAAA,IACDb;AAAA,IACAH;AAAA,IACAgB;AAAA,IACAX;AAAA,IACAD;AAAA,IACAE;AAAA,IACAL;AAAA,EAAA,CACD,GAEKkB,IAA0BT,EAAY,MAAM;AAChD,IAAAJ,EAAU,2BAA2B;AAAA,MACnC,sBAAAE;AAAA,MACA,UAAUU;AAAA,IAAA,CACX;AAAA,EACA,GAAA,CAACA,GAA0BZ,GAAWE,CAAoB,CAAC;AAEvD,SAAAY;AAAA,IACL,OAAO;AAAA,MACL,sBAAsBF;AAAA,MACtB,qBAAqBC;AAAA,IAAA;AAAA,IAEvB,CAACD,GAA0BC,CAAuB;AAAA,EAAA;AAEtD;"}
|
|
@@ -9,19 +9,19 @@ const s = o(t)`
|
|
|
9
9
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
10
10
|
max-height: unset;
|
|
11
11
|
overflow-y: hidden;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
`, h = o(t)`
|
|
14
14
|
padding-top: 0;
|
|
15
15
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
16
16
|
max-height: 300px;
|
|
17
17
|
overflow-y: auto;
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
`, m = o(t)`
|
|
20
20
|
padding-bottom: 24px;
|
|
21
21
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
22
22
|
border-top: ${({ theme: e }) => `1px solid ${e.colors.BLACK_5}`};
|
|
23
23
|
padding-bottom: 40px;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
`, c = o.textarea(({ theme: e }) => {
|
|
26
26
|
const {
|
|
27
27
|
colors: { WHITE: i, WHITE_T_38: r, BLACK_2: n, BLACK_5: a },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutor-change-styled.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Container = styled(FlexView)`\n max-width: 560px;\n border: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n`;\n\nexport const OuterWrapper = styled(FlexView)`\n overflow-y: auto;\n max-height: 468px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: unset;\n overflow-y: hidden;\n }
|
|
1
|
+
{"version":3,"file":"tutor-change-styled.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Container = styled(FlexView)`\n max-width: 560px;\n border: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n`;\n\nexport const OuterWrapper = styled(FlexView)`\n overflow-y: auto;\n max-height: 468px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: unset;\n overflow-y: hidden;\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)`\n padding-top: 0;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: 300px;\n overflow-y: auto;\n }\n`;\n\nexport const FooterWrapper = styled(FlexView)`\n padding-bottom: 24px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n border-top: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n padding-bottom: 40px;\n }\n`;\n\nexport const StyledTextArea = styled.textarea(({ theme }) => {\n const {\n colors: { WHITE, WHITE_T_38, BLACK_2, BLACK_5 },\n layout: { gutter },\n } = theme;\n\n return `border: 1px solid ${BLACK_5};\n width: 100%;\n min-height: ${gutter * 5}px;\n padding: 16px;\n background-color: ${BLACK_2};\n white-space: pre-line;\n font-family: 'Untitled Sans Regular';\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ${WHITE};\n resize: none;\n outline: none;\n &::placeholder {\n color: ${WHITE_T_38};\n }\n\n &:focus {\n outline: none;\n }\n`;\n});\n"],"names":["Container","styled","FlexView","theme","OuterWrapper","ContentWrapper","FooterWrapper","StyledTextArea","WHITE","WHITE_T_38","BLACK_2","BLACK_5","gutter"],"mappings":";;AAIa,MAAAA,IAAYC,EAAOC,CAAQ;AAAA;AAAA,YAE5B,CAAC,EAAE,OAAAC,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA,GAGjDC,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCE,IAAiBJ,EAAOC,CAAQ;AAAA;AAAA,IAEzC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCG,IAAgBL,EAAOC,CAAQ;AAAA;AAAA,IAExC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA,kBAClC,CAAC,EAAE,OAAAA,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA;AAAA;AAAA,GAKvDI,IAAiBN,EAAO,SAAS,CAAC,EAAE,OAAAE,QAAY;AACrD,QAAA;AAAA,IACJ,QAAQ,EAAE,OAAAK,GAAO,YAAAC,GAAY,SAAAC,GAAS,SAAAC,EAAQ;AAAA,IAC9C,QAAQ,EAAE,QAAAC,EAAO;AAAA,EACf,IAAAT;AAEJ,SAAO,qBAAqBQ,CAAO;AAAA;AAAA,gBAErBC,IAAS,CAAC;AAAA;AAAA,sBAEJF,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMlBF,CAAK;AAAA;AAAA;AAAA;AAAA,aAIHC,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,CAAC;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as $ } from "react";
|
|
3
|
+
import { useTheme as h } from "styled-components";
|
|
4
|
+
import p from "../../../ui/buttons/text-button/text-button.js";
|
|
5
|
+
import t from "../../../ui/layout/flex-view.js";
|
|
6
|
+
import u from "../../../ui/modals/use-modal-params.js";
|
|
7
|
+
import n from "../../../ui/separator/separator.js";
|
|
8
|
+
import i from "../../../ui/text/text.js";
|
|
9
|
+
import { EDeviceType as b } from "../../../ui/theme/constants.js";
|
|
10
|
+
const f = $(() => {
|
|
11
|
+
const { paymentMethodDetails: l, onCancel: a } = u(), {
|
|
12
|
+
exp_month: c,
|
|
13
|
+
exp_year: s,
|
|
14
|
+
last_4_digits: d
|
|
15
|
+
} = l || {}, { device: m } = h(), r = m <= b.MOBILE;
|
|
16
|
+
return /* @__PURE__ */ e(t, { $gapX: r ? 2.25 : 2.5, $gutterX: r ? 1 : 2.5, $background: "BLACK_2", children: [
|
|
17
|
+
/* @__PURE__ */ o(
|
|
18
|
+
i,
|
|
19
|
+
{
|
|
20
|
+
$renderAs: "ah4-bold",
|
|
21
|
+
$renderOnMobileAs: "ac4-black",
|
|
22
|
+
$color: r ? "WHITE_T_60" : "WHITE",
|
|
23
|
+
children: r ? "Payment Method" : "View Payment Method"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ o(n, { heightX: r ? 1 : 2.5 }),
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
t,
|
|
29
|
+
{
|
|
30
|
+
$flexDirection: "row",
|
|
31
|
+
$justifyContent: "flex-start",
|
|
32
|
+
$alignItems: "center",
|
|
33
|
+
$flexGapX: 0.5,
|
|
34
|
+
$gapX: 1,
|
|
35
|
+
$gutterX: 1,
|
|
36
|
+
$background: "BLACK_2",
|
|
37
|
+
$borderColor: "BLACK_5",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ o(t, { $widthX: 3, $heightX: 1.75, $background: "BLACK_4", $borderRadiusX: 0.25 }),
|
|
40
|
+
/* @__PURE__ */ e(t, { children: [
|
|
41
|
+
/* @__PURE__ */ e(i, { $renderAs: "ac4-black", $color: "WHITE", children: [
|
|
42
|
+
"•••• ",
|
|
43
|
+
d
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ e(i, { $renderAs: "ub3-bold", $color: "WHITE", children: [
|
|
46
|
+
"Card",
|
|
47
|
+
/* @__PURE__ */ e(i, { $renderAs: "ub3", $color: "WHITE", $inline: !0, children: [
|
|
48
|
+
"Exp: ",
|
|
49
|
+
c,
|
|
50
|
+
"/",
|
|
51
|
+
s
|
|
52
|
+
] })
|
|
53
|
+
] })
|
|
54
|
+
] })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ o(n, { heightX: 1.5 }),
|
|
59
|
+
/* @__PURE__ */ o(p, { size: "small", label: "Cancel subscription", color: "WHITE_T_60", onClick: a })
|
|
60
|
+
] });
|
|
61
|
+
}), y = f;
|
|
62
|
+
export {
|
|
63
|
+
y as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=view-payment-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-payment-method.js","sources":["../../../../../src/features/parent-dashboard/modals/view-payment-method/view-payment-method.tsx"],"sourcesContent":["import type { IPaymentMethodDetails } from '../../parent-dashboard-types';\n\nimport { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useModalParams from '../../../ui/modals/use-modal-params';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\n\ninterface IViewPaymentMethodProps {\n paymentMethodDetails: IPaymentMethodDetails;\n onCancel: () => void;\n}\n\nconst ViewPaymentMethod = memo(() => {\n const { paymentMethodDetails, onCancel } = useModalParams<IViewPaymentMethodProps>();\n\n const {\n exp_month: expMonth,\n exp_year: expYear,\n last_4_digits: last4Digits,\n } = paymentMethodDetails || {};\n\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n return (\n <FlexView $gapX={isMobile ? 2.25 : 2.5} $gutterX={isMobile ? 1 : 2.5} $background=\"BLACK_2\">\n <Text\n $renderAs=\"ah4-bold\"\n $renderOnMobileAs=\"ac4-black\"\n $color={isMobile ? 'WHITE_T_60' : 'WHITE'}\n >\n {isMobile ? 'Payment Method' : 'View Payment Method'}\n </Text>\n <Separator heightX={isMobile ? 1 : 2.5} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"flex-start\"\n $alignItems=\"center\"\n $flexGapX={0.5}\n $gapX={1}\n $gutterX={1}\n $background=\"BLACK_2\"\n $borderColor=\"BLACK_5\"\n >\n <FlexView $widthX={3} $heightX={1.75} $background=\"BLACK_4\" $borderRadiusX={0.25} />\n <FlexView>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n •••• {last4Digits}\n </Text>\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n Card\n <Text $renderAs=\"ub3\" $color=\"WHITE\" $inline>\n Exp: {expMonth}/{expYear}\n </Text>\n </Text>\n </FlexView>\n </FlexView>\n <Separator heightX={1.5} />\n <TextButton size=\"small\" label=\"Cancel subscription\" color=\"WHITE_T_60\" onClick={onCancel} />\n </FlexView>\n );\n});\n\nexport default ViewPaymentMethod;\n"],"names":["ViewPaymentMethod","memo","paymentMethodDetails","onCancel","useModalParams","expMonth","expYear","last4Digits","device","useTheme","isMobile","EDeviceType","jsxs","FlexView","jsx","Text","Separator","TextButton","ViewPaymentMethod$1"],"mappings":";;;;;;;;;AAiBA,MAAMA,IAAoBC,EAAK,MAAM;AACnC,QAAM,EAAE,sBAAAC,GAAsB,UAAAC,EAAS,IAAIC,EAAwC,GAE7E;AAAA,IACJ,WAAWC;AAAA,IACX,UAAUC;AAAA,IACV,eAAeC;AAAA,EAAA,IACbL,KAAwB,CAAA,GAEtB,EAAE,QAAAM,MAAWC,KACbC,IAAWF,KAAUG,EAAY;AAGrC,SAAA,gBAAAC,EAACC,GAAS,EAAA,OAAOH,IAAW,OAAO,KAAK,UAAUA,IAAW,IAAI,KAAK,aAAY,WAChF,UAAA;AAAA,IAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,mBAAkB;AAAA,QAClB,QAAQL,IAAW,eAAe;AAAA,QAEjC,cAAW,mBAAmB;AAAA,MAAA;AAAA,IACjC;AAAA,IACC,gBAAAI,EAAAE,GAAA,EAAU,SAASN,IAAW,IAAI,KAAK;AAAA,IACxC,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAY;AAAA,QACZ,cAAa;AAAA,QAEb,UAAA;AAAA,UAAC,gBAAAC,EAAAD,GAAA,EAAS,SAAS,GAAG,UAAU,MAAM,aAAY,WAAU,gBAAgB,KAAM,CAAA;AAAA,4BACjFA,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAD,EAACG,GAAK,EAAA,WAAU,aAAY,QAAO,SAAQ,UAAA;AAAA,cAAA;AAAA,cACnCR;AAAA,YAAA,GACR;AAAA,YACC,gBAAAK,EAAAG,GAAA,EAAK,WAAU,YAAW,QAAO,SAAQ,UAAA;AAAA,cAAA;AAAA,gCAEvCA,GAAK,EAAA,WAAU,OAAM,QAAO,SAAQ,SAAO,IAAC,UAAA;AAAA,gBAAA;AAAA,gBACrCV;AAAA,gBAAS;AAAA,gBAAEC;AAAA,cAAA,GACnB;AAAA,YAAA,GACF;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAAQ,EAACE,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACzB,gBAAAF,EAACG,KAAW,MAAK,SAAQ,OAAM,uBAAsB,OAAM,cAAa,SAASd,EAAU,CAAA;AAAA,EAC7F,EAAA,CAAA;AAEJ,CAAC,GAEDe,IAAelB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent-dashboard-types.js","sources":["../../../src/features/parent-dashboard/parent-dashboard-types.ts"],"sourcesContent":["import type { TSession } from '../trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types';\nimport type { ReactElement } from 'react';\n\nexport enum EClassStatus {\n S_NO_SHOW = 'S_NO_SHOW',\n T_NO_SHOW = 'T_NO_SHOW',\n}\nexport interface ISessionDetails {\n completed_sessions: number;\n next_session_start: number;\n next_session_end: number;\n student_demo_id: string;\n upcoming_sessions: TSession[];\n demo_class_status: EClassStatus | null;\n user_attempt_id?: string;\n}\n\ninterface IDegreeInfo {\n degree_name: string;\n degree_code: string;\n field_of_study: string;\n}\nexport interface ITeacherDetails {\n first_name: string;\n last_name: string;\n years_of_experience: number;\n number_of_students_taught: number;\n lower_grade: string;\n higher_grade: string;\n degree: IDegreeInfo;\n countries: string[];\n teacher_profile_url: string;\n header_image: string;\n}\n\
|
|
1
|
+
{"version":3,"file":"parent-dashboard-types.js","sources":["../../../src/features/parent-dashboard/parent-dashboard-types.ts"],"sourcesContent":["import type { TSession } from '../trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types';\nimport type { ReactElement } from 'react';\n\nexport enum EClassStatus {\n S_NO_SHOW = 'S_NO_SHOW',\n T_NO_SHOW = 'T_NO_SHOW',\n}\nexport interface ISessionDetails {\n completed_sessions: number;\n next_session_start: number;\n next_session_end: number;\n student_demo_id: string;\n upcoming_sessions: TSession[];\n demo_class_status: EClassStatus | null;\n user_attempt_id?: string;\n}\n\ninterface IDegreeInfo {\n degree_name: string;\n degree_code: string;\n field_of_study: string;\n}\nexport interface ITeacherDetails {\n first_name: string;\n last_name: string;\n years_of_experience: number;\n number_of_students_taught: number;\n lower_grade: string;\n higher_grade: string;\n degree: IDegreeInfo;\n countries: string[];\n teacher_profile_url: string;\n header_image: string;\n}\n\nexport interface IPaymentMethodDetails {\n brand: string;\n last_4_digits: string;\n type: string;\n exp_month: number;\n exp_year: number;\n}\n\nexport interface IBillingDetails {\n amount: number;\n cycle_frequency: string;\n next_due_date: string;\n payment_method_details: IPaymentMethodDetails;\n}\n\nexport interface IParentHome {\n session_details: ISessionDetails;\n teacher_details: ITeacherDetails | null;\n billing_details: IBillingDetails;\n}\n\nexport interface IStudentProfileSummary {\n studentLevel: string;\n studentObjectives: string[] | string;\n learningPlan: string[] | string;\n levelPreference?: string;\n}\n\nexport interface IOnViewSummaryParams extends IStudentProfileSummary {\n userAttemptId?: string;\n}\nexport enum ESummaryType {\n STUDENT_PROFILE = 'studentProfile',\n INSIGHTS = 'insights',\n LEARNING_PLAN = 'learningPlan',\n}\n\nexport interface IParentDashboardProps {\n studentName: string;\n studentId: string;\n onRescheduleDemo: (demoId?: string) => void;\n onChangeTutor: (demoId: string) => void;\n onGetStartedAgain?: () => void;\n onViewSummary?: (key: ESummaryType, summaryData: IOnViewSummaryParams) => void;\n onSwitchUser?: () => void;\n canChangeTutor: boolean;\n isSubscriptionCancelled: boolean;\n HeaderAvatar: ReactElement;\n}\n\nexport interface ISpacingConfig {\n small: number;\n medium: number;\n large: number;\n separator: {\n small: number;\n medium: number;\n large: number;\n extraLarge: number;\n };\n}\n"],"names":["EClassStatus","ESummaryType"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,YAAY,aAFFA,IAAAA,KAAA,CAAA,CAAA,GA+DAC,sBAAAA,OACVA,EAAA,kBAAkB,kBAClBA,EAAA,WAAW,YACXA,EAAA,gBAAgB,gBAHNA,IAAAA,KAAA,CAAA,CAAA;"}
|