Files
mattermost/webapp/components/claim/claim_controller.jsx
Christopher Speller 2bbedd9def Updating client dependencies. Switching to yarn. (#6433)
* Updating client dependancies. Switching to using yarn.

* Updating React

* Moving pure components to using function syntax (performance gains with newer react version)

* Updating client dependancies.

* Ignore .yarninstall

* Enabling pre-lockfile because it's the entire point of using yarn.

* Removing old webpack config

* Moving to new prop-types

* Fixing ESLint Errors

* Updating jest snapshots.

* Cleaning up package.json
2017-05-18 09:28:18 -04:00

62 lines
1.8 KiB
JavaScript

import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router/es6';
import logoImage from 'images/logo.png';
export default class ClaimController extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
componentWillMount() {
this.setState({
email: this.props.location.query.email,
newType: this.props.location.query.new_type,
oldType: this.props.location.query.old_type
});
}
render() {
return (
<div>
<div className='signup-header'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>
<img
className='signup-team-logo'
src={logoImage}
/>
<div id='claim'>
{React.cloneElement(this.props.children, {
currentType: this.state.oldType,
newType: this.state.newType,
email: this.state.email
})}
</div>
</div>
</div>
</div>
);
}
}
ClaimController.defaultProps = {
};
ClaimController.propTypes = {
location: PropTypes.object.isRequired,
children: PropTypes.node
};