Created
January 25, 2019 06:49
-
-
Save sendz/e2a6fc100dc8b1cbc316ce592c57ef23 to your computer and use it in GitHub Desktop.
Chat App Box with Props
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
import * as React from 'react'; | |
interface IProps { | |
sendMessage: (message: string) => void; | |
} | |
export default class ChatBox extends React.Component<IProps> { | |
public render() { | |
const containerStyle: React.CSSProperties = { | |
bottom: 30, | |
display: 'flex', | |
position: 'absolute', | |
width: '100%' | |
}; | |
const messageBoxStyle: React.CSSProperties = { | |
height: '10vh', | |
marginLeft: '2%', | |
marginRight: '2%', | |
width: '88%' | |
}; | |
const sendButtonStyle: React.CSSProperties = { | |
height: '10vh', | |
marginRight: '2%', | |
width: '6%' | |
}; | |
return ( | |
<div style={containerStyle}> | |
<textarea | |
style={messageBoxStyle} | |
/> | |
<button | |
style={sendButtonStyle} | |
> | |
Send | |
</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment