contentoh-components-library 21.2.104 → 21.2.106
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 -2
- package/.env.production +25 -25
- package/dist/assets/images/customSelect/starIcon.svg +14 -0
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +124 -0
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +72 -0
- package/dist/components/atoms/ButtonFileChooser/index.js +118 -0
- package/dist/components/atoms/ButtonFileChooser/styles.js +20 -0
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +66 -0
- package/dist/components/atoms/ButtonV2/index.js +110 -0
- package/dist/components/atoms/ButtonV2/styles.js +53 -0
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +50 -0
- package/dist/components/atoms/CustomIcon/index.js +40 -0
- package/dist/components/atoms/CustomIcon/styles.js +33 -0
- package/dist/components/atoms/GeneralButton/index.js +2 -6
- package/dist/components/atoms/IconFile/IconFile.stories.js +48 -0
- package/dist/components/atoms/IconFile/index.js +249 -0
- package/dist/components/atoms/IconFile/styles.js +23 -0
- package/dist/components/atoms/Image/Image.stories.js +73 -0
- package/dist/components/atoms/Image/index.js +76 -0
- package/dist/components/atoms/Image/styles.js +43 -0
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +63 -0
- package/dist/components/atoms/ImageLink/index.js +77 -0
- package/dist/components/atoms/ImageLink/styles.js +40 -0
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +70 -0
- package/dist/components/atoms/ImagePreview/index.js +222 -0
- package/dist/components/atoms/ImagePreview/styles.js +44 -0
- package/dist/components/atoms/InputText/InputText.stories.js +60 -0
- package/dist/components/atoms/InputText/index.js +66 -0
- package/dist/components/atoms/InputText/styles.js +32 -0
- package/dist/components/atoms/NotFound/NotFound.stories.js +36 -0
- package/dist/components/atoms/NotFound/index.js +75 -0
- package/dist/components/atoms/NotFound/styles.js +20 -0
- package/dist/components/atoms/Select/VersionSelect.js +1 -2
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +45 -0
- package/dist/components/atoms/SelectItemV2/index.js +57 -0
- package/dist/components/atoms/SelectItemV2/styles.js +30 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +66 -0
- package/dist/components/atoms/Tooltip/index.js +72 -0
- package/dist/components/atoms/Tooltip/styles.js +20 -0
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +66 -0
- package/dist/components/molecules/ButtonDownloadFile/index.js +179 -0
- package/dist/components/molecules/ButtonDownloadFile/styles.js +23 -0
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +98 -0
- package/dist/components/molecules/Dropdown/index.js +150 -0
- package/dist/components/molecules/Dropdown/styles.js +26 -0
- package/dist/components/molecules/HeaderTop/index.js +10 -5
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +82 -0
- package/dist/components/molecules/ImageTooltip/index.js +85 -0
- package/dist/components/molecules/ImageTooltip/styles.js +33 -0
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +119 -0
- package/dist/components/molecules/SelectV2/index.js +298 -0
- package/dist/components/molecules/SelectV2/styles.js +42 -0
- package/dist/components/organisms/Chat/Chat.stories.js +215 -0
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +83 -0
- package/dist/components/organisms/Chat/ChatLists/index.js +160 -0
- package/dist/components/organisms/Chat/ChatLists/styles.js +29 -0
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +176 -0
- package/dist/components/organisms/Chat/ContainerItems/index.js +569 -0
- package/dist/components/organisms/Chat/ContainerItems/styles.js +20 -0
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +142 -0
- package/dist/components/organisms/Chat/ContentChat/index.js +1422 -0
- package/dist/components/organisms/Chat/ContentChat/styles.js +20 -0
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +43 -0
- package/dist/components/organisms/Chat/Footer/index.js +984 -0
- package/dist/components/organisms/Chat/Footer/styles.js +32 -0
- package/dist/components/organisms/Chat/Header/Header.stories.js +96 -0
- package/dist/components/organisms/Chat/Header/index.js +84 -0
- package/dist/components/organisms/Chat/Header/styles.js +20 -0
- package/dist/components/organisms/Chat/index.js +327 -0
- package/dist/components/organisms/Chat/styles.js +29 -0
- package/dist/components/organisms/CreateVersion/RenderChilds.js +11 -11
- package/dist/components/organisms/CreateVersion/index.js +89 -30
- package/dist/components/organisms/Modal/Modal.stories.js +66 -0
- package/dist/components/organisms/Modal/index.js +95 -0
- package/dist/components/organisms/Modal/styles.js +20 -0
- package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/dist/components/organisms/OrderDetail/index.js +11 -20
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/utils.js +15 -45
- package/dist/components/organisms/VersionSelector/index.js +2 -28
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +147 -69
- package/dist/components/pages/ProviderProductEdition/index.js +22 -2
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +67 -77
- package/dist/components/pages/RetailerProductEdition/index.js +24 -5
- package/dist/global-files/fonts.css +12 -0
- package/dist/global-files/handle_http.js +383 -0
- package/dist/global-files/utils.js +472 -0
- package/dist/global-files/variables.js +2 -0
- package/dist/index.js +254 -46
- package/package.json +12 -1
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +124 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
- package/src/components/atoms/ButtonFileChooser/index.js +69 -0
- package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
- package/src/components/atoms/ButtonV2/index.js +85 -0
- package/src/components/atoms/ButtonV2/styles.js +217 -0
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
- package/src/components/atoms/CustomIcon/index.js +41 -0
- package/src/components/atoms/CustomIcon/styles.js +85 -0
- package/src/components/atoms/GeneralButton/index.js +1 -4
- package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
- package/src/components/atoms/IconFile/index.js +119 -0
- package/src/components/atoms/IconFile/styles.js +67 -0
- package/src/components/atoms/Image/Image.stories.js +51 -0
- package/src/components/atoms/Image/index.js +55 -0
- package/src/components/atoms/Image/styles.js +34 -0
- package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
- package/src/components/atoms/ImageLink/index.js +57 -0
- package/src/components/atoms/ImageLink/styles.js +30 -0
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
- package/src/components/atoms/ImagePreview/index.js +191 -0
- package/src/components/atoms/ImagePreview/styles.js +77 -0
- package/src/components/atoms/InputText/InputText.stories.js +39 -0
- package/src/components/atoms/InputText/index.js +61 -0
- package/src/components/atoms/InputText/styles.js +89 -0
- package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
- package/src/components/atoms/NotFound/index.js +52 -0
- package/src/components/atoms/NotFound/styles.js +55 -0
- package/src/components/atoms/Select/VersionSelect.js +2 -4
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
- package/src/components/atoms/SelectItemV2/index.js +61 -0
- package/src/components/atoms/SelectItemV2/styles.js +90 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
- package/src/components/atoms/Tooltip/index.js +59 -0
- package/src/components/atoms/Tooltip/styles.js +42 -0
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
- package/src/components/molecules/ButtonDownloadFile/index.js +111 -0
- package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
- package/src/components/molecules/Dropdown/index.js +150 -0
- package/src/components/molecules/Dropdown/styles.js +75 -0
- package/src/components/molecules/HeaderTop/index.js +11 -6
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
- package/src/components/molecules/ImageTooltip/index.js +63 -0
- package/src/components/molecules/ImageTooltip/styles.js +18 -0
- package/src/components/molecules/SelectV2/SelectV2.stories.js +114 -0
- package/src/components/molecules/SelectV2/index.js +335 -0
- package/src/components/molecules/SelectV2/styles.js +105 -0
- package/src/components/organisms/Chat/Chat.stories.js +199 -0
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +141 -0
- package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +549 -0
- package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +900 -0
- package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
- package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chat/Footer/index.js +669 -0
- package/src/components/organisms/Chat/Footer/styles.js +286 -0
- package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chat/Header/index.js +94 -0
- package/src/components/organisms/Chat/Header/styles.js +49 -0
- package/src/components/organisms/Chat/index.js +294 -0
- package/src/components/organisms/Chat/styles.js +42 -0
- package/src/components/organisms/CreateVersion/RenderChilds.js +34 -28
- package/src/components/organisms/CreateVersion/index.js +36 -16
- package/src/components/organisms/Modal/Modal.stories.js +55 -0
- package/src/components/organisms/Modal/index.js +97 -0
- package/src/components/organisms/Modal/styles.js +103 -0
- package/src/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/src/components/organisms/OrderDetail/index.js +12 -19
- package/src/components/organisms/OrderDetail/styles.js +0 -1
- package/src/components/organisms/OrderDetail/utils/Table/styles.js +0 -30
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +15 -30
- package/src/components/organisms/VersionSelector/index.js +3 -18
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +166 -75
- package/src/components/pages/ProviderProductEdition/index.js +21 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +67 -79
- package/src/components/pages/RetailerProductEdition/index.js +14 -2
- package/src/global-files/customHooks.js +2 -2
- package/src/global-files/fonts.css +12 -0
- package/src/global-files/handle_http.js +231 -0
- package/src/global-files/utils.js +300 -0
- package/src/global-files/variables.js +2 -0
- package/src/index.js +16 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ChatLists } from "./index";
|
|
2
|
+
import THD from "./THD.png";
|
|
3
|
+
import Rotoplas from "./Rotoplas.jpeg";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Components/organisms/Chat/ChatLists",
|
|
7
|
+
component: ChatLists,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <ChatLists {...args} />;
|
|
11
|
+
|
|
12
|
+
// companies de prueba
|
|
13
|
+
const companies = {
|
|
14
|
+
200: {
|
|
15
|
+
name: "The Home Depot",
|
|
16
|
+
src: THD,
|
|
17
|
+
lastChatDate: "2022-11-4 21:01:00",
|
|
18
|
+
statusChat: "disabled",
|
|
19
|
+
},
|
|
20
|
+
300: {
|
|
21
|
+
name: "Rotoplas",
|
|
22
|
+
src: Rotoplas,
|
|
23
|
+
lastChatDate: "2022-11-03 21:01:00",
|
|
24
|
+
statusChat: "enabled",
|
|
25
|
+
},
|
|
26
|
+
100: {
|
|
27
|
+
name: "Content-oh!",
|
|
28
|
+
src: "",
|
|
29
|
+
lastChatDate: "2022-11-02 21:01:00",
|
|
30
|
+
statusChat: "current",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
// companies de prueba sin chats cerrados
|
|
34
|
+
const companies2 = {
|
|
35
|
+
300: {
|
|
36
|
+
name: "Rotoplas",
|
|
37
|
+
src: Rotoplas,
|
|
38
|
+
lastChatDate: "2022-10-27 21:01:00",
|
|
39
|
+
statusChat: "enabled",
|
|
40
|
+
},
|
|
41
|
+
100: {
|
|
42
|
+
name: "Content-oh!",
|
|
43
|
+
src: "",
|
|
44
|
+
lastChatDate: "2022-9-27 21:01:00",
|
|
45
|
+
statusChat: "current",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const exampleChatLists = Template.bind({});
|
|
50
|
+
exampleChatLists.args = {
|
|
51
|
+
companies,
|
|
52
|
+
currentCompanyId: 100,
|
|
53
|
+
onClickCompany: (companyId) => {
|
|
54
|
+
console.log("click en company:", companyId);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const onlyOpenChatLists = Template.bind({});
|
|
59
|
+
onlyOpenChatLists.args = {
|
|
60
|
+
companies: companies2,
|
|
61
|
+
currentCompanyId: 100,
|
|
62
|
+
onClickCompany: (companyId) => {
|
|
63
|
+
console.log("click en company:", companyId);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Container, ContainerItemChat, ContainerTooltip } from "./styles";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { getCustomDate } from "../../../../global-files/utils";
|
|
4
|
+
import { faImage as IconImage } from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
import { CustomIcon } from "../../../atoms/CustomIcon";
|
|
6
|
+
import { Image } from "../../../atoms/Image";
|
|
7
|
+
import { Tooltip } from "../../../atoms/Tooltip";
|
|
8
|
+
|
|
9
|
+
export const ChatLists = (props) => {
|
|
10
|
+
const {
|
|
11
|
+
companies /* {
|
|
12
|
+
id: { name , src , statusChat , items } ,
|
|
13
|
+
...
|
|
14
|
+
} */,
|
|
15
|
+
currentCompanyId, // number
|
|
16
|
+
onClickCompany, // (id) => {}
|
|
17
|
+
} = props;
|
|
18
|
+
const [openChats, setOpenChats] = useState([]);
|
|
19
|
+
const [closedChats, setClosedChats] = useState([]);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
renderChats();
|
|
23
|
+
}, [companies]);
|
|
24
|
+
|
|
25
|
+
const renderChats = () => {
|
|
26
|
+
let jsxOpenChats = [];
|
|
27
|
+
let jsxClosedChats = [];
|
|
28
|
+
|
|
29
|
+
for (const companyId of Object.keys(companies)) {
|
|
30
|
+
const company = companies[companyId];
|
|
31
|
+
// crear el item chat
|
|
32
|
+
const itemChat = (
|
|
33
|
+
<ContainerItemChat
|
|
34
|
+
key={"itemChat-" + companyId}
|
|
35
|
+
onClick={(event) => {
|
|
36
|
+
onClickCompany && onClickCompany(companyId);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{/* logo de la compañia */}
|
|
40
|
+
<Image
|
|
41
|
+
className="img-logoCompany"
|
|
42
|
+
width={"34px"}
|
|
43
|
+
sizeLoading={24}
|
|
44
|
+
colorLoading={undefined}
|
|
45
|
+
src={company.src}
|
|
46
|
+
componentDefault={
|
|
47
|
+
<CustomIcon
|
|
48
|
+
className="icon-logoCompany"
|
|
49
|
+
type={"white"}
|
|
50
|
+
borderType={"circle"}
|
|
51
|
+
size={15}
|
|
52
|
+
icon={IconImage}
|
|
53
|
+
/>
|
|
54
|
+
}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
{/* name y date */}
|
|
58
|
+
<div className="container-info">
|
|
59
|
+
<label className="label-name"> {company.name} </label>
|
|
60
|
+
<label className="label-lastDate">
|
|
61
|
+
{getCustomDate(
|
|
62
|
+
new Date(
|
|
63
|
+
company.items.length ? company.items[0].date : undefined
|
|
64
|
+
)
|
|
65
|
+
)}
|
|
66
|
+
</label>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{/* label interno */}
|
|
70
|
+
<div className="container-indicators">
|
|
71
|
+
{currentCompanyId == companyId && (
|
|
72
|
+
<div className="label-ownCompany">Interno</div>
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
</ContainerItemChat>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// checar si es chat abierto
|
|
79
|
+
if (company.statusChat == "closed") jsxClosedChats.push(itemChat);
|
|
80
|
+
else jsxOpenChats.push(itemChat);
|
|
81
|
+
}
|
|
82
|
+
setOpenChats(jsxOpenChats);
|
|
83
|
+
setClosedChats(jsxClosedChats);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<Container>
|
|
89
|
+
{openChats.length !== 0 && (
|
|
90
|
+
<section>
|
|
91
|
+
<div className="container-headerChats">
|
|
92
|
+
<Tooltip
|
|
93
|
+
className={"tooltip-title"}
|
|
94
|
+
position={"topCenter"}
|
|
95
|
+
addArrow={false}
|
|
96
|
+
transitionType={"zoom"}
|
|
97
|
+
followCursor={false}
|
|
98
|
+
componentTooltip={
|
|
99
|
+
<ContainerTooltip>
|
|
100
|
+
<label className="label-title"> Chats abiertos </label>
|
|
101
|
+
<label className="label-message">{`De acuerdo al estatus
|
|
102
|
+
actual del producto, puedes establecer una conversación
|
|
103
|
+
con estas compañias`}</label>
|
|
104
|
+
</ContainerTooltip>
|
|
105
|
+
}
|
|
106
|
+
>
|
|
107
|
+
<label> Chats abiertos </label>
|
|
108
|
+
</Tooltip>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="container-bodyChats">{openChats}</div>
|
|
111
|
+
</section>
|
|
112
|
+
)}
|
|
113
|
+
|
|
114
|
+
{closedChats.length !== 0 && (
|
|
115
|
+
<section>
|
|
116
|
+
<div className="container-headerChats">
|
|
117
|
+
<Tooltip
|
|
118
|
+
className={"tooltip-title"}
|
|
119
|
+
position={"topCenter"}
|
|
120
|
+
addArrow={false}
|
|
121
|
+
transitionType={"zoom"}
|
|
122
|
+
followCursor={false}
|
|
123
|
+
componentTooltip={
|
|
124
|
+
<ContainerTooltip>
|
|
125
|
+
<label className="label-title"> Chats cerrados </label>
|
|
126
|
+
<label className="label-message">{`Las conversaciones
|
|
127
|
+
con estas compañias han finalizado debido al cambio de
|
|
128
|
+
estatus, sigue el flujo de trabajo con tus chats abiertos`}</label>
|
|
129
|
+
</ContainerTooltip>
|
|
130
|
+
}
|
|
131
|
+
>
|
|
132
|
+
<label> Chats cerrados </label>
|
|
133
|
+
</Tooltip>
|
|
134
|
+
</div>
|
|
135
|
+
<div className="container-bodyChats">{closedChats}</div>
|
|
136
|
+
</section>
|
|
137
|
+
)}
|
|
138
|
+
</Container>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { GlobalColors, FontFamily } from "../../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-height: 100%;
|
|
7
|
+
flex-grow: 2;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: flex-start;
|
|
11
|
+
gap: 30px;
|
|
12
|
+
background: white;
|
|
13
|
+
padding: 20px;
|
|
14
|
+
overflow: auto;
|
|
15
|
+
//border: 1px solid red;
|
|
16
|
+
|
|
17
|
+
section {
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 15px;
|
|
22
|
+
|
|
23
|
+
// container del nombre de la seccion con su icono info
|
|
24
|
+
.container-headerChats {
|
|
25
|
+
width: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
flex-wrap: nowrap;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: 5px;
|
|
31
|
+
|
|
32
|
+
.tooltip-title {
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
|
|
35
|
+
label {
|
|
36
|
+
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
37
|
+
font-size: 15px;
|
|
38
|
+
text-align: left;
|
|
39
|
+
color: #262626;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// container de la lista de los items chats de la seccion
|
|
45
|
+
.container-bodyChats {
|
|
46
|
+
width: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 10px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
export const ContainerItemChat = styled.div`
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-width: min-content;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
gap: 20px;
|
|
62
|
+
background: #f7f7fc;
|
|
63
|
+
padding: 15px;
|
|
64
|
+
border-radius: 10px;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
transition: background 0.25s;
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
cursor: inherit;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// imagen del logo de la compañia
|
|
73
|
+
.img-logoCompany {
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
height: 34px;
|
|
77
|
+
width: 34px;
|
|
78
|
+
|
|
79
|
+
.icon-logoCompany {
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// container de las etiquetas "name" y "lastDate"
|
|
86
|
+
.container-info {
|
|
87
|
+
flex-grow: 2;
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: flex-start;
|
|
91
|
+
gap: 4px;
|
|
92
|
+
|
|
93
|
+
.label-name {
|
|
94
|
+
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
95
|
+
font-size: 15px;
|
|
96
|
+
text-align: left;
|
|
97
|
+
color: #262626;
|
|
98
|
+
}
|
|
99
|
+
.label-lastDate {
|
|
100
|
+
font-family: ${FontFamily.RobotoRegular}, sans-serif;
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
text-align: left;
|
|
103
|
+
color: #b3b3b3;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.container-indicators {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 7px;
|
|
112
|
+
|
|
113
|
+
// label "Interno"
|
|
114
|
+
.label-ownCompany {
|
|
115
|
+
padding: 5px 10px;
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
font-family: ${FontFamily.RobotoRegular}, sans-serif;
|
|
118
|
+
font-size: 10px;
|
|
119
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
120
|
+
color: #707070;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// cuando el item chat tenga el cursor
|
|
125
|
+
&:hover {
|
|
126
|
+
background-color: #d7d7dd;
|
|
127
|
+
|
|
128
|
+
.container-info {
|
|
129
|
+
.label-lastDate {
|
|
130
|
+
color: #959292;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
.label-ownCompany {
|
|
136
|
+
background-color: ;
|
|
137
|
+
}*/
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
// container con 2 labels "label-title" y "label-message"
|
|
142
|
+
export const ContainerTooltip = styled.div`
|
|
143
|
+
min-width: min-content;
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: flex-start;
|
|
147
|
+
gap: 5px;
|
|
148
|
+
background: transparent;
|
|
149
|
+
|
|
150
|
+
.label-title {
|
|
151
|
+
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
152
|
+
font-size: 12px;
|
|
153
|
+
text-align: left;
|
|
154
|
+
color: #262626;
|
|
155
|
+
}
|
|
156
|
+
.label-message {
|
|
157
|
+
font-family: ${FontFamily.RobotoRegular}, sans-serif;
|
|
158
|
+
font-size: 11px;
|
|
159
|
+
text-align: left;
|
|
160
|
+
color: #262626;
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ContainerItems } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/organisms/Chat/ContainerItems",
|
|
5
|
+
component: ContainerItems,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <ContainerItems {...args} />;
|
|
9
|
+
|
|
10
|
+
// items de prueba
|
|
11
|
+
const items = {
|
|
12
|
+
1: {
|
|
13
|
+
date: "2022-10-13 10:10:00",
|
|
14
|
+
type: "message",
|
|
15
|
+
value: "mensaje 1 user10",
|
|
16
|
+
userId: 10,
|
|
17
|
+
},
|
|
18
|
+
2: {
|
|
19
|
+
date: "2022-10-12 13:19:00",
|
|
20
|
+
type: "message",
|
|
21
|
+
value: "mensaje 1 user20",
|
|
22
|
+
userId: 20,
|
|
23
|
+
},
|
|
24
|
+
3: {
|
|
25
|
+
date: "2022-10-12 12:33:00",
|
|
26
|
+
type: "comment",
|
|
27
|
+
value: "comentario 1 user20",
|
|
28
|
+
userId: 20,
|
|
29
|
+
},
|
|
30
|
+
4: {
|
|
31
|
+
date: "2022-10-12 11:56:00",
|
|
32
|
+
type: "comment",
|
|
33
|
+
value: "comentario 1 user30",
|
|
34
|
+
userId: 30,
|
|
35
|
+
},
|
|
36
|
+
5: {
|
|
37
|
+
date: "2022-10-12 8:41:00",
|
|
38
|
+
type: "statusService",
|
|
39
|
+
value: "La sección imágenes ha sido validada",
|
|
40
|
+
userId: 20,
|
|
41
|
+
},
|
|
42
|
+
6: {
|
|
43
|
+
date: "2022-10-11 14:58:00",
|
|
44
|
+
type: "img",
|
|
45
|
+
value: "84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg",
|
|
46
|
+
userId: 10,
|
|
47
|
+
},
|
|
48
|
+
7: {
|
|
49
|
+
date: "2022-10-10 16:12:00",
|
|
50
|
+
type: "img",
|
|
51
|
+
value: `84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg`,
|
|
52
|
+
userId: 30,
|
|
53
|
+
},
|
|
54
|
+
8: {
|
|
55
|
+
date: "2022-10-10 15:55:00",
|
|
56
|
+
type: "statusArticle",
|
|
57
|
+
value: "El estatus cambio a Aprobado Coordinador",
|
|
58
|
+
userId: 20,
|
|
59
|
+
},
|
|
60
|
+
9: {
|
|
61
|
+
date: "2022-10-10 9:15:00",
|
|
62
|
+
type: "comment",
|
|
63
|
+
value: "comentario 1 user10",
|
|
64
|
+
userId: 10,
|
|
65
|
+
},
|
|
66
|
+
10: {
|
|
67
|
+
date: "2022-10-9 6:24:00",
|
|
68
|
+
type: "file",
|
|
69
|
+
value:
|
|
70
|
+
"84300/1/chat/acuse RFC-8b2eb177-5bfc-4266-9b26-4e7297880594-9e2e5853-4697-442a-8ff7-3b7a1ede0856.pdf",
|
|
71
|
+
userId: 10,
|
|
72
|
+
},
|
|
73
|
+
11: {
|
|
74
|
+
date: "2022-10-9 4:29:00",
|
|
75
|
+
type: "file",
|
|
76
|
+
value: "84300/1/chat/noExiste.docx",
|
|
77
|
+
userId: 30,
|
|
78
|
+
},
|
|
79
|
+
12: {
|
|
80
|
+
date: "2022-10-9 2:39:00",
|
|
81
|
+
type: "file",
|
|
82
|
+
value: "84300/1/chat/noExiste2.xlsx",
|
|
83
|
+
userId: 20,
|
|
84
|
+
},
|
|
85
|
+
13: {
|
|
86
|
+
date: "2022-10-8 23:46:00",
|
|
87
|
+
type: "file",
|
|
88
|
+
value: "84300/1/chat/noExiste3.csv",
|
|
89
|
+
userId: 20,
|
|
90
|
+
},
|
|
91
|
+
14: {
|
|
92
|
+
date: "2022-10-8 23:22:00",
|
|
93
|
+
type: "file",
|
|
94
|
+
value: "84300/1/chat/noExiste4.pptx",
|
|
95
|
+
userId: 30,
|
|
96
|
+
},
|
|
97
|
+
15: {
|
|
98
|
+
date: "2022-10-8 21:01:00",
|
|
99
|
+
type: "file",
|
|
100
|
+
value: "84300/1/chat/noExiste5.zip",
|
|
101
|
+
userId: 10,
|
|
102
|
+
},
|
|
103
|
+
16: {
|
|
104
|
+
date: "2022-10-8 20:11:00",
|
|
105
|
+
type: "file",
|
|
106
|
+
value: "84300/1/chat/noExiste6.txt",
|
|
107
|
+
userId: 10,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// users de prueba
|
|
112
|
+
const users = {
|
|
113
|
+
10: { name: "Pedro Castillo", companyId: 100 },
|
|
114
|
+
20: { name: "Ana Carranza", companyId: 200 },
|
|
115
|
+
30: { name: "Javier Aguayo", companyId: 100 },
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// companies de prueba multiple
|
|
119
|
+
const companies = {
|
|
120
|
+
100: { name: "Fábrica", statusChat: "enabled" },
|
|
121
|
+
200: { name: "Proveedor", statusChat: "current" },
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const exampleChat = Template.bind({});
|
|
125
|
+
exampleChat.args = {
|
|
126
|
+
chatData: {
|
|
127
|
+
items,
|
|
128
|
+
users,
|
|
129
|
+
companies,
|
|
130
|
+
},
|
|
131
|
+
currentUser: { id: 10, companyId: 100 },
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const emptyChat = Template.bind({});
|
|
135
|
+
emptyChat.args = {
|
|
136
|
+
chatData: {
|
|
137
|
+
items: [],
|
|
138
|
+
users: [],
|
|
139
|
+
companies: [],
|
|
140
|
+
},
|
|
141
|
+
currentUser: { id: 10, companyId: 100 },
|
|
142
|
+
};
|