Skip to content

Commit

Permalink
feat(boards): add button to empty board page (#1643)
Browse files Browse the repository at this point in the history
* feat(BoardTable): add button to empty board page

* fix(board): send button as function parameter to IllustrationBoard

* chore(boards): add children as prop to IllustratedInfo

* chore(boards): make children-parameter optional in IllustratedInfo
  • Loading branch information
SelmaBergstrand authored Sep 12, 2024
1 parent 6ac811d commit cfedeba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tavla/app/(admin)/boards/components/BoardTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { TableRows } from 'app/(admin)/boards/components/TableRows'
import { TBoardWithOrganizaion } from 'types/settings'
import { isEmpty } from 'lodash'
import { IllustratedInfo } from 'app/(admin)/components/IllustratedInfo'
import { PrimaryButton } from '@entur/button'
import Link from 'next/link'
import { AddIcon } from '@entur/icons'
import { CreateBoard } from 'app/(admin)/components/CreateBoard'

function BoardTable({
boardsWithOrg,
Expand All @@ -15,7 +19,11 @@ function BoardTable({
<IllustratedInfo
title="Her var det tomt"
description="Du har ikke laget noen tavler ennå"
/>
>
<PrimaryButton as={Link} href="?board">
Opprett tavle <AddIcon /> <CreateBoard />
</PrimaryButton>
</IllustratedInfo>
)

return (
Expand Down
3 changes: 3 additions & 0 deletions tavla/app/(admin)/components/IllustratedInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { Heading2, LeadParagraph } from '@entur/typography'
function IllustratedInfo({
title,
description,
children,
}: {
title: string
description: string
children?: React.ReactNode
}) {
return (
<div className="flex flex-col items-center bg-secondary rounded pb-16">
<Image src={animals} aria-hidden="true" alt="" />
<Heading2 className="my-4">{title}</Heading2>
<LeadParagraph margin="bottom">{description}</LeadParagraph>
{children}
</div>
)
}
Expand Down

0 comments on commit cfedeba

Please sign in to comment.