-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove test date from Charts - Update font sizes
- Loading branch information
Showing
16 changed files
with
93 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
20 changes: 0 additions & 20 deletions
20
dashboard/assets/packages/report/src/components/Header.tsx
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
dashboard/assets/packages/report/src/components/Header/Header.css.ts
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,10 @@ | ||
import { style } from "@vanilla-extract/css" | ||
import { vars } from "theme" | ||
|
||
export const heading = style({ | ||
fontSize: vars.fontSizes.sizeFluid | ||
}) | ||
|
||
export const date = style({ | ||
color: vars.colors.text.secondary | ||
}) |
29 changes: 29 additions & 0 deletions
29
dashboard/assets/packages/report/src/components/Header/Header.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-FileCopyrightText: 2023 Raintank, Inc. dba Grafana Labs | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import React from "react" | ||
import { Digest } from "@xk6-dashboard/model" | ||
|
||
import "theme/global.css" | ||
import { Flex } from "components/Flex" | ||
import { ReactComponent as LogoIcon } from "assets/icons/logo.svg" | ||
|
||
import { toDate } from "./Header.utils" | ||
import * as styles from "./Header.css" | ||
|
||
interface HeaderProps { | ||
digest: Digest | ||
} | ||
|
||
export function Header({ digest }: HeaderProps) { | ||
console.log(digest.start, typeof digest.start) | ||
return ( | ||
<Flex as="header" align="center"> | ||
<LogoIcon /> | ||
<Flex className={styles.heading} as="h1" grow={1} justify="center"> | ||
Report: <span className={styles.date}>{toDate(digest.start)}</span> | ||
</Flex> | ||
</Flex> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
dashboard/assets/packages/report/src/components/Header/Header.utils.ts
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,12 @@ | ||
const dateTimeFormatter = new Intl.DateTimeFormat("en-GB", { | ||
year: "numeric", | ||
month: "short", | ||
day: "numeric", | ||
hour: "numeric", | ||
minute: "2-digit", | ||
hour12: false | ||
}) | ||
|
||
export const toDate = (date?: Date) => { | ||
return date && dateTimeFormatter.format(new Date(date)) | ||
} |
1 change: 1 addition & 0 deletions
1
dashboard/assets/packages/report/src/components/Header/index.ts
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 @@ | ||
export * from "./Header" |
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