diff --git a/ui/src/component/ConfirmDialog.tsx b/ui/src/component/ConfirmDialog.tsx index 55611c7..73bc8b4 100644 --- a/ui/src/component/ConfirmDialog.tsx +++ b/ui/src/component/ConfirmDialog.tsx @@ -1,6 +1,6 @@ import Button from 'material-ui/Button'; import Dialog, {DialogActions, DialogContent, DialogContentText, DialogTitle} from 'material-ui/Dialog'; -import React, {Component} from 'react'; +import React from 'react'; interface IProps { title: string @@ -9,24 +9,21 @@ interface IProps { fOnSubmit: VoidFunction } -export default class ConfirmDialog extends Component { - public render() { - const {title, text, fClose, fOnSubmit} = this.props; - const submitAndClose = () => { - fOnSubmit(); - fClose(); - }; - return ( - - {title} - - {text} - - - - - - - ); - } -} +export default function ConfirmDialog({title, text, fClose, fOnSubmit}: IProps) { + const submitAndClose = () => { + fOnSubmit(); + fClose(); + }; + return ( + + {title} + + {text} + + + + + + + ); +} \ No newline at end of file diff --git a/ui/src/component/Container.tsx b/ui/src/component/Container.tsx index 6ad4cd5..01d8d34 100644 --- a/ui/src/component/Container.tsx +++ b/ui/src/component/Container.tsx @@ -13,15 +13,12 @@ interface IProps { style?: object, } -class Container extends React.Component, {}> { - public render() { - const {classes, children, style} = this.props; - return ( - - {children} - - ); - } -} +const Container: React.SFC> = ({classes, children, style}) => { + return ( + + {children} + + ); +}; export default withStyles(styles)(Container); diff --git a/ui/src/component/LoadingSpinner.tsx b/ui/src/component/LoadingSpinner.tsx index 060b13e..bed8439 100644 --- a/ui/src/component/LoadingSpinner.tsx +++ b/ui/src/component/LoadingSpinner.tsx @@ -1,18 +1,14 @@ import Grid from 'material-ui/Grid'; import {CircularProgress} from 'material-ui/Progress'; -import React, {Component} from 'react'; +import React from 'react'; import DefaultPage from './DefaultPage'; -class LoadingSpinner extends Component { - public render() { - return ( - - - - - - ); - } -} - -export default LoadingSpinner; +export default function LoadingSpinner() { + return ( + + + + + + ); +}; diff --git a/ui/src/component/Message.tsx b/ui/src/component/Message.tsx index 0f6a156..9ca8ee9 100644 --- a/ui/src/component/Message.tsx +++ b/ui/src/component/Message.tsx @@ -3,7 +3,7 @@ import Delete from 'material-ui-icons/Delete'; import IconButton from 'material-ui/IconButton'; import {withStyles} from 'material-ui/styles'; import Typography from 'material-ui/Typography'; -import React, {Component} from 'react'; +import React from 'react'; import TimeAgo from 'react-timeago'; import Container from './Container'; @@ -42,32 +42,28 @@ interface IProps { fDelete: VoidFunction } -class Message extends Component { - public render() { - const {fDelete, classes, title, date, content, image} = this.props; - - return ( -
- -
- app logo +function Message({fDelete, classes, title, date, content, image}: IProps & Style) { + return ( +
+ +
+ app logo +
+
+
+ + {title} + + + + +
-
-
- - {title} - - - - - -
- {content} -
- -
- ); - } + {content} +
+ +
+ ); } export default withStyles(styles)(Message);