mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* created react component and moved markdown * extracting components * Broke out parts into components * tests * Flattened file structure * Tests * made instances typed in test * typing * function instead of variable * updated user model with missing properties * added full set of properties to user mock * redone from variable to function * refactor: minor refactorings of #13091 * removed logging
30 lines
879 B
TypeScript
30 lines
879 B
TypeScript
import React from 'react';
|
|
import _ from 'lodash';
|
|
import SignIn from './SignIn';
|
|
import BottomNavLinks from './BottomNavLinks';
|
|
import { contextSrv } from 'app/core/services/context_srv';
|
|
import config from '../../config';
|
|
|
|
export default function BottomSection() {
|
|
const navTree = _.cloneDeep(config.bootData.navTree);
|
|
const bottomNav = _.filter(navTree, item => item.hideFromMenu);
|
|
const isSignedIn = contextSrv.isSignedIn;
|
|
const user = contextSrv.user;
|
|
|
|
if (user && user.orgCount > 1) {
|
|
const profileNode = _.find(bottomNav, { id: 'profile' });
|
|
if (profileNode) {
|
|
profileNode.showOrgSwitcher = true;
|
|
}
|
|
}
|
|
|
|
return (
|
|
<div className="sidemenu__bottom">
|
|
{!isSignedIn && <SignIn />}
|
|
{bottomNav.map((link, index) => {
|
|
return <BottomNavLinks link={link} user={user} key={`${link.url}-${index}`} />;
|
|
})}
|
|
</div>
|
|
);
|
|
}
|