User Button
Simple user button showing the users' first name if logged in. Customizable text and visibility if logged out. Takes onClick
or href
, and className
.
Installation
npm install @agderposten/user-button
Usage
import React from 'react';
import UserButton, {stylesheet} from '@agderposten/user-button';
export default () => (
<Fragment>
<UserButton {...{user}} />
<UserButton {...{user}} fallbackText="Menu" />
<UserButton {...{user}} onClick={this.props.handleOnClick} />
<UserButton fallbackText="Log in" href={this.props.organization.urls.login} />
<style dangerouslySetInnerHTML={{__html: stylesheet}} />
</Fragment>
);