Only for admins

This commit is contained in:
Tom Moor
2018-12-25 17:18:20 -08:00
parent 96b1d6257e
commit d045b8975c
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import Flex from 'shared/components/Flex';
type Props = { type Props = {
id: string, id: string,
children: React.Node, children: React.Node,
disabled?: boolean,
}; };
type State = { type State = {
@ -31,7 +32,7 @@ class Tip extends React.Component<Props, State> {
render() { render() {
const { children } = this.props; const { children } = this.props;
if (this.state.isHidden) return null; if (this.props.disabled || this.state.isHidden) return null;
return ( return (
<Wrapper align="center"> <Wrapper align="center">

View File

@ -29,8 +29,11 @@ class Dashboard extends React.Component<Props> {
return ( return (
<CenteredContent> <CenteredContent>
{auth.team.subdomain && <TipInvite team={auth.team} />}
<PageTitle title="Home" /> <PageTitle title="Home" />
<TipInvite
team={auth.team}
disabled={!auth.team.subdomain || !auth.user.isAdmin}
/>
<h1>Home</h1> <h1>Home</h1>
<Tabs> <Tabs>
<Tab to="/dashboard" exact> <Tab to="/dashboard" exact>