2016-03-30 09:24:52 +09:00
|
|
|
import React from 'react';
|
2017-05-19 14:42:43 -06:00
|
|
|
import PropTypes from 'prop-types';
|
2017-03-23 16:27:59 +09:00
|
|
|
import { withCurrentUser, getSetting, Components, registerComponent } from 'meteor/vulcan:core';
|
2016-02-25 21:05:53 +09:00
|
|
|
|
2016-11-15 18:33:16 +01:00
|
|
|
const Header = (props, context) => {
|
2016-02-16 15:08:30 +09:00
|
|
|
|
2016-12-12 15:00:56 +09:00
|
|
|
const logoUrl = getSetting("logoUrl");
|
2017-03-24 10:35:19 +09:00
|
|
|
const siteTitle = getSetting("title", "My App");
|
2016-12-12 15:00:56 +09:00
|
|
|
const tagline = getSetting("tagline");
|
2016-02-16 15:08:30 +09:00
|
|
|
|
|
|
|
return (
|
2016-03-25 10:45:28 +09:00
|
|
|
<div className="header-wrapper">
|
2016-03-28 10:38:28 +09:00
|
|
|
|
2016-03-25 10:45:28 +09:00
|
|
|
<header className="header">
|
2016-03-25 11:22:35 +09:00
|
|
|
|
|
|
|
<div className="logo">
|
2016-12-06 18:06:29 +01:00
|
|
|
<Components.Logo logoUrl={logoUrl} siteTitle={siteTitle} />
|
2016-03-25 10:45:28 +09:00
|
|
|
{tagline ? <h2 className="tagline">{tagline}</h2> : "" }
|
|
|
|
</div>
|
|
|
|
|
2016-03-25 11:22:35 +09:00
|
|
|
<div className="nav">
|
|
|
|
|
|
|
|
<div className="nav-user">
|
2016-12-20 09:45:55 +09:00
|
|
|
{!!props.currentUser ? <Components.UsersMenu/> : <Components.UsersAccountMenu/>}
|
2016-03-25 11:22:35 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="nav-new-post">
|
2016-12-06 18:06:29 +01:00
|
|
|
<Components.PostsNewButton/>
|
2016-03-25 11:22:35 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2016-03-25 10:45:28 +09:00
|
|
|
|
|
|
|
</header>
|
|
|
|
</div>
|
2016-02-16 15:08:30 +09:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-05-22 16:42:24 +09:00
|
|
|
Header.displayName = "Header";
|
|
|
|
|
2016-11-15 18:33:16 +01:00
|
|
|
Header.propTypes = {
|
2017-05-19 14:42:43 -06:00
|
|
|
currentUser: PropTypes.object,
|
2016-10-14 08:47:18 +02:00
|
|
|
};
|
|
|
|
|
2016-12-06 18:06:29 +01:00
|
|
|
registerComponent('Header', Header, withCurrentUser);
|