Skip to content

Commit

Permalink
Merge cbc06ff into ddf9f9b
Browse files Browse the repository at this point in the history
  • Loading branch information
HalvorHaugan authored Oct 23, 2024
2 parents ddf9f9b + cbc06ff commit 2e2f236
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion @navikt/core/react/src/modal/ModalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cl from "clsx";
import React, { forwardRef } from "react";
import { XMarkIcon } from "@navikt/aksel-icons";
import { Button } from "../button";
import { useI18n } from "../util/i18n/i18n.context";
import { useModalContext } from "./Modal.context";

export interface ModalHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
Expand All @@ -16,6 +17,7 @@ export interface ModalHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
const ModalHeader = forwardRef<HTMLDivElement, ModalHeaderProps>(
({ children, className, closeButton = true, ...rest }, ref) => {
const context = useModalContext();
const translate = useI18n("Modal");

return (
<div {...rest} ref={ref} className={cl("navds-modal__header", className)}>
Expand All @@ -32,7 +34,7 @@ const ModalHeader = forwardRef<HTMLDivElement, ModalHeaderProps>(
}
}}
onClick={context.closeHandler}
icon={<XMarkIcon title="Lukk" />}
icon={<XMarkIcon title={translate("close")} />}
/>
)}
{children}
Expand Down
3 changes: 3 additions & 0 deletions @navikt/core/react/src/util/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ export default {
labelSuffix: "delete",
},
},
Modal: {
close: "Close",
},
} satisfies Translations;
3 changes: 3 additions & 0 deletions @navikt/core/react/src/util/i18n/locales/nb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ export default {
labelSuffix: "slett",
},
},
Modal: {
close: "Lukk",
},
} satisfies TranslationMap;
3 changes: 3 additions & 0 deletions @navikt/core/react/src/util/i18n/locales/nn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ export default {
labelSuffix: "slett",
},
},
Modal: {
close: "Lukk",
},
} satisfies Translations;

0 comments on commit 2e2f236

Please sign in to comment.