Render Dashboard rename based on Authorization

Signed-off-by: Alex Paxton <thealexpaxton@gmail.com>
pull/10616/head
Jared Scheib 2017-10-24 18:19:18 -07:00 committed by Alex Paxton
parent c4c423ad76
commit 4c40055aff
1 changed files with 16 additions and 7 deletions

View File

@ -48,13 +48,22 @@ const DashboardHeader = ({
/>
: null}
{dashboard
? <DashboardHeaderEdit
onSave={onSave}
onCancel={onCancel}
activeDashboard={activeDashboard}
onEditDashboard={onEditDashboard}
isEditMode={isEditMode}
/>
? <Authorized
requiredRole={EDITOR_ROLE}
replaceWith={
<h1 className="page-header__title">
{activeDashboard}
</h1>
}
>
<DashboardHeaderEdit
onSave={onSave}
onCancel={onCancel}
activeDashboard={activeDashboard}
onEditDashboard={onEditDashboard}
isEditMode={isEditMode}
/>
</Authorized>
: <h1 className="page-header__title">
{activeDashboard}
</h1>}