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

Convert React component to functional component - generated by AIPR #1057 #1058

Closed
wants to merge 1 commit into from
Closed
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
28 changes: 13 additions & 15 deletions frontend/src/components/profile/skill.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import { withRouter } from 'react-router-dom'
import { injectIntl } from 'react-intl'
import PropTypes from 'prop-types'
Expand All @@ -12,31 +12,29 @@ import {
} from '@material-ui/core'
import FolderIcon from '@material-ui/icons/Folder'

class Skill extends Component {
render () {
const { classes, title } = this.props
function Skill(props) {
const { classes, title } = props;

return (
<Grid container direction='row' alignItems='center' xs={ 6 }>
<Grid item xs={ 2 }>
<Avatar className={ classNames(classes.avatar, classes.bigAvatar) }>
return (
<Grid container direction='row' alignItems='center' xs={6}>
<Grid item xs={2}>
<Avatar className={classNames(classes.avatar, classes.bigAvatar)}>
<FolderIcon />
</Avatar>
</Grid>
<Grid item xs={ 6 }>
<Grid item xs={6}>
<Typography variant='body1' color='default'>
{ title }
{title}
</Typography>
</Grid>
<Grid item xs={ 4 } alignItems='flex-end'>
<Checkbox onClick={ this.props.onClick } checked={ this.props.isSelected ? 'checked' : '' } />
<Grid item xs={4} alignItems='flex-end'>
<Checkbox onClick={props.onClick} checked={props.isSelected ? 'checked' : ''} />
</Grid>
</Grid>
)
}
);
}

Skill.PropTypes = {
Skill.propTypes = {
classes: PropTypes.object.isRequired,
preferences: PropTypes.string,
language: PropTypes.string,
Expand Down