accounts-frontend/src/components/userbar/Userbar.jsx

40 lines
1.0 KiB
React
Raw Normal View History

import React, { Component } from 'react';
import { Link } from 'react-router';
import { FormattedMessage as Message } from 'react-intl';
import buttons from 'components/ui/buttons.scss';
import messages from './Userbar.intl.json';
import styles from './userbar.scss';
import { userShape } from 'components/user/User';
import LoggedInPanel from './LoggedInPanel';
export default class Userbar extends Component {
static displayName = 'Userbar';
static propTypes = {
user: userShape
};
render() {
const { user } = this.props;
return (
<div className={styles.userbar}>
{user.isGuest
? (
<Link to="/register" className={buttons.blue}>
<Message {...messages.register} />
</Link>
)
: (
<LoggedInPanel {...this.props} />
)
}
</div>
);
}
}