-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improvements after removing simplebar dep (#2903)
This is a continuation of: #2900 Several things done here: * Remove `scrollable-content` generic component and create it for each scrollable div. * Add notable refs (`webchatRef`, `chatAreaRef`, `headerRef`) in `WebchatContext` to be accessed from different parts of the coee * Remove JS commented code already migrated to TS. * Reduce `util/dom.js` in favour of using new hooks. * Migrate from JS to TS: * `device-adapter` * `scrollbar-controller` * `webchat-resizer` * Simplify `WebchatHeader` component * New hooks: * `useScrollToBottom`: centralize logic for scrolling to the end of scrollable messages list container * `useVirtualKeyboardDetection`: detect whether virtual keyboard is open or not (iOS/Safari) * `useWebchatDimensions`: recalculation of webchat / chat area heights * Create a new component `WebchatChatArea` * Set textarea fontsize to 16px to be consistent with the rest of styles and avoid auto-focusing issues on iOS. --------- Co-authored-by: Oriol Raventos <[email protected]>
- Loading branch information
1 parent
24dd467
commit 64b9c00
Showing
27 changed files
with
539 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
packages/botonic-react/src/webchat/components/scrollable-content.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
packages/botonic-react/src/webchat/devices/device-adapter.js
This file was deleted.
Oops, something went wrong.
109 changes: 0 additions & 109 deletions
109
packages/botonic-react/src/webchat/devices/scrollbar-controller.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.