Skip to content

Commit

Permalink
Merge pull request #4452 from webkom/ivarnakken/aba-814-stop-page-fro…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarnakken committed Feb 10, 2024
2 parents aae71e2 + cfc9ca8 commit ea7f604
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/routes/pages/components/PageDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@ const PageDetail = () => {
[pageSlug]
);

const { editUrl, actionGrant = [], isComplete } = selectedPageInfo;
const actionGrant = selectedPageInfo?.actionGrant || [];

return (
<Content className={styles.cont}>
<Helmet title={selectedPageInfo.title} />
<Helmet title={selectedPageInfo?.title} />
<div className={styles.main}>
<button
className={styles.sidebarOpenBtn}
Expand All @@ -347,15 +347,17 @@ const PageDetail = () => {

<div className={styles.mainTxt}>
<NavigationTab className={styles.navTab}>
{actionGrant.includes('edit') && editUrl && (
<NavigationLink to={editUrl}>Rediger</NavigationLink>
{actionGrant.includes('edit') && selectedPageInfo?.editUrl && (
<NavigationLink to={selectedPageInfo?.editUrl}>
Rediger
</NavigationLink>
)}
{actionGrant.includes('create') && (
<NavigationLink to="/pages/new">Lag ny</NavigationLink>
)}
</NavigationTab>

{isComplete ? (
{selectedPageInfo?.isComplete ? (
<MainPageRenderer
page={selectedPage}
pageInfo={selectedPageInfo}
Expand Down

0 comments on commit ea7f604

Please sign in to comment.