Skip to content

Commit

Permalink
Merge pull request #2208 from Amsterdam/improvement/update-wonen-ui
Browse files Browse the repository at this point in the history
Updated wonen-ui
  • Loading branch information
remyvdwereld authored Aug 10, 2023
2 parents dd3aab0 + 4042265 commit 8a42557
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@amsterdam/amsterdam-react-final-form": "^0.1.140",
"@amsterdam/asc-assets": "^0.38.0",
"@amsterdam/asc-ui": "^0.37.0",
"@amsterdam/wonen-ui": "^1.0.41",
"@amsterdam/wonen-ui": "^1.0.43",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@reach/router": "^1.3.4",
Expand Down
52 changes: 26 additions & 26 deletions src/app/components/addresses/AddressMenu/AddressMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const AddressMenu: React.FC<Props> = ({ bagId }) => {
const [permitDetails] = usePermitDetails(bagId)
const [data] = useCasesByBagId(bagId)
const numCases = data?.results?.length ?? 0
const permitsGranted = permitDetails?.permits.filter(p => p.permit_granted === "GRANTED").length
const permitsFound = permitDetails?.permits.filter(p => ["GRANTED", "NOT_GRANTED"].includes(p.permit_granted)).length
const permitsGranted = permitDetails?.permits?.filter(p => p.permit_granted === "GRANTED").length
const permitsFound = permitDetails?.permits?.filter(p => ["GRANTED", "NOT_GRANTED"].includes(p.permit_granted)).length
const counts = [
undefined,
undefined,
Expand All @@ -34,30 +34,30 @@ const AddressMenu: React.FC<Props> = ({ bagId }) => {
<BlockMenu>
<ul>
{ routes.map((route, index) => {
const path = typeof route === "string" ? route : route.path
const permissionNames = typeof route !== "string" ? route.permissionNames : undefined
const page = routesObject[path]
if (page?.icon === undefined || page?.title === undefined) return null
const navBlock = (
<NavBlock
to={ to(path, { bagId }) }
icon={ page.icon }
header={ page.title }
count={ counts[index] }
permissionNames={ permissionNames }
/>
)
return (
<li key={ path }>
<div>
{ mockedRoutes.includes(path) ? (
<MockWrapper hasPadding={ false }>{ navBlock }</MockWrapper>
) : navBlock
}
</div>
</li>
)
})
const path = typeof route === "string" ? route : route.path
const permissionNames = typeof route !== "string" ? route.permissionNames : undefined
const page = routesObject[path]
if (page?.icon === undefined || page?.title === undefined) return null
const navBlock = (
<NavBlock
to={ to(path, { bagId }) }
icon={ page.icon }
header={ page.title }
count={ counts[index] }
permissionNames={ permissionNames }
/>
)
return (
<li key={ path }>
<div>
{ mockedRoutes.includes(path) ? (
<MockWrapper hasPadding={ false }>{ navBlock }</MockWrapper>
) : navBlock
}
</div>
</li>
)
})
}
</ul>
</BlockMenu>
Expand Down

0 comments on commit 8a42557

Please sign in to comment.