@homefile/components-v2 2.39.7 → 2.39.9
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/assets/locales/en/index.json +4 -2
- package/dist/components/appBar/PeopleConnected.js +2 -2
- package/dist/components/myProfile/ProfilePaymentTab.d.ts +1 -1
- package/dist/components/myProfile/ProfilePaymentTab.js +2 -2
- package/dist/components/myProfile/payment/CreditCardContainer.d.ts +1 -1
- package/dist/components/myProfile/payment/CreditCardContainer.js +5 -4
- package/dist/components/sharedHomePanel/SharedHomeHeader.js +2 -2
- package/dist/components/subscription/PaymentBanner.js +1 -1
- package/dist/hooks/propertyTiles/useRecordsInputs.js +14 -3
- package/dist/interfaces/myProfile/ProfilePaymentTab.interface.d.ts +1 -0
- package/dist/interfaces/myProfile/payment/CreditCardContainer.interface.d.ts +1 -0
- package/dist/interfaces/propertyTiles/RecordsInputs.interface.d.ts +3 -0
- package/dist/proxies/propertyTiles/recordsInputs.proxy.js +3 -0
- package/dist/stories/myProfile/ProfilePaymentTab.stories.d.ts +1 -0
- package/dist/stories/myProfile/ProfilePaymentTab.stories.js +1 -0
- package/dist/stories/subscription/SubscriptionTable.stories.js +0 -1
- package/package.json +1 -1
|
@@ -620,16 +620,18 @@
|
|
|
620
620
|
"unsubscribe": "Unsubscribe from all Homefile email"
|
|
621
621
|
},
|
|
622
622
|
"payment": {
|
|
623
|
-
"activePayment": "
|
|
623
|
+
"activePayment": "Payment Method",
|
|
624
624
|
"addCard": "Please add a card for future purchases.",
|
|
625
625
|
"addCrediCard": "Payment Method",
|
|
626
626
|
"addNew": "Add New Payment Type",
|
|
627
627
|
"billingTitle": "Billing address",
|
|
628
628
|
"creditCardErrorMessage": "There is a problem with your payment. Please check all fields are filled out properly.",
|
|
629
629
|
"expiration": "Expiration",
|
|
630
|
+
"makePayment": "Make Payment",
|
|
630
631
|
"methodTitle": "Add payment method",
|
|
631
632
|
"newCard": "New Card",
|
|
632
633
|
"notBeCharged": "You will not be charged anything today.",
|
|
634
|
+
"onFile": "Below is the payment method we have on file.",
|
|
633
635
|
"receiptName": "Homefile Reciept",
|
|
634
636
|
"receiptsTitle": "Receipts",
|
|
635
637
|
"toDelete": "To delete a card, you must first add a new card."
|
|
@@ -1000,7 +1002,7 @@
|
|
|
1000
1002
|
"storage": "of storage",
|
|
1001
1003
|
"subscribe": "Subscribe",
|
|
1002
1004
|
"table": {
|
|
1003
|
-
"subscription": "Annual Homefile Subscription",
|
|
1005
|
+
"subscription": "Annual Homefile Cloud Subscription",
|
|
1004
1006
|
"subtotal": "Subtotal",
|
|
1005
1007
|
"tax": "Sales Tax",
|
|
1006
1008
|
"total": "Total Charged Today"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Flex, Img, Tooltip } from '@chakra-ui/react';
|
|
4
|
-
import {
|
|
4
|
+
import { ShareHome } from '../../assets/images';
|
|
5
5
|
import { NumberBadge } from '../../components';
|
|
6
6
|
import { useWindowDimensions } from '../../hooks';
|
|
7
7
|
import { MOBILE_WIDTH } from '../../utils';
|
|
8
8
|
export const PeopleConnected = ({ onClick, total }) => {
|
|
9
9
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
10
10
|
const isMobile = width < MOBILE_WIDTH;
|
|
11
|
-
return (_jsx(Tooltip, { label: t('tooltips.shareHome'), children: _jsxs(Flex, { gap: "1", as: "button", onClick: onClick, id: "shareWithOthers", "data-testid": "people-connected", children: [_jsx(Img, { src:
|
|
11
|
+
return (_jsx(Tooltip, { label: t('tooltips.shareHome'), children: _jsxs(Flex, { gap: "1", as: "button", onClick: onClick, id: "shareWithOthers", "data-testid": "people-connected", children: [_jsx(Img, { src: ShareHome, "aria-label": t('tooltips.shareHome'), h: "26px", w: "auto" }), !isMobile && _jsx(NumberBadge, { total: total })] }) }));
|
|
12
12
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ProfilePaymentTabI } from '../../interfaces';
|
|
2
|
-
export declare const ProfilePaymentTab: ({ paymentMethod, receipts, handleDelete, handleNewCard, }: ProfilePaymentTabI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ProfilePaymentTab: ({ paymentMethod, receipts, handleDelete, handleNewCard, handleSubmitPayment }: ProfilePaymentTabI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MyProfileReceipts, CreditCardContainer } from '../../components';
|
|
3
|
-
export const ProfilePaymentTab = ({ paymentMethod, receipts, handleDelete, handleNewCard, }) => {
|
|
3
|
+
export const ProfilePaymentTab = ({ paymentMethod, receipts, handleDelete, handleNewCard, handleSubmitPayment }) => {
|
|
4
4
|
var _a, _b;
|
|
5
5
|
const hasReceipts = receipts.length > 0;
|
|
6
|
-
return (_jsxs(_Fragment, { children: [_jsx(CreditCardContainer, { brand: (_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.brand) !== null && _a !== void 0 ? _a : '', cardNumber: (_b = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.number) !== null && _b !== void 0 ? _b : '', hasError: !(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.isPaymentMethodValid), onAddCard: handleNewCard, onDeleteCard: handleDelete, onSubmit: () => null, cardHolder: '', cvv: '', expirationMonth: '', expirationYear: '' }), hasReceipts && _jsx(MyProfileReceipts, { receipts })] }));
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx(CreditCardContainer, { brand: (_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.brand) !== null && _a !== void 0 ? _a : '', cardNumber: (_b = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.number) !== null && _b !== void 0 ? _b : '', hasError: !(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.isPaymentMethodValid), onAddCard: handleNewCard, onDeleteCard: handleDelete, onSubmit: () => null, cardHolder: '', cvv: '', expirationMonth: '', expirationYear: '', handleSubmitPayment: handleSubmitPayment }), hasReceipts && _jsx(MyProfileReceipts, { receipts })] }));
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CreditCardContainerI } from '../../../interfaces';
|
|
2
|
-
export declare const CreditCardContainer: ({ brand, hasError, onAddCard, onDeleteCard, onSubmit, cardNumber, showEdition, ...props }: CreditCardContainerI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CreditCardContainer: ({ brand, hasError, onAddCard, onDeleteCard, onSubmit, cardNumber, showEdition, handleSubmitPayment, ...props }: CreditCardContainerI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,11 +11,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { t } from 'i18next';
|
|
14
|
-
import { Box, Flex, Text } from '@chakra-ui/react';
|
|
15
|
-
import { CreditCard, CreditCardError, LeftButtonAnimated, PaymentFormProvider, } from '../../../components';
|
|
14
|
+
import { Box, Flex, Text, Button, Circle } from '@chakra-ui/react';
|
|
15
|
+
import { CreditCard, CreditCardError, LeftButtonAnimated, PaymentFormProvider, ChevronRight } from '../../../components';
|
|
16
|
+
import { colors } from '../../../theme/colors';
|
|
16
17
|
export const CreditCardContainer = (_a) => {
|
|
17
|
-
var { brand, hasError = false, onAddCard, onDeleteCard, onSubmit = () => null, cardNumber, showEdition = false } = _a, props = __rest(_a, ["brand", "hasError", "onAddCard", "onDeleteCard", "onSubmit", "cardNumber", "showEdition"]);
|
|
18
|
+
var { brand, hasError = false, onAddCard, onDeleteCard, onSubmit = () => null, cardNumber, showEdition = false, handleSubmitPayment } = _a, props = __rest(_a, ["brand", "hasError", "onAddCard", "onDeleteCard", "onSubmit", "cardNumber", "showEdition", "handleSubmitPayment"]);
|
|
18
19
|
const formAttributes = Object.assign({ cardNumber }, props);
|
|
19
20
|
const error = hasError && cardNumber;
|
|
20
|
-
return (_jsxs(_Fragment, { children: [error && _jsx(CreditCardError, {}), _jsxs(Box, { bg: error ? 'error.1' : '
|
|
21
|
+
return (_jsxs(_Fragment, { children: [error && _jsx(CreditCardError, {}), _jsxs(Box, { bg: error ? 'error.1' : 'lightBlue.2', w: "100%", children: [_jsxs(Flex, { justify: "space-between", w: "full", pt: "base", align: "center", children: [_jsxs(Flex, { flexDir: 'column', children: [_jsx(Text, { variant: "home", textTransform: "uppercase", pl: "base", fontSize: "1rem", children: t('myProfile.payment.activePayment') }), _jsx(Text, { variant: "home", pl: "base", pt: "base", children: t('myProfile.payment.onFile') })] }), _jsx(LeftButtonAnimated, { onClick: onAddCard, label: t('myProfile.payment.addCrediCard'), marginLeft: "auto", fontSize: "sm", width: "11" })] }), _jsx(Box, { py: "6", px: "base", children: cardNumber && (_jsx(CreditCard, { brand, cardNumber, hasError, showEdition, onClick: onDeleteCard, children: showEdition && (_jsx(PaymentFormProvider, Object.assign({}, formAttributes, { onSubmit: onSubmit }))) })) }), handleSubmitPayment && (_jsx(Flex, { justifyContent: 'flex-end', px: "base", pb: "6", children: _jsx(Button, { w: 'auto', minW: "300px", onClick: handleSubmitPayment, children: _jsxs(Flex, { w: "full", alignItems: "center", justifyContent: "space-between", px: "4", children: [_jsx(Text, { mr: "2rem", textTransform: 'none', color: "white", children: t('myProfile.payment.makePayment') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", transition: "all 0.2s ease-in-out", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) }) }))] })] }));
|
|
21
22
|
};
|
|
@@ -3,9 +3,9 @@ import { useState } from 'react';
|
|
|
3
3
|
import { t } from 'i18next';
|
|
4
4
|
import { Box, DrawerHeader } from '@chakra-ui/react';
|
|
5
5
|
import { HelpButton, PanelHeader, RolesHelpModal } from '../../components';
|
|
6
|
-
import {
|
|
6
|
+
import { ShareHome } from '../../assets/images';
|
|
7
7
|
export const SharedHomeHeader = ({ children, onClose }) => {
|
|
8
8
|
const [showChildren, setShowChildren] = useState(false);
|
|
9
9
|
const handleHelpClick = () => setShowChildren(!showChildren);
|
|
10
|
-
return (_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: onClose, icon:
|
|
10
|
+
return (_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: onClose, icon: ShareHome, title: t('shareHome.title'), children: _jsx(Box, { mr: "base", position: "relative", children: _jsx(HelpButton, { onClick: handleHelpClick, children: showChildren && (_jsx(RolesHelpModal, { top: "40px", right: "0", onClose: handleHelpClick })) }) }) }), children] }));
|
|
11
11
|
};
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Flex, Text } from '@chakra-ui/react';
|
|
4
4
|
export const PaymentBanner = () => {
|
|
5
|
-
return (_jsx(Flex, { bg: "violet.1", py: "1.5rem", px: "4", justify: "center", align: "center", children: _jsx(Text, { fontSize: "1.5rem", variant: "title", color: "neutral.white", children: `${t('subscription.paymentBanner')}` }) }));
|
|
5
|
+
return (_jsx(Flex, { bg: "violet.1", py: "1.5rem", px: "4", justify: "center", align: "center", width: '100%', children: _jsx(Text, { fontSize: "1.5rem", variant: "title", color: "neutral.white", children: `${t('subscription.paymentBanner')}` }) }));
|
|
6
6
|
};
|
|
@@ -5,12 +5,19 @@ export const useRecordsInputs = ({ data = {}, session = '' }) => {
|
|
|
5
5
|
const proxy = recordsInputsProxy;
|
|
6
6
|
const proxyToDB = recordsInputsToDBProxy;
|
|
7
7
|
const handleChange = (e) => {
|
|
8
|
-
var _a;
|
|
8
|
+
var _a, _b, _c;
|
|
9
9
|
const { name, value } = e.target;
|
|
10
10
|
proxy.data[name] = value;
|
|
11
|
+
// dirty tracking
|
|
12
|
+
const initial = (_b = (_a = proxy.initialData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
|
|
13
|
+
const next = value !== null && value !== void 0 ? value : '';
|
|
14
|
+
const isFieldDirty = next !== (initial !== null && initial !== void 0 ? initial : '');
|
|
15
|
+
proxy.dirtyFields[name] = isFieldDirty;
|
|
16
|
+
// recompute global dirty (cheap)
|
|
17
|
+
proxy.isDirty = Object.values(proxy.dirtyFields).some(Boolean);
|
|
11
18
|
const dbProp = propertyRecordsToDB[session][name];
|
|
12
19
|
if (session === 'community') {
|
|
13
|
-
proxyToDB.data = Object.assign(Object.assign({}, proxyToDB.data), { neighborhood: Object.assign(Object.assign({}, ((
|
|
20
|
+
proxyToDB.data = Object.assign(Object.assign({}, proxyToDB.data), { neighborhood: Object.assign(Object.assign({}, ((_c = proxyToDB.data.neighborhood) !== null && _c !== void 0 ? _c : {})), { [dbProp]: value }) });
|
|
14
21
|
return;
|
|
15
22
|
}
|
|
16
23
|
proxyToDB.data[dbProp] = dbDataParser(dbProp, value);
|
|
@@ -18,7 +25,11 @@ export const useRecordsInputs = ({ data = {}, session = '' }) => {
|
|
|
18
25
|
useEffect(() => {
|
|
19
26
|
proxy.session = session;
|
|
20
27
|
proxy.data = data;
|
|
21
|
-
|
|
28
|
+
// new for dirty fields
|
|
29
|
+
proxy.initialData = data;
|
|
30
|
+
proxy.dirtyFields = {};
|
|
31
|
+
proxy.isDirty = false;
|
|
32
|
+
}, [session, data]);
|
|
22
33
|
return {
|
|
23
34
|
handleChange,
|
|
24
35
|
};
|
|
@@ -5,6 +5,9 @@ export interface RecordsInputsI extends EditCallbackI {
|
|
|
5
5
|
export interface RecordsInputsProxyI {
|
|
6
6
|
data: EditCallbackI['data'];
|
|
7
7
|
session: EditCallbackI['session'];
|
|
8
|
+
initialData: EditCallbackI['data'];
|
|
9
|
+
dirtyFields: Record<string, boolean>;
|
|
10
|
+
isDirty: boolean;
|
|
8
11
|
}
|
|
9
12
|
type DBData = string | number | boolean | Record<string, string>;
|
|
10
13
|
export interface recordsInputsToDBProxyI {
|
|
@@ -8,6 +8,7 @@ export declare const ProfilePaymentTabComponent: {
|
|
|
8
8
|
receipts: never[];
|
|
9
9
|
handleNewCard: import("@storybook/addon-actions").HandlerFunction;
|
|
10
10
|
handleDelete: import("@storybook/addon-actions").HandlerFunction;
|
|
11
|
+
handleSubmitPayment: import("@storybook/addon-actions").HandlerFunction;
|
|
11
12
|
paymentMethod: {
|
|
12
13
|
brand: string;
|
|
13
14
|
number: string;
|