-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Peter Souza
authored and
Peter Souza
committed
Jul 21, 2021
1 parent
9cbd108
commit c3a0259
Showing
40 changed files
with
295 additions
and
425 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#APP_CONFIG | ||
REACT_APP_NLU_ENDPOINT=https://your-api/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<h1 align="center" style="border-bottom: none;">💬 React Chatbot UI</h1> | ||
<h4 align="center">This React app, is a fully customizable web-based client for Chatbots.</h4> | ||
<p align="center"> | ||
<img src="./docs/images/app_sample_0.png" alt="React chat logo" width="240"/> | ||
</p> | ||
|
||
#### A solid foundation | ||
|
||
React, Redux, Ant Design Icons. A perfect combination of best frameworks. | ||
|
||
<p align="center"> | ||
<img src="./docs/images/icon-react.png" alt="React chat logo" width="60px"/> | ||
<img src="./docs/images/icon-redux.png" alt="React chat logo" width="60px"/> | ||
<img src="./docs/images/icon-antdesign.png" alt="React chat logo" width="60px"/> | ||
</p> | ||
|
||
#### Responsive | ||
|
||
<p align="center"> | ||
<img src="./docs/images/responsive-view.gif" alt="Responsive view gif" width="240"/> | ||
</p> | ||
|
||
#### How to use | ||
|
||
```bash | ||
$ git clone https://github.com/PeterPimentel/react-web-chat | ||
$ cd react-web-chat/ | ||
$ npm install | ||
``` | ||
|
||
1. Rename the file `.env.example` to `.env` | ||
1. Run the app in the development mode `npm start`. | ||
1. Open [http://localhost:3000](http://localhost:3000) to view it full screen in the browser. | ||
1. It is possible to see in the file `samples/embedded-chat/index.html` how to embedded the chat into your page. | ||
|
||
<span style="color:#660000">Please note this app is only the UI, you need implement the back-end app to connect to the NLU service.<span> | ||
|
||
--- | ||
|
||
#### Customize | ||
|
||
##### 🌈 Colors | ||
|
||
In the `src/styles/colors.css` you can customize the colors of your chat. | ||
|
||
--- | ||
|
||
😃 If you like this project and used it in yout chatbot please let me know! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="./reactWebChat.css"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<div id="ps-web-chat-app"> | ||
<iframe class="ps-web-chat-position ps-web-chat-iframe scale-in-br" src="http://localhost:3000"></iframe> | ||
<div id="ps-chat-skeleton" class="ps-web-chat-position scale-in-br"></div> | ||
<button class="ps-button-circle"> | ||
<img id="ps-button-chat-image" src="https://ssl.gstatic.com/bt/C3341AA7A1A076756462EE2E5CD71C11/2x/btw_ic_speeddial_white_24dp_2x.png" alt="" /> | ||
</button> | ||
</div> | ||
<script src="./reactWebChat.js" type="text/javascript"></script> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<link rel="stylesheet" href="./reactWebChat.css" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<div id="ps-web-chat-app"> | ||
<iframe class="ps-web-chat-position ps-web-chat-iframe scale-in-br" src="http://localhost:3000"></iframe> | ||
<div id="ps-chat-skeleton" class="ps-web-chat-position scale-in-br"></div> | ||
<button class="ps-button-circle"> | ||
<img | ||
id="ps-button-chat-image" | ||
src="https://ssl.gstatic.com/bt/C3341AA7A1A076756462EE2E5CD71C11/2x/btw_ic_speeddial_white_24dp_2x.png" | ||
alt="" | ||
/> | ||
</button> | ||
</div> | ||
<script src="./reactWebChat.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.chat { | ||
padding: 64px 0 64px 0; | ||
padding: 72px 0; | ||
height: 100%; | ||
width: 100%; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.toast { | ||
position: fixed; | ||
left: 0; | ||
top: 64px; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
width: 100%; | ||
height: 32px; | ||
|
||
border-radius: 0 0 10px 10px; | ||
background-color: var(--grey-strong); | ||
} | ||
|
||
.message { | ||
color: var(--error); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { FunctionComponent, useEffect } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { modalToggle } from '../../redux/layoutStore'; | ||
import { getToastState } from '../../redux/selectors/layout'; | ||
|
||
import styles from './ConnectedToast.module.css'; | ||
|
||
export const ConnectedToast: FunctionComponent = () => { | ||
const toastState = useSelector(getToastState); | ||
const dispatch = useDispatch(); | ||
|
||
//Automatic Toast dismmiss | ||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
dispatch( | ||
modalToggle({ | ||
visible: false, | ||
content: '', | ||
}), | ||
); | ||
}, 7000); | ||
return () => { | ||
clearInterval(interval); | ||
}; | ||
}, []); | ||
|
||
if (!toastState.visible) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className={styles.toast}> | ||
<p className={`${styles.message} typo-h60`}>{toastState.content}</p> | ||
</div> | ||
); | ||
}; |
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 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
Oops, something went wrong.