@cleartrip/talos-previous-chat-listing 12.0.0 → 12.0.1

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/package.json CHANGED
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "name": "@cleartrip/talos-previous-chat-listing",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "Previous Chat Listing Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/talos-previous-chat-listing.cjs.js",
7
7
  "jsnext:main": "dist/talos-previous-chat-listing.esm.js",
8
8
  "module": "dist/talos-previous-chat-listing.esm.js",
9
+ "react-native": "src/index.ts",
9
10
  "sideEffects": false,
10
11
  "browser": {
11
12
  "./dist/talos-previous-chat-listing.esm.js": "./dist/talos-previous-chat-listing.browser.esm.js",
12
13
  "./dist/talos-previous-chat-listing.cjs.js": "./dist/talos-previous-chat-listing.browser.cjs.js"
13
14
  },
14
15
  "files": [
15
- "dist"
16
+ "dist",
17
+ "src"
16
18
  ],
17
19
  "dependencies": {
18
- "@cleartrip/talos-widget-types": "1.11.0"
20
+ "@cleartrip/ct-design-style-manager": "5.32.0",
21
+ "@cleartrip/talos-widget-types": "11.1.1"
19
22
  },
20
23
  "peerDependencies": {
21
- "@cleartrip/ct-design-components": "3.21.0-SNAPSHOT-260806.0",
22
- "@cleartrip/talos-widget-manager": "1.11.0"
24
+ "@cleartrip/talos-widget-manager": "11.1.1"
23
25
  },
24
26
  "publishConfig": {
25
27
  "access": "public"
@@ -0,0 +1,34 @@
1
+ import { Box, Typography } from "@cleartrip/ct-design-components";
2
+ import { WidgetGenerator } from "@cleartrip/talos-widget-manager";
3
+ import { type IWidgetProps } from "@cleartrip/talos-widget-types";
4
+
5
+ import { previousChatListingStyles } from "./style";
6
+
7
+ import { IPreviousChatListingProps } from "./type";
8
+
9
+ const PreviousChatListing = (props: IWidgetProps<IPreviousChatListingProps>) => {
10
+ const { data: { list = [] } = {} } = props ?? {};
11
+
12
+ return (
13
+ <Box boxSize="medium" styleConfig={{ root: [previousChatListingStyles.root] }}>
14
+ {list.map((item, idx) => {
15
+ const { title, chats = [] } = item;
16
+ const key = `${title}_${idx}`;
17
+ return (
18
+ <Box boxSize="tiny" key={key}>
19
+ <Typography variant="L2">{title}</Typography>
20
+ {chats.map((chat, idx) => {
21
+ const { type, data, events } = chat;
22
+ const key = `${title}_${idx}`;
23
+ return (
24
+ <WidgetGenerator key={key} type={type} data={data} events={events} />
25
+ )
26
+ })}
27
+ </Box>
28
+ )
29
+ })}
30
+ </Box>
31
+ )
32
+ }
33
+
34
+ export default PreviousChatListing;
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default as PreviousChatListing } from "./PreviousChatListing";
2
+ export * from "./type";
package/src/style.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { makeStyles } from "@cleartrip/ct-design-style-manager";
2
+
3
+ export const previousChatListingStyles = makeStyles((theme) => ({
4
+ root: {
5
+ paddingTop: theme.spacing[6],
6
+ paddingBottom: theme.spacing[4],
7
+ paddingLeft: theme.spacing[4],
8
+ paddingRight: theme.spacing[4],
9
+ },
10
+ }));
package/src/type.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { IWidget } from "@cleartrip/talos-widget-types";
2
+
3
+ export interface IPreviousChatList {
4
+ title: string;
5
+ chats: IWidget[];
6
+ }
7
+
8
+ export interface IPreviousChatListingProps {
9
+ list: IPreviousChatList[];
10
+ }