mirror of https://github.com/grafana/grafana
TopNav: Adding sign in to topnav and hiding it mega menu (#56403)
* TopNav: Adding sign in to topnav and hiding it mega menu * Added target _self * remove scss change * Fix sign in link * Fix other linkpull/55845/head
parent
0958d9ba55
commit
a8b883b1fa
@ -0,0 +1,29 @@ |
||||
import { css } from '@emotion/css'; |
||||
import React from 'react'; |
||||
import { useLocation } from 'react-router-dom'; |
||||
|
||||
import { locationUtil } from '@grafana/data'; |
||||
import { useStyles2 } from '@grafana/ui'; |
||||
|
||||
export function SignInLink() { |
||||
const location = useLocation(); |
||||
const styles = useStyles2(getStyles); |
||||
const loginUrl = locationUtil.getUrlForPartial(location, { forceLogin: 'true' }); |
||||
|
||||
return ( |
||||
<a className={styles.link} href={loginUrl} target="_self"> |
||||
Sign in |
||||
</a> |
||||
); |
||||
} |
||||
|
||||
const getStyles = () => { |
||||
return { |
||||
link: css({ |
||||
whiteSpace: 'nowrap', |
||||
'&:hover': { |
||||
textDecoration: 'underline', |
||||
}, |
||||
}), |
||||
}; |
||||
}; |
Loading…
Reference in new issue