Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

이벤트 내용 new line 처리 추가 #109

Merged
merged 5 commits into from
Aug 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ yarn-debug.log*
yarn-error.log*
/.changelog
.npm/
.idea/
devtools/sh/
6 changes: 3 additions & 3 deletions src/main/webapp/app/components/card/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const styles = createStyles({
}
});

export interface IHomeCardProp {
export interface IEventsCardProp {
classes?: any;
userParticipations: any;
}

export class Events extends React.Component<IHomeCardProp> {
export class Events extends React.Component<IEventsCardProp> {
render() {
const { classes, userParticipations } = this.props;
return (
Expand All @@ -38,7 +38,7 @@ export class Events extends React.Component<IHomeCardProp> {
<CardActions className={ classes.text }>
<CardContent className={ classes.margin }>
<Typography variant="subtitle1" component="p" color="textSecondary">
참여
참여수
</Typography>
<Typography component="p">
{ userParticipations && userParticipations.totalDocs }
Expand Down
28 changes: 20 additions & 8 deletions src/main/webapp/app/pages/events/event/event-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { RouteComponentProps, withRouter } from 'react-router-dom';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import Divider from '@material-ui/core/Divider';
import TextField from '@material-ui/core/TextField';
import { connect } from 'react-redux';
import { getSession } from 'app/shared/reducers/authentication';
import { getEvent, getEventParticipations, getEventRewards } from '../event.reducer';
Expand All @@ -18,7 +19,6 @@ import Avatar from '@material-ui/core/Avatar';
import { convertDate } from 'app/shared/util/date-utils';
import queryString from 'query-string';
import { getUser } from 'app/pages/users/users.reducer';
import HomeStatus from 'app/components/card/home-status';

const styles = theme =>
createStyles({
Expand All @@ -37,6 +37,9 @@ const styles = theme =>
margin: '10px',
backgroundColor: 'transparent'
},
textField: {
fontSize: 20
},
'history-back-btn': {
'margin-top': '20px'
}
Expand All @@ -50,7 +53,7 @@ const mainContent = (classes, event, user) => (
</Typography>
<Grid>
<Grid item className={ classes.item }>
<Avatar style={ { float: 'left' } }>H</Avatar>
<Avatar src={ user.avatar } style={ { float: 'left' } }>{ user.name }</Avatar>
<div style={ { float: 'left', paddingLeft: '10px' } }>
<Typography component="h6" variant="h6">
{ user.name }
Expand All @@ -71,9 +74,18 @@ const mainContent = (classes, event, user) => (
{ convertDate(event.startDate) } ~ { convertDate(event.finishDate) }
</Typography>
<Typography className={ classes.item } variant="h6" color="textSecondary">내용</Typography>
<Typography variant="h6">
{ event.description }
</Typography>
<TextField
InputProps={ {
readOnly: true,
classes: {
input: classes.textField
}
} }
margin="normal"
fullWidth
multiline
rows="8"
value={ event.description }/>
</div>
</Paper>
</React.Fragment>
Expand All @@ -82,7 +94,7 @@ const mainContent = (classes, event, user) => (
const sidebarContent = (classes, user, eventId) => (
<Paper className={ classes.paper }>
<ApplyList participations={ [] } eventId={ eventId }/>
<Divider variant="middle" className={ classes['divider-margin']}/>
<Divider variant="middle" className={ classes[ 'divider-margin' ] }/>
<CompletionList eventId={ eventId }/>
</Paper>
);
Expand All @@ -91,7 +103,7 @@ const gridContainer = (classes, leftXs, rightXs, event, rewards, user, eventId)
<Grid container spacing={ 24 }>
<Grid item xs={ leftXs }>
{ mainContent(classes, event, user) }
<Divider variant="middle" className={ classes['divider-margin']}/>
<Divider variant="middle" className={ classes[ 'divider-margin' ] }/>
<RewardList items={ rewards }/>
</Grid>
<Grid item xs={ rightXs }>
Expand Down Expand Up @@ -128,7 +140,7 @@ export class EventDetailPage extends React.Component<IEventDetailPageProp> {
console.log('user', user);
console.dir(this.props);

console.log(classes['history-back-btn']);
console.log(classes[ 'history-back-btn' ]);
return (
<div>
{ gridContainer(classes, 9, 3, event, rewards, user, queryString.parse(this.props.location.search).id) }
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/pages/events/event/event-new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ const mapDispatchToProps = { getSession, getEvents, createEvent, getAggsParticip
type StateProps = ReturnType<typeof mapStateToProps>;
type DispatchProps = typeof mapDispatchToProps;

export default withRouter(connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(EventNewPage)));
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(EventNewPage)));
9 changes: 2 additions & 7 deletions src/main/webapp/app/pages/profile/profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,13 @@ export class ProfileCard extends React.Component<IProfileCardProp, IProfileCardS
};

saveCroppedImg = croppedImg => {
// const file = new File([ croppedImg ], 'avatar');
// console.log('saveCroppedImg ==>', file);
// this.props.uploadFile('1', this.props.account.id, file);
this.props.uploadFile('1', this.props.account.id, croppedImg);
this.props.uploadFile('1', this.props.account._id, croppedImg);
this.setState({ open: false, img: croppedImg });
};

handleUpdateProfile = () => {
const { account } = this.props;
this.props.updateUser('1', account.id, this.state.name, account.status, account.role);
this.props.updateUser('1', account._id, this.state.name, account.status, account.role);
};

handleNameChange = e => {
Expand All @@ -120,8 +117,6 @@ export class ProfileCard extends React.Component<IProfileCardProp, IProfileCardS
thumbnail = account.thumbnail;
}

// console.log(this.state.img);

return (
<React.Fragment>
<Card className={ classes.card }>
Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/app/pages/profile/profile.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './profile.css';

import React from 'react';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import Divider from '@material-ui/core/Divider';
import { connect } from 'react-redux';
Expand Down