-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translations for ReadOnlyIcon (#3311)
- Loading branch information
1 parent
5ce8ec6
commit c200f58
Showing
12 changed files
with
38 additions
and
43 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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import React from "react"; | ||
import { PadlockLockedFillIcon } from "@navikt/aksel-icons"; | ||
import { useI18n } from "../util/i18n/i18n.context"; | ||
|
||
export const ReadOnlyIcon = ({ | ||
readOnly, | ||
nativeReadOnly = true, | ||
}: { | ||
readOnly?: boolean; | ||
nativeReadOnly?: boolean; | ||
}) => { | ||
if (readOnly) { | ||
return ( | ||
<PadlockLockedFillIcon | ||
{...(nativeReadOnly ? { "aria-hidden": true } : { title: "readonly" })} | ||
className="navds-form-field__readonly-icon" | ||
/> | ||
); | ||
} | ||
return null; | ||
}; | ||
export const ReadOnlyIcon = () => ( | ||
<PadlockLockedFillIcon | ||
aria-hidden | ||
className="navds-form-field__readonly-icon" | ||
/> | ||
); | ||
|
||
export const ReadOnlyIconWithTitle = () => ( | ||
<PadlockLockedFillIcon | ||
title={useI18n("global")("readOnly")} | ||
className="navds-form-field__readonly-icon" | ||
/> | ||
); |
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
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