mirror of https://github.com/grafana/grafana
TopNav: Updates to create service account page and invite user (#52480)
* Simplify logic to support both navs * Added new filepull/52537/head
parent
b42ac8a211
commit
01d561224c
@ -0,0 +1,10 @@ |
||||
import React from 'react'; |
||||
|
||||
interface Props { |
||||
children: React.ReactNode; |
||||
} |
||||
|
||||
/** Remove after topnav feature toggle is removed */ |
||||
export function OldNavOnly({ children }: Props): React.ReactElement | null { |
||||
return <>{children}</>; |
||||
} |
@ -1,35 +1,29 @@ |
||||
import React, { FC } from 'react'; |
||||
import { connect } from 'react-redux'; |
||||
import React from 'react'; |
||||
|
||||
import { NavModel } from '@grafana/data'; |
||||
import { Page } from 'app/core/components/Page/Page'; |
||||
import { contextSrv } from 'app/core/core'; |
||||
import { getNavModel } from 'app/core/selectors/navModel'; |
||||
import { StoreState } from 'app/types/store'; |
||||
|
||||
import UserInviteForm from './UserInviteForm'; |
||||
|
||||
interface Props { |
||||
navModel: NavModel; |
||||
} |
||||
export function UserInvitePage() { |
||||
const subTitle = ( |
||||
<> |
||||
Send invitation or add existing Grafana user to the organization. |
||||
<span className="highlight-word"> {contextSrv.user.orgName}</span> |
||||
</> |
||||
); |
||||
|
||||
export const UserInvitePage: FC<Props> = ({ navModel }) => { |
||||
return ( |
||||
<Page navModel={navModel}> |
||||
<Page navId="users" pageNav={{ text: 'Invite user' }} subTitle={subTitle}> |
||||
<Page.Contents> |
||||
<h3 className="page-sub-heading">Invite user</h3> |
||||
<div className="p-b-2"> |
||||
Send invitation or add existing Grafana user to the organization. |
||||
<span className="highlight-word"> {contextSrv.user.orgName}</span> |
||||
</div> |
||||
<Page.OldNavOnly> |
||||
<h3 className="page-sub-heading">Invite user</h3> |
||||
<div className="p-b-2">{subTitle}</div> |
||||
</Page.OldNavOnly> |
||||
<UserInviteForm /> |
||||
</Page.Contents> |
||||
</Page> |
||||
); |
||||
}; |
||||
|
||||
const mapStateToProps = (state: StoreState) => ({ |
||||
navModel: getNavModel(state.navIndex, 'users'), |
||||
}); |
||||
} |
||||
|
||||
export default connect(mapStateToProps)(UserInvitePage); |
||||
export default UserInvitePage; |
||||
|
Loading…
Reference in new issue