wca-designsystem 1.0.105 → 1.0.107

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,5 +1,5 @@
1
1
  {
2
- "version": "1.0.105",
2
+ "version": "1.0.107",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -6,7 +6,7 @@ import {
6
6
  TypingIndicator,
7
7
  Avatar,
8
8
  } from '@chatscope/chat-ui-kit-react'
9
- import React from 'react'
9
+ import React, { useEffect, useRef } from 'react'
10
10
  import { BotaoChat, ChatWrapper } from './styles'
11
11
  import { Flex } from '@mantine/core'
12
12
  import icon from '../../../assets/imagens/WCA/wca_inteligencia_comercial_logo.png'
@@ -70,6 +70,13 @@ const ChatBot = ({
70
70
  }
71
71
  }
72
72
 
73
+ const endOfMessagesRef = useRef<HTMLDivElement | null>(null)
74
+ useEffect(() => {
75
+ endOfMessagesRef.current?.scrollIntoView({
76
+ behavior: 'smooth',
77
+ })
78
+ }, [messages])
79
+
73
80
  return (
74
81
  <ChatWrapper>
75
82
  <ChatContainer>
@@ -123,6 +130,8 @@ const ChatBot = ({
123
130
  </Message>
124
131
  )
125
132
  )}
133
+
134
+ <div style={{marginTop: '10px'}} ref={endOfMessagesRef} />
126
135
  </MessageList>
127
136
 
128
137
  <MessageInput