Vulcan/packages/example-customization/lib/components/CustomLogo.jsx

21 lines
635 B
React
Raw Normal View History

/*
The original Logo components is defined using React's
functional stateless component syntax, so we redefine
it the same way.
*/
import React from 'react';
2016-06-19 16:25:19 +09:00
import { IndexLink } from 'react-router';
2017-03-23 16:27:59 +09:00
import Users from 'meteor/vulcan:users';
import { replaceComponent } from 'meteor/vulcan:core';
const CustomLogo = ({logoUrl, siteTitle, currentUser}) => {
return (
<div>
<h1 className="logo-text"><IndexLink to="/">{siteTitle}</IndexLink></h1>
{ currentUser ? <span className="logo-hello">Welcome {Users.getDisplayName(currentUser)} 👋</span> : null}
</div>
)
}
2016-12-12 11:34:28 +09:00
replaceComponent('Logo', CustomLogo);