[Improvement] Improve comment list & edi profile dialog frame size

This commit is contained in:
Qolzam
2018-02-25 10:28:57 +07:00
parent 13bd1e0e65
commit e84e39d439
3 changed files with 24 additions and 10 deletions

View File

@@ -2,6 +2,9 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
// - Material UI
import { withStyles } from 'material-ui/styles'
import List, { ListItem, ListItemText } from 'material-ui/List' import List, { ListItem, ListItemText } from 'material-ui/List'
// - Import app components // - Import app components
@@ -15,6 +18,14 @@ import { Comment } from 'core/domain/comments'
// - Import actions // - Import actions
const styles = (theme: any) => ({
list: {
width: '100%',
maxHeight: 290,
overflowY: 'auto'
}
})
/** /**
* Create component class * Create component class
*/ */
@@ -88,17 +99,11 @@ export class CommentListComponent extends Component<ICommentListComponentProps,
* @return {react element} return the DOM which rendered by component * @return {react element} return the DOM which rendered by component
*/ */
render () { render () {
const {classes} = this.props
const styles: any = {
list: {
width: '100%',
maxHeight: 450
}
}
return ( return (
<List style={styles.list}> <List className={classes.list}>
{this.commentList()} {this.commentList()}
</List> </List>
@@ -133,4 +138,4 @@ const mapStateToProps = (state: any, ownProps: ICommentListComponentProps) => {
} }
// - Connect component to redux store // - Connect component to redux store
export default connect(mapStateToProps, mapDispatchToProps)(CommentListComponent as any) export default connect(mapStateToProps, mapDispatchToProps)((withStyles(styles as any)(CommentListComponent as any))as any)

View File

@@ -35,4 +35,9 @@ export interface ICommentListComponentProps {
* @memberof ICommentListComponentProps * @memberof ICommentListComponentProps
*/ */
disableComments: boolean disableComments: boolean
/**
* Styles
*/
classes?: any
} }

View File

@@ -48,6 +48,10 @@ const styles = (theme: any) => ({
dialogTitle: { dialogTitle: {
padding: 0 padding: 0
}, },
dialogContentRoot: {
maxHeight: 520,
minWidth: 330
},
fullPageXs: { fullPageXs: {
[theme.breakpoints.down('xs')]: { [theme.breakpoints.down('xs')]: {
width: '100%', width: '100%',
@@ -328,7 +332,7 @@ export class EditProfileComponent extends Component<IEditProfileComponentProps,
onClose={this.props.onRequestClose} onClose={this.props.onRequestClose}
maxWidth='sm' maxWidth='sm'
> >
<DialogContent> <DialogContent className={classes.dialogContentRoot}>
{/* Banner */} {/* Banner */}
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<ImgCover width='100%' height='250px' borderRadius='2px' fileName={this.state.banner} /> <ImgCover width='100%' height='250px' borderRadius='2px' fileName={this.state.banner} />