@ethora/chat-component 24.10.11 → 24.10.16

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/README.md CHANGED
@@ -21,9 +21,9 @@ Note: scroll below for use cases and functionality break down of this Chat Compo
21
21
  2. specify a name for your project (e.g. "vite-project")
22
22
  3. select framework and variant (for example, React -> Typescript but may be different depending on your project requirements, it will work with plain Javascript too)
23
23
 
24
- <img src="https://github.com/user-attachments/assets/c5c45898-cc86-469c-947c-7ca9974fd649" width="500" />
24
+ <img src="./img/readme01.png" width="500" />
25
25
 
26
- <img src="https://github.com/user-attachments/assets/20b732d3-482d-4538-bb03-359a9beb8a51" width="500" />
26
+ <img src="./img/readme02.png" width="500" />
27
27
 
28
28
  4. cd vite-project _(use your name instead of "vite-project")_
29
29
  5. npm i
@@ -49,14 +49,14 @@ npm run dev
49
49
  ```
50
50
 
51
51
  you should see something like this:
52
- <br /><img src="https://github.com/user-attachments/assets/7a4022cc-ad95-4561-bf40-c097a6aaa94c" width="350" />
52
+ <br /><img src="./img/readme03.png" width="350" />
53
53
 
54
54
 
55
55
  8. Open http://localhost:5173/ in your browser
56
56
 
57
57
  Voilà - your chat app should work like so:
58
58
 
59
- <img src="https://github.com/user-attachments/assets/e4d05fd1-7dcc-438b-9bfd-895ec29b494a" width="600" />
59
+ <img src="./img/readme04.png" width="600" />
60
60
 
61
61
  ℹ️ Note: your Ethora App, User and Chat credentials are hard-coded and login screen is bypassed. This is done so that you can scaffold and test the functionality quickly.
62
62
  Leave this as is if you only need to demo or validate the chat functionality as part of your project.
@@ -11,3 +11,15 @@ export declare const SendIcon: ({ color, ...props }: {
11
11
  export declare const GoogleIcon: ({ ...props }: {
12
12
  [x: string]: any;
13
13
  }) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const MoreIcon: ({ color, ...props }: {
15
+ [x: string]: any;
16
+ color?: string;
17
+ }) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const SearchIcon: ({ color, ...props }: {
19
+ [x: string]: any;
20
+ color?: string;
21
+ }) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const NoMessages: ({ color, ...props }: {
23
+ [x: string]: any;
24
+ color?: string;
25
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
  interface AudioRecorderProps {
4
4
  setIsRecording: (state: boolean) => void;
5
5
  isRecording: boolean;
6
- handleSendClick: (audioBlob?: string) => void;
6
+ handleSendClick: (audioBlob?: any) => void;
7
7
  }
8
8
  declare const AudioRecorder: React.FC<AudioRecorderProps>;
9
9
  export default AudioRecorder;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
+ icon?: React.ReactNode;
5
+ animated?: boolean;
6
+ direction?: "left" | "right";
7
+ }
8
+ declare const SearchInput: React.FC<SearchInputProps>;
9
+ export { SearchInput };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface ChatHeaderAvatarProps {
4
+ name?: string;
5
+ onClick?: () => void;
6
+ size?: number;
7
+ }
8
+ export declare const ChatHeaderAvatar: React.FC<ChatHeaderAvatarProps>;
9
+ export {};
@@ -5,7 +5,7 @@ interface ChatRoomProps {
5
5
  roomJID?: string;
6
6
  defaultUser: User;
7
7
  isLoading?: boolean;
8
- defaultRoom: IRoom;
8
+ room: IRoom;
9
9
  CustomMessageComponent?: any;
10
10
  MainComponentStyles?: any;
11
11
  config?: IConfig;
@@ -2,15 +2,15 @@ import { default as React } from 'react';
2
2
  import { IConfig, IMessage, IRoom, User } from '../../types/types';
3
3
 
4
4
  interface MessageListProps<TMessage extends IMessage> {
5
- messages: TMessage[];
6
5
  CustomMessage?: React.ComponentType<{
7
- message: TMessage;
6
+ message: IMessage;
8
7
  isUser: boolean;
9
8
  }>;
10
9
  user: User;
11
10
  room: IRoom;
12
11
  loadMoreMessages: (chatJID: string, max: number, amount?: number) => Promise<void>;
12
+ loading: boolean;
13
13
  config?: IConfig;
14
14
  }
15
- declare const MessageList: <TMessage extends IMessage>({ messages, CustomMessage, user, loadMoreMessages, room, config, }: MessageListProps<TMessage>) => import("react/jsx-runtime").JSX.Element;
15
+ declare const MessageList: <TMessage extends IMessage>({ CustomMessage, user, loadMoreMessages, room, config, loading, }: MessageListProps<TMessage>) => import("react/jsx-runtime").JSX.Element;
16
16
  export default MessageList;
@@ -0,0 +1,2 @@
1
+ declare const NoMessagesPlaceholder: () => import("react/jsx-runtime").JSX.Element;
2
+ export default NoMessagesPlaceholder;
@@ -5,6 +5,7 @@ interface RoomListProps {
5
5
  chats: IRoom[];
6
6
  burgerMenu?: boolean;
7
7
  onRoomClick?: (chat: IRoom) => void;
8
+ activeJID: string;
8
9
  }
9
10
  declare const RoomList: React.FC<RoomListProps>;
10
11
  export default RoomList;
@@ -2,6 +2,14 @@ import { default as React } from 'react';
2
2
 
3
3
  interface SystemMessageProps {
4
4
  messageText: string;
5
+ colors?: {
6
+ primary?: string;
7
+ secondary?: string;
8
+ };
5
9
  }
10
+ export declare const CustomSystemMessageText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
11
+ primary?: string;
12
+ secondary?: string;
13
+ }>> & string;
6
14
  declare const SystemMessage: React.FC<SystemMessageProps>;
7
15
  export default SystemMessage;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface AvatarProps {
4
+ username?: string;
5
+ firstName?: string;
6
+ lastName?: string;
7
+ }
8
+ export declare const Avatar: React.FC<AvatarProps>;
9
+ export {};
@@ -4,7 +4,7 @@ import { IConfig } from '../../types/types';
4
4
  interface SendInputProps {
5
5
  sendMessage: (message: string) => void;
6
6
  isLoading: boolean;
7
- sendMedia: (data: any) => void;
7
+ sendMedia: (data: any, type: string) => void;
8
8
  config?: IConfig;
9
9
  onFocus?: () => void;
10
10
  onBlur?: () => void;