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