Skip to content

Commit

Permalink
Deploy commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKottas committed Jun 4, 2021
1 parent 9a27a0e commit 2d79af7
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = {
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended',
],
rules: {
'react/no-children-prop': 'off',
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false
"useTabs": false,
"arrowParens": "avoid"
}
File renamed without changes.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><!--[if lt IE 7]> <html class="ie6" lang="en"> <![endif]--><!--[if IE 7]> <html class="ie7" lang="en"> <![endif]--><!--[if IE 8]> <html class="ie8" lang="en"> <![endif]--><!--[if IE 9]> <html class="ie9" lang="en"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]--><head><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>GuestBell chat</title><link rel="apple-touch-icon" sizes="180x180" href="dist/icons/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="dist/icons/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="dist/icons/favicon-16x16.png"/><link rel="manifest" href="dist/icons/manifest.json?ver=1"/><link rel="mask-icon" href="dist/icons/safari-pinned-tab.svg" color="#10bdc7"/><link rel="shortcut icon" href="dist/icons/favicon.ico"/><meta name="msapplication-config" content="dist/icons/browserconfig.xml"/><meta name="theme-color" content="#323232"/><link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"/><script defer="defer" src="/react-bell-chat/dist/main.c91415e8f22ebceb86a6.js"></script><link href="/react-bell-chat/dist/main.c91415e8f22ebceb86a6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="chat-ui"></div></body></html>
<!doctype html><!--[if lt IE 7]> <html class="ie6" lang="en"> <![endif]--><!--[if IE 7]> <html class="ie7" lang="en"> <![endif]--><!--[if IE 8]> <html class="ie8" lang="en"> <![endif]--><!--[if IE 9]> <html class="ie9" lang="en"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]--><head><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>GuestBell chat</title><link rel="apple-touch-icon" sizes="180x180" href="dist/icons/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="dist/icons/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="dist/icons/favicon-16x16.png"/><link rel="manifest" href="dist/icons/manifest.json?ver=1"/><link rel="mask-icon" href="dist/icons/safari-pinned-tab.svg" color="#10bdc7"/><link rel="shortcut icon" href="dist/icons/favicon.ico"/><meta name="msapplication-config" content="dist/icons/browserconfig.xml"/><meta name="theme-color" content="#323232"/><link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"/><script defer="defer" src="/react-bell-chat/dist/main.a64367dc5d5068bdfc33.js"></script><link href="/react-bell-chat/dist/main.a64367dc5d5068bdfc33.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="chat-ui"></div></body></html>
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/demo/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,12 @@ const App: React.FC = () => {
}));
} else {
handleIsTyping(1);
let _firstAuthorTimer = window.setInterval(() => handleIsTyping(1), 4000);
const _firstAuthorTimer = window.setInterval(
() => handleIsTyping(1),
4000
);
handleIsTyping(2);
let _secondAuthorTimer = window.setInterval(
const _secondAuthorTimer = window.setInterval(
() => handleIsTyping(2),
5200
);
Expand Down
2 changes: 2 additions & 0 deletions src/lib/ChatBubble/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export function ChatBubble<T = string>(props: ChatBubbleProps<T>) {
userCreatedOn,
recipientCreatedOn,
isSendIconColor,
isSend,
loadingSpinnerColor,
lastSeenByContainer,
} = styles ?? {};
Expand Down Expand Up @@ -231,6 +232,7 @@ export function ChatBubble<T = string>(props: ChatBubbleProps<T>) {
<span
style={{
...defaultChatBubbleStyles.isSend,
...isSend,
}}
className={classnames(
defaultChatBubbleClasses.isSend,
Expand Down
19 changes: 10 additions & 9 deletions src/lib/ChatFeed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ export class ChatFeed<T = string>
if (
(this.props.messages.length !== prevProps.messages.length ||
this.props.authors?.some?.(
(a) =>
a =>
a.isTyping !==
prevProps.authors?.find?.((_a) => a.id === _a.id)?.isTyping
prevProps.authors?.find?.(_a => a.id === _a.id)?.isTyping
)) &&
snapshot &&
snapshot.wasScrolledToBottom
Expand Down Expand Up @@ -273,11 +273,11 @@ export class ChatFeed<T = string>
// First group by days
const groups = groupBy(
messages,
(item) => item.createdOn && item.createdOn.toDateString()
item => item.createdOn && item.createdOn.toDateString()
);
let messageNodes: React.ReactNode[] = [];
let jsxKey = 0;
Object.keys(groups).forEach((key) => {
Object.keys(groups).forEach(key => {
let group = [];
const messagesGroup = groups[key];
if (
Expand Down Expand Up @@ -305,7 +305,7 @@ export class ChatFeed<T = string>
const messageGroup = group;
const author =
this.props.authors &&
this.props.authors.filter((a) => a.id === message.authorId)[0];
this.props.authors.filter(a => a.id === message.authorId)[0];
group = [];
jsxKey++;
return (
Expand Down Expand Up @@ -350,7 +350,8 @@ export class ChatFeed<T = string>
}

render() {
let { styles, classes, isTypingStyles, isTypingClasses } = this.props;
let { styles, classes } = this.props;
const { isTypingStyles, isTypingClasses } = this.props;
if (!styles) {
styles = {};
}
Expand All @@ -368,7 +369,7 @@ export class ChatFeed<T = string>
const typingAuthors =
this.props.authors &&
this.props.authors.filter(
(a) => a.isTyping && a.id !== this.props.yourAuthorId
a => a.isTyping && a.id !== this.props.yourAuthorId
);

return (
Expand Down Expand Up @@ -427,7 +428,7 @@ export class ChatFeed<T = string>

private async onLoadOldMessages() {
if (!this.state.isLoadingMessages && this.props.hasOldMessages) {
await new Promise<void>((resolve) => {
await new Promise<void>(resolve => {
this.setState(
{
isLoadingMessages: true,
Expand All @@ -438,7 +439,7 @@ export class ChatFeed<T = string>
if (this.props.onLoadOldMessages) {
await this.props.onLoadOldMessages();
}
await new Promise<void>((resolve) => {
await new Promise<void>(resolve => {
this.setState(
{
isLoadingMessages: false,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/LastSeenAvatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface LastSeenAvatarProps<T = string> {
}

function LastSeenAvatar<T = string>(props: LastSeenAvatarProps<T>) {
let { styles, classes, index, mouseOver, author } = props;
const { styles, classes, index, mouseOver, author } = props;

const style = React.useMemo(
() => ({
Expand Down

0 comments on commit 2d79af7

Please sign in to comment.