mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
31 lines
966 B
TypeScript
31 lines
966 B
TypeScript
import React, { FC } from 'react';
|
|
import { connectWithStore } from 'app/core/utils/connectWithReduxStore';
|
|
import { StoreState } from 'app/types';
|
|
import { Icon } from '@grafana/ui';
|
|
|
|
export const SignIn: FC<any> = ({ url }) => {
|
|
const loginUrl = `login?redirect=${encodeURIComponent(url)}`;
|
|
return (
|
|
<div className="sidemenu-item">
|
|
<a href={loginUrl} className="sidemenu-link" target="_self">
|
|
<span className="icon-circle sidemenu-icon">
|
|
<Icon name="arrow-from-left" size="xl" />
|
|
</span>
|
|
</a>
|
|
<a href={loginUrl} target="_self">
|
|
<ul className="dropdown-menu dropdown-menu--sidemenu" role="menu">
|
|
<li className="side-menu-header">
|
|
<span className="sidemenu-item-text">Sign In</span>
|
|
</li>
|
|
</ul>
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const mapStateToProps = (state: StoreState) => ({
|
|
url: state.location.url,
|
|
});
|
|
|
|
export default connectWithStore(SignIn, mapStateToProps);
|