Skip to content

Instantly share code, notes, and snippets.

@sendz
Created January 25, 2019 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendz/e2a6fc100dc8b1cbc316ce592c57ef23 to your computer and use it in GitHub Desktop.
Save sendz/e2a6fc100dc8b1cbc316ce592c57ef23 to your computer and use it in GitHub Desktop.
Chat App Box with Props
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