@tap-payments/auth-jsconnect 2.9.17-development → 2.9.18-development

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.
@@ -375,6 +375,7 @@
375
375
  "kyc_terms_title": "وثائق قانونية",
376
376
  "kyc_token_invalid": "الرجاء مراجعة رابط المرسل اليك",
377
377
  "kyc_users_description": "يرجى اختيار رقم هوية الممثل المعتمد للموافقة عليه مع {{provider}}",
378
+ "kyc_privacy_policy": "سياسة الخصوصية",
378
379
  "language": "English",
379
380
  "license_info": "معلومات الترخيص",
380
381
  "license_name_hint": "Enter legal name",
@@ -389,6 +389,7 @@
389
389
  "kyc_token_invalid": "May you please verify link of which you are trying to open.",
390
390
  "kyc_users_description": "Please select an authorized registered ID to approve with {{provider}}",
391
391
  "kyc_verification": "Know Your Customer (KYC)",
392
+ "kyc_privacy_policy": "Privacy Policy",
392
393
  "language": "العربية",
393
394
  "license_info": "License information",
394
395
  "license_name_hint": "Enter legal name",
@@ -19,6 +19,8 @@ export declare const EXTERNAL_LINKS: {
19
19
  REFUND_AR: string;
20
20
  TRANSACTION_EN: string;
21
21
  TRANSACTION_AR: string;
22
+ PRIVACY_POLICY_EN: string;
23
+ PRIVACY_POLICY_AR: string;
22
24
  };
23
25
  export declare const DIALOG_ID = "auth-js-connect-dialog";
24
26
  export declare const BACKGROUND_ID = "auth-js-connect-background";
@@ -19,7 +19,9 @@ export var EXTERNAL_LINKS = {
19
19
  REFUND_EN: '/en/terms-conditions',
20
20
  REFUND_AR: '/ar/terms-conditions',
21
21
  TRANSACTION_EN: '/en/terms-conditions',
22
- TRANSACTION_AR: '/ar/terms-conditions'
22
+ TRANSACTION_AR: '/ar/terms-conditions',
23
+ PRIVACY_POLICY_EN: '/en/privacy',
24
+ PRIVACY_POLICY_AR: '/ar/privacy'
23
25
  };
24
26
  export var DIALOG_ID = 'auth-js-connect-dialog';
25
27
  export var BACKGROUND_ID = 'auth-js-connect-background';
@@ -1,4 +1,15 @@
1
1
  import React from 'react';
2
+ export declare const LinkStyled: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").LinkBaseProps, "classes"> & {
3
+ children?: React.ReactNode;
4
+ classes?: Partial<import("@mui/material").LinkClasses> | undefined;
5
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
6
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
7
+ TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
8
+ underline?: "none" | "always" | "hover" | undefined;
9
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
10
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & {
11
+ ref?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject<HTMLAnchorElement> | null | undefined;
12
+ }, "left" | "right" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "slot" | "title" | "children" | "sx" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "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" | "underline" | "variant" | "href" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy" | "TypographyClasses"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
2
13
  export declare const Terms: () => JSX.Element;
3
14
  declare const _default: React.MemoExoticComponent<() => JSX.Element>;
4
15
  export default _default;
@@ -13,10 +13,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React, { memo } from 'react';
14
14
  import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
15
15
  import Box from '@mui/material/Box';
16
+ import { Link } from '@mui/material';
16
17
  import { styled } from '@mui/material/styles';
17
18
  import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
18
19
  import { isSA, maskIDNumber } from '../../../../utils';
19
- import { CONNECT_FLOWS } from '../../../../constants';
20
+ import { CONNECT_FLOWS, EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
20
21
  import Button from '../../../shared/Button';
21
22
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
22
23
  import { createNafathAuth, createPaciAuth, kycSelector } from '../../../app/kyc/kycStore';
@@ -32,9 +33,22 @@ var BoxStyled = styled(Box)(function (_a) {
32
33
  fontSize: theme.spacing(1.875),
33
34
  padding: theme.spacing(1.5),
34
35
  borderRadius: theme.spacing(3.875),
35
- textAlign: 'center'
36
+ textAlign: 'center',
37
+ '&:hover': {
38
+ cursor: 'pointer'
39
+ }
40
+ });
41
+ });
42
+ export var LinkStyled = styled(Link)(function (_a) {
43
+ var theme = _a.theme;
44
+ return ({
45
+ color: theme.palette.text.primary,
46
+ textDecoration: 'none'
36
47
  });
37
48
  });
49
+ var getLinkComponent = function (label, link) {
50
+ return (_jsx(LinkStyled, __assign({ href: link, target: '_blank' }, { children: label })));
51
+ };
38
52
  export var Terms = function () {
39
53
  var _a, _b, _c;
40
54
  var st = useSanitizedTranslation();
@@ -45,6 +59,9 @@ export var Terms = function () {
45
59
  var hasOneUserOnly = ((_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.userList) === null || _b === void 0 ? void 0 : _b.length) === 1;
46
60
  var user = hasOneUserOnly ? (_c = data.responseData) === null || _c === void 0 ? void 0 : _c.userList[0] : undefined;
47
61
  var idNumber = user ? maskIDNumber(user.identification.id) : '';
62
+ var countryCode = settingsData.businessCountry.iso2.toLowerCase();
63
+ var termsAndConditionsLink = isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN;
64
+ var privacyPolicyLink = isAr ? TAP_WEBSITE + EXTERNAL_LINKS.PRIVACY_POLICY_AR : TAP_WEBSITE + EXTERNAL_LINKS.PRIVACY_POLICY_EN;
48
65
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
49
66
  var onNext = function () {
50
67
  if (hasOneUserOnly) {
@@ -67,6 +84,6 @@ export var Terms = function () {
67
84
  }
68
85
  dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.users));
69
86
  };
70
- return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, { children: st('kyc_terms_conditions') }), _jsx(BoxStyled, { children: st('kyc_refund_policy') }), _jsx(BoxStyled, __assign({ sx: { mb: error ? 3 : 0 } }, { children: st('kyc_dispute_policy') })), _jsx(Button, __assign({ sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: isSACountry ? st('approve_with_nafath_app') : st('approve_with_paci_app') }))] }));
87
+ return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, { children: getLinkComponent(st('kyc_terms_conditions'), termsAndConditionsLink) }), _jsx(BoxStyled, { children: getLinkComponent(st('kyc_refund_policy'), termsAndConditionsLink) }), _jsx(BoxStyled, { children: getLinkComponent(st('kyc_dispute_policy'), termsAndConditionsLink) }), _jsx(BoxStyled, __assign({ sx: { mb: error ? 3 : 0 } }, { children: getLinkComponent(st('kyc_privacy_policy'), privacyPolicyLink) })), _jsx(Button, __assign({ sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: isSACountry ? st('approve_with_nafath_app') : st('approve_with_paci_app') }))] }));
71
88
  };
72
89
  export default memo(Terms);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.17-development",
3
+ "version": "2.9.18-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",