-
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.
- Loading branch information
1 parent
e02293e
commit f187784
Showing
9 changed files
with
96 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { BodyLong, Heading } from "@navikt/ds-react"; | ||
import React from "react"; | ||
import { getShortDateFormat } from "@/utils/dateUtils"; | ||
import { | ||
CheckmarkCircleFillIcon, | ||
ExclamationmarkTriangleFillIcon, | ||
InformationSquareFillIcon, | ||
XMarkOctagonFillIcon, | ||
} from "@navikt/aksel-icons"; | ||
import styles from "./componentheader.module.css"; | ||
|
||
interface Props { | ||
headerText: string; | ||
alertStyle: "info" | "success" | "warning" | "error"; | ||
createdAt: string; | ||
} | ||
|
||
export const ComponentHeader = ({ | ||
headerText, | ||
alertStyle, | ||
createdAt, | ||
}: Props) => { | ||
return ( | ||
<div className="mb-4"> | ||
<div className="flex flex-row mb-4 space-between"> | ||
<Heading size="large" level="1"> | ||
{headerText} | ||
</Heading> | ||
<> | ||
{alertStyle === "info" && ( | ||
<InformationSquareFillIcon className={styles.infoIcon} /> | ||
)} | ||
{alertStyle === "warning" && ( | ||
<ExclamationmarkTriangleFillIcon className={styles.warningIcon} /> | ||
)} | ||
{alertStyle === "success" && ( | ||
<CheckmarkCircleFillIcon className={styles.successIcon} /> | ||
)} | ||
{alertStyle === "error" && ( | ||
<XMarkOctagonFillIcon className={styles.errorIcon} /> | ||
)} | ||
</> | ||
</div> | ||
|
||
<BodyLong textColor="subtle"> | ||
Utsendt {getShortDateFormat(createdAt)} | ||
</BodyLong> | ||
</div> | ||
); | ||
}; |
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,34 @@ | ||
.roundedIcon { | ||
align-self: flex-start; | ||
flex-shrink: 0; | ||
font-size: 2rem; | ||
height: 30px; | ||
background: radial-gradient( | ||
circle at 50% 57%, | ||
var(--a-surface-default) 32%, | ||
0, | ||
transparent | ||
); | ||
margin-top: 0.2rem; | ||
margin-left: auto; | ||
} | ||
.infoIcon { | ||
composes: roundedIcon; | ||
color: var(--a-icon-info); | ||
} | ||
|
||
.warningIcon { | ||
composes: roundedIcon; | ||
color: var(--a-icon-warning); | ||
} | ||
|
||
.successIcon { | ||
composes: roundedIcon; | ||
color: var(--a-icon-success); | ||
} | ||
|
||
.errorIcon { | ||
composes: roundedIcon; | ||
color: var(--a-icon-danger); | ||
} | ||
|
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