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} : null}
{dashboard {dashboard
? <DashboardHeaderEdit ? <Authorized
requiredRole={EDITOR_ROLE}
replaceWith={
<h1 className="page-header__title">
{activeDashboard}
</h1>
}
>
<DashboardHeaderEdit
onSave={onSave} onSave={onSave}
onCancel={onCancel} onCancel={onCancel}
activeDashboard={activeDashboard} activeDashboard={activeDashboard}
onEditDashboard={onEditDashboard} onEditDashboard={onEditDashboard}
isEditMode={isEditMode} isEditMode={isEditMode}
/> />
</Authorized>
: <h1 className="page-header__title"> : <h1 className="page-header__title">
{activeDashboard} {activeDashboard}
</h1>} </h1>}