-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Amsterdam/improvement/122938-update-css-z…
…aakdetails 122938 css case details
- Loading branch information
Showing
16 changed files
with
99 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react" | ||
import { DescriptionList } from "@amsterdam/design-system-react" | ||
|
||
type Props = { | ||
data?: { | ||
term: string; | ||
details?: string | number | null; | ||
}[] | ||
} | ||
|
||
export const DetailsList: React.FC<Props> = ({ data = [] }) => ( | ||
<DescriptionList> | ||
{ data.map((item) => ( | ||
<React.Fragment key={item?.term}> | ||
<DescriptionList.Term key={item?.term}>{item?.term}</DescriptionList.Term> | ||
<DescriptionList.Details key={item?.details}>{item?.details}</DescriptionList.Details> | ||
</React.Fragment> | ||
))} | ||
</DescriptionList> | ||
) | ||
|
||
export default DetailsList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { LinkList } from "@amsterdam/design-system-react" | ||
import { useLinkClickHandler, useHref } from "react-router-dom" | ||
|
||
|
||
type Props = { | ||
label: string | ||
path?: string | ||
onClick?: () => void | ||
} | ||
|
||
export const LinkButton: React.FC<Props> = ({ label, path = "", onClick }) => { | ||
const onRouterClick = useLinkClickHandler(path) | ||
const href = useHref(path) | ||
|
||
const onHandleButtonClick = (event: React.MouseEvent<HTMLElement>) => { | ||
event. preventDefault() | ||
if (onClick) { | ||
onClick() | ||
} | ||
} | ||
|
||
// If onClick is passed. Link must be used as button. | ||
const onClickLink = onClick ? onHandleButtonClick : onRouterClick | ||
|
||
return ( | ||
<LinkList> | ||
<LinkList.Link | ||
href={ href } | ||
onClick={ onClickLink } | ||
> | ||
{ label } | ||
</LinkList.Link> | ||
</LinkList> | ||
) | ||
} | ||
|
||
export default LinkButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletions
12
src/app/pages/CaseDetailsPage/tasks/TaskButton/TaskButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters