-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Wolox/responsive-full-view
Responsive full view
- Loading branch information
Showing
21 changed files
with
180 additions
and
45 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
13 changes: 11 additions & 2 deletions
13
src/components/Widget/components/Conversation/components/Header/index.js
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,17 +1,26 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import close from 'assets/clear-button.svg'; | ||
import './style.scss'; | ||
|
||
const Header = ({ title, subtitle }) => | ||
const Header = ({ title, subtitle, toggleChat, showCloseButton }) => | ||
<div className="header"> | ||
{ | ||
showCloseButton && | ||
<button className="close-button" onClick={toggleChat}> | ||
<img src={close} className="close" alt="close" /> | ||
</button> | ||
} | ||
<h4 className="title">{title}</h4> | ||
<span>{subtitle}</span> | ||
</div>; | ||
|
||
Header.propTypes = { | ||
title: PropTypes.string, | ||
subtitle: PropTypes.string | ||
subtitle: PropTypes.string, | ||
toggleChat: PropTypes.func, | ||
showCloseButton: PropTypes.bool | ||
}; | ||
|
||
export default Header; |
41 changes: 37 additions & 4 deletions
41
src/components/Widget/components/Conversation/components/Header/style.scss
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,15 +1,48 @@ | ||
@import "variables.scss"; | ||
|
||
.header { | ||
text-align: center; | ||
background-color: $turqois-1; | ||
border-radius: 10px 10px 0 0; | ||
color: $white; | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
padding: 15px 0 25px; | ||
} | ||
|
||
.title { | ||
font-size: 24px; | ||
margin: 0; | ||
padding: 15px 0; | ||
} | ||
|
||
.close-button { | ||
display: none; | ||
} | ||
|
||
@media screen and (max-width: 800px) { | ||
.header { | ||
border-radius: 0; | ||
flex-shrink: 0; | ||
position: relative; | ||
} | ||
|
||
.title { | ||
font-size: 24px; | ||
margin: 0; | ||
padding: 15px; | ||
padding: 0 0 15px 0; | ||
} | ||
|
||
.close-button { | ||
background-color: $turqois-1; | ||
border: 0; | ||
display: block; | ||
position: absolute; | ||
right: 10px; | ||
top: 20px; | ||
width: 40px; | ||
} | ||
|
||
.close { | ||
width: 20px; | ||
height: 20px; | ||
} | ||
} |
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
8 changes: 5 additions & 3 deletions
8
src/components/Widget/components/Conversation/components/Sender/index.js
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,19 +1,21 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import send from 'assets/send_button.svg'; | ||
import './style.scss'; | ||
|
||
const Sender = ({ sendMessage, placeholder }) => | ||
const Sender = ({ sendMessage, placeholder, disabledInput }) => | ||
<form className="sender" onSubmit={sendMessage}> | ||
<input type="text" className="new-message" name="message" placeholder={placeholder} autoFocus autoComplete="off" /> | ||
<input type="text" className="new-message" name="message" placeholder={placeholder} disabled={disabledInput} autoFocus autoComplete="off" /> | ||
<button type="submit" className="send"> | ||
<img src={send} className="send-icon" alt="send" /> | ||
</button> | ||
</form>; | ||
|
||
Sender.propTypes = { | ||
sendMessage: PropTypes.func, | ||
placeholder: PropTypes.string | ||
placeholder: PropTypes.string, | ||
disabledInput: PropTypes.bool | ||
}; | ||
|
||
export default Sender; |
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
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
Oops, something went wrong.