contentoh-components-library 21.3.86 → 21.3.87
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/.env.development +5 -0
- package/.env.production +3 -0
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Card/index.js +46 -5
- package/dist/components/atoms/Card/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +4 -2
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/TabSection/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +171 -96
- package/dist/components/pages/ProviderProductEdition/index.js +188 -175
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +40 -28
- package/dist/components/pages/RetailerProductEdition/index.js +265 -273
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +51 -12
- package/package.json +3 -1
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/Card/index.js +35 -2
- package/src/components/atoms/Card/styles.js +41 -5
- package/src/components/atoms/CheckBox/index.js +2 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/atoms/TabSection/styles.js +0 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
- package/src/components/molecules/StripeCardForm/index.js +42 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
- package/src/components/molecules/StripeCardForm/styles.js +73 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +44 -0
- package/src/components/molecules/StripeCardSelector/styles.js +4 -0
- package/src/components/molecules/StripeCardSelector/utils.js +17 -0
- package/src/components/molecules/TagAndInput/index.js +10 -8
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +4 -1
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +50 -0
- package/src/components/organisms/SideModal/styles.js +30 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +181 -98
- package/src/components/pages/ProviderProductEdition/index.js +132 -129
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -26
- package/src/components/pages/RetailerProductEdition/index.js +109 -135
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +3 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: calc(100% - 341px);\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n }\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: calc(100% - 341px);\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n }\n }\n #modal-message-box {\n width: 400px;\n height: 100px;\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
17
17
|
var headerTop = _ref.headerTop;
|
|
18
18
|
return headerTop;
|
|
19
19
|
});
|
|
@@ -5,14 +5,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getInputsData = exports.getAuditVersion = void 0;
|
|
8
|
+
exports.translateService = exports.sendMessage = exports.getInputsData = exports.getAuditVersion = exports.createMessage = void 0;
|
|
9
9
|
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
12
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
15
|
|
|
14
16
|
var _axios = _interopRequireDefault(require("axios"));
|
|
15
17
|
|
|
18
|
+
var _handle_http = require("../../../global-files/handle_http");
|
|
19
|
+
|
|
16
20
|
var getAuditVersion = /*#__PURE__*/function () {
|
|
17
21
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(articleId, setState, token) {
|
|
18
22
|
var auditResponse;
|
|
@@ -64,4 +68,59 @@ var getInputsData = function getInputsData(services, activeRetailer, setDatashee
|
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
70
|
|
|
67
|
-
exports.getInputsData = getInputsData;
|
|
71
|
+
exports.getInputsData = getInputsData;
|
|
72
|
+
|
|
73
|
+
var translateService = function translateService(tab) {
|
|
74
|
+
switch (tab) {
|
|
75
|
+
case "description":
|
|
76
|
+
case "Descripción":
|
|
77
|
+
return "Descripciones";
|
|
78
|
+
|
|
79
|
+
case "datasheet":
|
|
80
|
+
case "Ficha técnica":
|
|
81
|
+
return "Fichas técnicas";
|
|
82
|
+
|
|
83
|
+
case "images":
|
|
84
|
+
case "Imágenes":
|
|
85
|
+
return "Imágenes";
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.translateService = translateService;
|
|
90
|
+
|
|
91
|
+
var createMessage = function createMessage(retailers, idRetailer, oldStatus, newStatus, service) {
|
|
92
|
+
var _ref2 = (retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (ret) {
|
|
93
|
+
return ret.id === idRetailer;
|
|
94
|
+
})) || [],
|
|
95
|
+
_ref3 = (0, _slicedToArray2.default)(_ref2, 1),
|
|
96
|
+
retailer = _ref3[0];
|
|
97
|
+
|
|
98
|
+
return "".concat(translateService(service), " de ").concat(retailer.name, " |").concat(oldStatus, "| a |").concat(newStatus);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports.createMessage = createMessage;
|
|
102
|
+
|
|
103
|
+
var sendMessage = /*#__PURE__*/function () {
|
|
104
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(data) {
|
|
105
|
+
var paramsBody, paramsHeader;
|
|
106
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
107
|
+
while (1) {
|
|
108
|
+
switch (_context2.prev = _context2.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
paramsBody = data.paramsBody, paramsHeader = data.paramsHeader;
|
|
111
|
+
return _context2.abrupt("return", (0, _handle_http.fetchPOST)(process.env.REACT_APP_CREATE_MESSAGES, paramsBody, paramsHeader));
|
|
112
|
+
|
|
113
|
+
case 2:
|
|
114
|
+
case "end":
|
|
115
|
+
return _context2.stop();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, _callee2);
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
return function sendMessage(_x4) {
|
|
122
|
+
return _ref4.apply(this, arguments);
|
|
123
|
+
};
|
|
124
|
+
}();
|
|
125
|
+
|
|
126
|
+
exports.sendMessage = sendMessage;
|
package/dist/index.js
CHANGED
|
@@ -810,7 +810,7 @@ Object.keys(_index61).forEach(function (key) {
|
|
|
810
810
|
});
|
|
811
811
|
});
|
|
812
812
|
|
|
813
|
-
var _index62 = require("./components/
|
|
813
|
+
var _index62 = require("./components/molecules/StripeCardForm/index");
|
|
814
814
|
|
|
815
815
|
Object.keys(_index62).forEach(function (key) {
|
|
816
816
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -823,7 +823,7 @@ Object.keys(_index62).forEach(function (key) {
|
|
|
823
823
|
});
|
|
824
824
|
});
|
|
825
825
|
|
|
826
|
-
var _index63 = require("./components/
|
|
826
|
+
var _index63 = require("./components/molecules/StripeCardSelector/index");
|
|
827
827
|
|
|
828
828
|
Object.keys(_index63).forEach(function (key) {
|
|
829
829
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -836,7 +836,7 @@ Object.keys(_index63).forEach(function (key) {
|
|
|
836
836
|
});
|
|
837
837
|
});
|
|
838
838
|
|
|
839
|
-
var _index64 = require("./components/organisms/
|
|
839
|
+
var _index64 = require("./components/organisms/ChangePassword/index");
|
|
840
840
|
|
|
841
841
|
Object.keys(_index64).forEach(function (key) {
|
|
842
842
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -849,7 +849,7 @@ Object.keys(_index64).forEach(function (key) {
|
|
|
849
849
|
});
|
|
850
850
|
});
|
|
851
851
|
|
|
852
|
-
var _index65 = require("./components/organisms/
|
|
852
|
+
var _index65 = require("./components/organisms/Fullplan/index");
|
|
853
853
|
|
|
854
854
|
Object.keys(_index65).forEach(function (key) {
|
|
855
855
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -862,7 +862,7 @@ Object.keys(_index65).forEach(function (key) {
|
|
|
862
862
|
});
|
|
863
863
|
});
|
|
864
864
|
|
|
865
|
-
var _index66 = require("./components/organisms/
|
|
865
|
+
var _index66 = require("./components/organisms/FullProductNameHeader/index");
|
|
866
866
|
|
|
867
867
|
Object.keys(_index66).forEach(function (key) {
|
|
868
868
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -875,7 +875,7 @@ Object.keys(_index66).forEach(function (key) {
|
|
|
875
875
|
});
|
|
876
876
|
});
|
|
877
877
|
|
|
878
|
-
var _index67 = require("./components/organisms/
|
|
878
|
+
var _index67 = require("./components/organisms/FullTabsMenu/index");
|
|
879
879
|
|
|
880
880
|
Object.keys(_index67).forEach(function (key) {
|
|
881
881
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -888,7 +888,7 @@ Object.keys(_index67).forEach(function (key) {
|
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
890
|
|
|
891
|
-
var _index68 = require("./components/organisms/
|
|
891
|
+
var _index68 = require("./components/organisms/ImageDataTable/index");
|
|
892
892
|
|
|
893
893
|
Object.keys(_index68).forEach(function (key) {
|
|
894
894
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -901,7 +901,7 @@ Object.keys(_index68).forEach(function (key) {
|
|
|
901
901
|
});
|
|
902
902
|
});
|
|
903
903
|
|
|
904
|
-
var _index69 = require("./components/organisms/
|
|
904
|
+
var _index69 = require("./components/organisms/ImagePreviewer/index");
|
|
905
905
|
|
|
906
906
|
Object.keys(_index69).forEach(function (key) {
|
|
907
907
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -914,7 +914,7 @@ Object.keys(_index69).forEach(function (key) {
|
|
|
914
914
|
});
|
|
915
915
|
});
|
|
916
916
|
|
|
917
|
-
var _index70 = require("./components/organisms/
|
|
917
|
+
var _index70 = require("./components/organisms/ImagesGroup/index");
|
|
918
918
|
|
|
919
919
|
Object.keys(_index70).forEach(function (key) {
|
|
920
920
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -927,7 +927,7 @@ Object.keys(_index70).forEach(function (key) {
|
|
|
927
927
|
});
|
|
928
928
|
});
|
|
929
929
|
|
|
930
|
-
var _index71 = require("./components/organisms/
|
|
930
|
+
var _index71 = require("./components/organisms/InputGroup/index");
|
|
931
931
|
|
|
932
932
|
Object.keys(_index71).forEach(function (key) {
|
|
933
933
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -940,7 +940,7 @@ Object.keys(_index71).forEach(function (key) {
|
|
|
940
940
|
});
|
|
941
941
|
});
|
|
942
942
|
|
|
943
|
-
var _index72 = require("./components/organisms/
|
|
943
|
+
var _index72 = require("./components/organisms/ProductImageModal/index");
|
|
944
944
|
|
|
945
945
|
Object.keys(_index72).forEach(function (key) {
|
|
946
946
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -953,7 +953,7 @@ Object.keys(_index72).forEach(function (key) {
|
|
|
953
953
|
});
|
|
954
954
|
});
|
|
955
955
|
|
|
956
|
-
var _index73 = require("./components/organisms/
|
|
956
|
+
var _index73 = require("./components/organisms/Chat/index");
|
|
957
957
|
|
|
958
958
|
Object.keys(_index73).forEach(function (key) {
|
|
959
959
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -966,6 +966,32 @@ Object.keys(_index73).forEach(function (key) {
|
|
|
966
966
|
});
|
|
967
967
|
});
|
|
968
968
|
|
|
969
|
+
var _index74 = require("./components/organisms/Modal/index");
|
|
970
|
+
|
|
971
|
+
Object.keys(_index74).forEach(function (key) {
|
|
972
|
+
if (key === "default" || key === "__esModule") return;
|
|
973
|
+
if (key in exports && exports[key] === _index74[key]) return;
|
|
974
|
+
Object.defineProperty(exports, key, {
|
|
975
|
+
enumerable: true,
|
|
976
|
+
get: function get() {
|
|
977
|
+
return _index74[key];
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
});
|
|
981
|
+
|
|
982
|
+
var _index75 = require("./components/organisms/OrderDetail/index");
|
|
983
|
+
|
|
984
|
+
Object.keys(_index75).forEach(function (key) {
|
|
985
|
+
if (key === "default" || key === "__esModule") return;
|
|
986
|
+
if (key in exports && exports[key] === _index75[key]) return;
|
|
987
|
+
Object.defineProperty(exports, key, {
|
|
988
|
+
enumerable: true,
|
|
989
|
+
get: function get() {
|
|
990
|
+
return _index75[key];
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
|
|
969
995
|
var _RangeCalendar = require("./components/organisms/RangeCalendar");
|
|
970
996
|
|
|
971
997
|
Object.keys(_RangeCalendar).forEach(function (key) {
|
|
@@ -992,6 +1018,19 @@ Object.keys(_TableResizable).forEach(function (key) {
|
|
|
992
1018
|
});
|
|
993
1019
|
});
|
|
994
1020
|
|
|
1021
|
+
var _index76 = require("./components/organisms/SideModal/index");
|
|
1022
|
+
|
|
1023
|
+
Object.keys(_index76).forEach(function (key) {
|
|
1024
|
+
if (key === "default" || key === "__esModule") return;
|
|
1025
|
+
if (key in exports && exports[key] === _index76[key]) return;
|
|
1026
|
+
Object.defineProperty(exports, key, {
|
|
1027
|
+
enumerable: true,
|
|
1028
|
+
get: function get() {
|
|
1029
|
+
return _index76[key];
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
});
|
|
1033
|
+
|
|
995
1034
|
var _ChangePasswordLogin = require("./components/pages/ChangePasswordLogin");
|
|
996
1035
|
|
|
997
1036
|
Object.keys(_ChangePasswordLogin).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.87",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@aws-amplify/auth": "^4.5.3",
|
|
6
6
|
"@aws-amplify/datastore": "^3.11.0",
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"@mui/material": "^5.12.0",
|
|
17
17
|
"@mui/styled-engine-sc": "^5.12.0",
|
|
18
18
|
"@storybook/addon-postcss": "^2.0.0",
|
|
19
|
+
"@stripe/react-stripe-js": "^2.1.1",
|
|
20
|
+
"@stripe/stripe-js": "^1.54.1",
|
|
19
21
|
"@testing-library/jest-dom": "^5.11.4",
|
|
20
22
|
"@testing-library/react": "^11.1.0",
|
|
21
23
|
"@testing-library/user-event": "^12.1.10",
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
import { Container } from "./styles";
|
|
2
|
+
import { CheckBox } from "../CheckBox";
|
|
3
|
+
import { CardCvcElement, useStripe } from "@stripe/react-stripe-js";
|
|
4
|
+
|
|
5
|
+
export const Card = ({
|
|
6
|
+
card = {},
|
|
7
|
+
selectedCard,
|
|
8
|
+
setSelectedCard,
|
|
9
|
+
setCard,
|
|
10
|
+
setStripe,
|
|
11
|
+
}) => {
|
|
12
|
+
const stripe = useStripe();
|
|
13
|
+
|
|
14
|
+
const handleOnChange = (e, cardId) => {
|
|
15
|
+
if (e.target.checked) {
|
|
16
|
+
setCard && setCard({ ...card, isNew: 0 });
|
|
17
|
+
setStripe && setStripe(stripe);
|
|
18
|
+
setSelectedCard && setSelectedCard(cardId);
|
|
19
|
+
} else {
|
|
20
|
+
setSelectedCard && setSelectedCard("");
|
|
21
|
+
setCard && setCard(null);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
2
24
|
|
|
3
|
-
export const Card = ({ cardIcon, altText }) => {
|
|
4
25
|
return (
|
|
5
26
|
<Container>
|
|
6
|
-
<
|
|
27
|
+
<div className="card-details">
|
|
28
|
+
<CheckBox
|
|
29
|
+
id={card.id}
|
|
30
|
+
label={
|
|
31
|
+
<>
|
|
32
|
+
<span className="brand-card">{card.brand}</span>
|
|
33
|
+
<span>{`**** **** **** ${card.last4}`}</span>
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
checked={selectedCard === card.id}
|
|
37
|
+
onChange={(e) => handleOnChange(e, card.id)}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
7
40
|
</Container>
|
|
8
41
|
);
|
|
9
42
|
};
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
2
3
|
|
|
3
4
|
export const Container = styled.div`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
display: flex;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
.card-details {
|
|
9
|
+
label {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
height: 25px;
|
|
12
|
+
p {
|
|
13
|
+
margin-left: 40px;
|
|
14
|
+
span {
|
|
15
|
+
& + * {
|
|
16
|
+
margin-left: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
& + * {
|
|
22
|
+
margin-left: 20px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cvc-input {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
color: ${GlobalColors.s4};
|
|
30
|
+
font-family: ${FontFamily.AvenirNext};
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
|
|
33
|
+
.card-input {
|
|
34
|
+
border: 1px solid #f0f0f0 !important;
|
|
35
|
+
border-radius: 5px;
|
|
36
|
+
padding: 3px;
|
|
37
|
+
width: 50px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
& + * {
|
|
42
|
+
margin-top: 15px;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -7,6 +7,7 @@ export const CheckBox = ({
|
|
|
7
7
|
isFilter,
|
|
8
8
|
defaultChecked,
|
|
9
9
|
disabled = false,
|
|
10
|
+
checked,
|
|
10
11
|
}) => {
|
|
11
12
|
return (
|
|
12
13
|
<Container key={`check-${id}`}>
|
|
@@ -17,6 +18,7 @@ export const CheckBox = ({
|
|
|
17
18
|
onChange={onChange}
|
|
18
19
|
defaultChecked={defaultChecked}
|
|
19
20
|
disabled={disabled}
|
|
21
|
+
checked={checked}
|
|
20
22
|
/>
|
|
21
23
|
<label htmlFor={id}>
|
|
22
24
|
{label && <p className={isFilter && "filter-text"}>{label}</p>}
|
|
@@ -27,7 +27,7 @@ export const CarouselImagesLogin = ({
|
|
|
27
27
|
img2.src = images[i];
|
|
28
28
|
const circulo_actual = Array.from(circulos).find((el) => el.id === i);
|
|
29
29
|
Array.from(circulos).forEach((cir) => cir.classList.remove("resaltado"));
|
|
30
|
-
circulo_actual
|
|
30
|
+
circulo_actual?.classList.add("resaltado");
|
|
31
31
|
img1.classList.add("right");
|
|
32
32
|
img2.classList.add("active");
|
|
33
33
|
i++;
|
|
@@ -4,10 +4,13 @@ import { Button } from "../../atoms/GeneralButton/index";
|
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { Chat } from "../../organisms/Chat";
|
|
6
6
|
import auditIcon from "../../../../src/assets/images/generalButton/Icono AB.svg";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { render } from "@testing-library/react";
|
|
7
9
|
|
|
8
10
|
export const HeaderTop = ({
|
|
9
11
|
setHeaderTop,
|
|
10
12
|
withChat,
|
|
13
|
+
chatType,
|
|
11
14
|
productSelected,
|
|
12
15
|
token,
|
|
13
16
|
auditableVersion,
|
|
@@ -16,16 +19,51 @@ export const HeaderTop = ({
|
|
|
16
19
|
activeRetailer,
|
|
17
20
|
}) => {
|
|
18
21
|
const headerTop = useRef();
|
|
22
|
+
const [chat, setChat] = useState(null);
|
|
23
|
+
const [chatData, setChatData] = useState(null);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (activeRetailer.id && productSelected && token.length) {
|
|
27
|
+
setChatData({
|
|
28
|
+
id: productSelected?.article?.id_article || productSelected?.id_article,
|
|
29
|
+
version: productSelected?.version,
|
|
30
|
+
retailerId: activeRetailer?.id,
|
|
31
|
+
status: productSelected?.status,
|
|
32
|
+
userToken: token,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, [activeRetailer, productSelected, token]);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (chatType) renderChat(chatType);
|
|
39
|
+
}, [chatData, chatType]);
|
|
19
40
|
|
|
20
41
|
useEffect(() => {
|
|
21
42
|
setHeaderTop && setHeaderTop(headerTop.current.clientHeight);
|
|
22
43
|
}, []);
|
|
23
44
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
45
|
+
const renderChat = (chatType) => {
|
|
46
|
+
switch (chatType) {
|
|
47
|
+
case "product_status":
|
|
48
|
+
chatData &&
|
|
49
|
+
setChat(
|
|
50
|
+
<Chat
|
|
51
|
+
chatType="product_status"
|
|
52
|
+
chatContainerType="popUp"
|
|
53
|
+
chatData={{
|
|
54
|
+
id: chatData?.id,
|
|
55
|
+
version: chatData?.version,
|
|
56
|
+
retailerId: chatData?.retailerId,
|
|
57
|
+
status: chatData?.status,
|
|
58
|
+
userToken: chatData?.userToken,
|
|
59
|
+
}}
|
|
60
|
+
size={18}
|
|
61
|
+
activeRetailer={activeRetailer}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
setChat(
|
|
29
67
|
<Chat
|
|
30
68
|
chatType="merchant_product"
|
|
31
69
|
chatContainerType="popUp"
|
|
@@ -37,8 +75,16 @@ export const HeaderTop = ({
|
|
|
37
75
|
size={18}
|
|
38
76
|
activeRetailer={activeRetailer}
|
|
39
77
|
/>
|
|
40
|
-
)
|
|
78
|
+
);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
41
82
|
|
|
83
|
+
return (
|
|
84
|
+
<Container ref={headerTop}>
|
|
85
|
+
<ScreenHeader text="Edición de producto" />
|
|
86
|
+
<div className="buttons-container">
|
|
87
|
+
{withChat && chat}
|
|
42
88
|
{isAuditor && auditableVersion && (
|
|
43
89
|
<Button
|
|
44
90
|
buttonType="general-white-button circular-button"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StripeCardForm } from ".";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/molecules/StripeCardForm",
|
|
5
|
+
component: StripeCardForm,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <StripeCardForm {...args} />;
|
|
9
|
+
export const StripeCardFormDefault = Template.bind({});
|
|
10
|
+
StripeCardFormDefault.args = {
|
|
11
|
+
customerId: "cus_KuEt6R6vwmN09f",
|
|
12
|
+
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5ZjQzNjAwMC0wYzgyLTRjNzYtYWEzNi1kM2Q1NGJjZTZiMTMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4NTU2OTUyMywibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODU1NzMxMjMsImlhdCI6MTY4NTU2OTUyMywiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.EotcxmtkUpBxwlXa3bo25iLAmRcT0kj1G3PVITVB_0ZtF8UC19rJIMTNSc1hYkl8cbfCuB_vkjYCAxi4b2SOru5MdMTRhgNjcQTVbiwIYww-QdUWq0WSv84nW_HaRoxCJ8ezm-wBZgUTpcD3VFuynUICbODKKHUfxVdKdVoAM6GGE6ymSbO7-0C7ZumoWEqaZ22BF4G1H-JvLkR-tL5iqXa2N-QCnNoteFmHstBfH6Sp5UZhPav1VBEGRmwdFfUnC-Xc-aNeIFwgWCXMsOXFWbbmWeh0uNF-Btu-QEJ7VkCu4pbElqHWJKBYLCx1zqDBrKrsrNxyvQlxsJ9NSOae8Q",
|
|
13
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { loadStripe } from "@stripe/stripe-js";
|
|
4
|
+
import { Elements } from "@stripe/react-stripe-js";
|
|
5
|
+
import { PaymentForm } from "./paymentForm";
|
|
6
|
+
import { Loading } from "../../atoms/Loading";
|
|
7
|
+
const stripeApiKey = loadStripe(`${process.env.REACT_APP_KEY_STRIPE}`);
|
|
8
|
+
|
|
9
|
+
export const StripeCardForm = ({
|
|
10
|
+
setToken,
|
|
11
|
+
setCard,
|
|
12
|
+
setStripe,
|
|
13
|
+
setModalErrorCard,
|
|
14
|
+
setMsj,
|
|
15
|
+
}) => {
|
|
16
|
+
const [stripeLoaded, setStripeLoaded] = useState(false);
|
|
17
|
+
|
|
18
|
+
const loadStripeJS = async () => {
|
|
19
|
+
await stripeApiKey;
|
|
20
|
+
setStripeLoaded(true);
|
|
21
|
+
};
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
loadStripeJS();
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
return stripeLoaded ? (
|
|
27
|
+
<Container>
|
|
28
|
+
<Elements stripe={stripeApiKey}>
|
|
29
|
+
<PaymentForm
|
|
30
|
+
labelForm={"Pago con tarjeta"}
|
|
31
|
+
setToken={setToken}
|
|
32
|
+
setCard={setCard}
|
|
33
|
+
setStripe={setStripe}
|
|
34
|
+
setModalErrorCard={setModalErrorCard}
|
|
35
|
+
setMsj={setMsj}
|
|
36
|
+
/>
|
|
37
|
+
</Elements>
|
|
38
|
+
</Container>
|
|
39
|
+
) : (
|
|
40
|
+
<Loading />
|
|
41
|
+
);
|
|
42
|
+
};
|