contentoh-components-library 21.3.93 → 21.3.94
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 +0 -5
- package/.env.production +0 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -4
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- 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 +96 -171
- package/dist/components/pages/ProviderProductEdition/index.js +175 -188
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +28 -40
- package/dist/components/pages/RetailerProductEdition/index.js +273 -265
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +12 -51
- package/package.json +1 -3
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
- package/src/components/pages/ProviderProductEdition/index.js +129 -132
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -38
- package/src/components/pages/RetailerProductEdition/index.js +135 -109
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -3
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CardSelector } from ".";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/molecules/CardSelector",
|
|
5
|
-
component: CardSelector,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const Template = (args) => <CardSelector {...args} />;
|
|
9
|
-
export const CardSelectorDefault = Template.bind({});
|
|
10
|
-
CardSelectorDefault.args = {
|
|
11
|
-
jwt: "eyJraWQiOiJkQW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C7ZumoWEqaZ22BF4G1H-JvLkR-tL5iqXa2N-QCnNoteFmHstBfH6Sp5UZhPav1VBEGRmwdFfUnC-Xc-aNeIFwgWCXMsOXFWbbmWeh0uNF-Btu-QEJ7VkCu4pbElqHWJKBYLCx1zqDBrKrsrNxyvQlxsJ9NSOae8Q",
|
|
12
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { Container } from "./styles";
|
|
3
|
-
import { loadStripe } from "@stripe/stripe-js";
|
|
4
|
-
import { Elements } from "@stripe/react-stripe-js";
|
|
5
|
-
import { getAllCards } from "./utils";
|
|
6
|
-
import { Card } from "../../atoms/Card";
|
|
7
|
-
import { Loading } from "../../atoms/Loading";
|
|
8
|
-
const stripeApiKey = loadStripe(`${process.env.REACT_APP_KEY_STRIPE}`);
|
|
9
|
-
|
|
10
|
-
export const CardSelector = ({ jwt, setCard, setStripe }) => {
|
|
11
|
-
const [stripeLoaded, setStripeLoaded] = useState(false);
|
|
12
|
-
const [cards, setCards] = useState([]);
|
|
13
|
-
const [selectedCard, setSelectedCard] = useState("");
|
|
14
|
-
|
|
15
|
-
const loadStripeJS = async () => {
|
|
16
|
-
await stripeApiKey;
|
|
17
|
-
setStripeLoaded(true);
|
|
18
|
-
const cardsResponse = await getAllCards(jwt);
|
|
19
|
-
setCards(cardsResponse);
|
|
20
|
-
};
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
loadStripeJS();
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
|
-
return stripeLoaded ? (
|
|
26
|
-
<Container>
|
|
27
|
-
<h2>Tarjetas guardadas</h2>
|
|
28
|
-
<Elements stripe={stripeApiKey}>
|
|
29
|
-
{cards.map((card) => (
|
|
30
|
-
<Card
|
|
31
|
-
key={card.id}
|
|
32
|
-
card={card}
|
|
33
|
-
selectedCard={selectedCard}
|
|
34
|
-
setSelectedCard={setSelectedCard}
|
|
35
|
-
setCard={setCard}
|
|
36
|
-
setStripe={setStripe}
|
|
37
|
-
/>
|
|
38
|
-
))}
|
|
39
|
-
</Elements>
|
|
40
|
-
</Container>
|
|
41
|
-
) : (
|
|
42
|
-
<Loading />
|
|
43
|
-
);
|
|
44
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
export const getAllCards = async (jwt) => {
|
|
4
|
-
try {
|
|
5
|
-
const response = await axios({
|
|
6
|
-
method: "get",
|
|
7
|
-
url: `${process.env.REACT_APP_CARDS_ENDPOINT}`,
|
|
8
|
-
headers: {
|
|
9
|
-
Authorization: jwt,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
const stripeCards = JSON.parse(response.data.body).data;
|
|
13
|
-
return stripeCards;
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.log(error);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SideModal } from ".";
|
|
2
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Components/organisms/SideModal",
|
|
6
|
-
component: SideModal,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template = (args) => <SideModal {...args} />;
|
|
10
|
-
|
|
11
|
-
export const DefaultSideModal = Template.bind({});
|
|
12
|
-
DefaultSideModal.args = {
|
|
13
|
-
show: false,
|
|
14
|
-
header: [
|
|
15
|
-
<div className="title-container">
|
|
16
|
-
<h2></h2>
|
|
17
|
-
</div>,
|
|
18
|
-
<ButtonV2 label="Ir al Checkout" />,
|
|
19
|
-
<ButtonV2 label="X" />,
|
|
20
|
-
],
|
|
21
|
-
body: <></>,
|
|
22
|
-
footer: <></>,
|
|
23
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
import { Container } from "./styles";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { PropaneSharp } from "@mui/icons-material";
|
|
5
|
-
|
|
6
|
-
export const SideModal = ({
|
|
7
|
-
header,
|
|
8
|
-
body,
|
|
9
|
-
footer,
|
|
10
|
-
show,
|
|
11
|
-
setShow,
|
|
12
|
-
id = "side-modal",
|
|
13
|
-
}) => {
|
|
14
|
-
const modal = useRef();
|
|
15
|
-
|
|
16
|
-
const closeModal = (e) => {
|
|
17
|
-
if (!e.target.closest(`#${id}`) && show) {
|
|
18
|
-
document.removeEventListener("click", closeModal, false);
|
|
19
|
-
modal?.current?.classList?.remove("shown");
|
|
20
|
-
setShow && setShow(false);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (show && modal.current) {
|
|
26
|
-
document.addEventListener("click", closeModal, false);
|
|
27
|
-
modal?.current?.classList?.add("shown");
|
|
28
|
-
}
|
|
29
|
-
}, [show]);
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
document.removeEventListener("click", closeModal, false);
|
|
34
|
-
modal?.current?.classList?.remove("shown");
|
|
35
|
-
setShow && setShow(false);
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
show && (
|
|
41
|
-
<Container>
|
|
42
|
-
<div id={id} ref={modal} className="modal-container">
|
|
43
|
-
<div className="modal-header">{header}</div>
|
|
44
|
-
<div className="modal-body">{body}</div>
|
|
45
|
-
<div className="modal-footer">{footer}</div>
|
|
46
|
-
</div>
|
|
47
|
-
</Container>
|
|
48
|
-
)
|
|
49
|
-
);
|
|
50
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
export const Container = styled.div`
|
|
4
|
-
width: 100vw;
|
|
5
|
-
height: 100vh;
|
|
6
|
-
position: fixed;
|
|
7
|
-
z-index: 9999999;
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
|
|
12
|
-
.modal-container {
|
|
13
|
-
width: 600px;
|
|
14
|
-
height: 100%;
|
|
15
|
-
position: absolute;
|
|
16
|
-
right: -600px;
|
|
17
|
-
background-color: #fff;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
box-shadow: -0.5px 0px 5px #f0f0f0;
|
|
21
|
-
border: 1px solid #f0f0f0;
|
|
22
|
-
.modal-body {
|
|
23
|
-
flex: 1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.shown {
|
|
27
|
-
right: 0;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|