From 0d13eb14fa382a11afc2765f139ff2d2637f9910 Mon Sep 17 00:00:00 2001 From: Lars <74791975+lassopicasso@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:17:11 +0100 Subject: [PATCH] Summary edit button accessibility (#926) * Solved tab accessibility * Added onclick * fixed cypress test --------- Co-authored-by: lassopicasso --- src/components/summary/EditButton.tsx | 40 +++++-------------- .../SummaryGroupComponent.test.tsx.snap | 39 +++++++++--------- .../MultipleChoiceSummary.test.tsx.snap | 38 +++++++++--------- test/e2e/integration/app-frontend/summary.ts | 8 ++-- 4 files changed, 53 insertions(+), 72 deletions(-) diff --git a/src/components/summary/EditButton.tsx b/src/components/summary/EditButton.tsx index 50b8614818..bc993e4cc2 100644 --- a/src/components/summary/EditButton.tsx +++ b/src/components/summary/EditButton.tsx @@ -1,45 +1,23 @@ import * as React from 'react'; -import { IconButton, makeStyles, Typography } from '@material-ui/core'; +import { Button, ButtonColor, ButtonVariant } from '@digdir/design-system-react'; +import { Edit } from '@navikt/ds-icons'; export interface IEditButtonProps { onClick: () => void; editText: string | null; } -const useStyles = makeStyles({ - editButton: { - color: 'black', - padding: 0, - }, - editIcon: { - paddingLeft: '6px', - fontSize: '1.125rem !important', - }, - change: { - fontSize: '1.125rem', - cursor: 'pointer', - }, -}); - export function EditButton(props: IEditButtonProps) { - const classes = useStyles(); - return ( - } + iconPlacement='right' onClick={props.onClick} - className={classes.editButton} > - - {props.editText} -