Skip to content

Commit

Permalink
Add links for uuid, hash & log index (#29)
Browse files Browse the repository at this point in the history
* Add links for uuid, hash & log index

* Revert pagination change
  • Loading branch information
pdeslaur authored Jun 14, 2022
1 parent 8ffb8b1 commit 29b20a2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
19 changes: 17 additions & 2 deletions src/modules/components/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
Divider,
DividerProps,
Grid,
Link,
Paper,
styled,
Typography,
} from "@mui/material";
import { Box } from "@mui/system";
import { dump, load } from "js-yaml";
import NextLink from "next/link";
import { Convert } from "pvtsutils";
import { ReactNode } from "react";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
Expand Down Expand Up @@ -139,7 +141,13 @@ export function Entry({ entry }: { entry: LogEntry }) {
textOverflow: "ellipsis",
}}
>
Entry UUID: {uuid}
Entry UUID:{" "}
<NextLink
href={`/?uuid=${uuid}`}
passHref
>
<Link>{uuid}</Link>
</NextLink>
</Typography>
<Divider
flexItem
Expand Down Expand Up @@ -170,7 +178,14 @@ export function Entry({ entry }: { entry: LogEntry }) {
>
<Card
title="Log Index"
content={obj.logIndex}
content={
<NextLink
href={`/?logIndex=${obj.logIndex}`}
passHref
>
<Link>{obj.logIndex}</Link>
</NextLink>
}
/>
</Grid>
<Grid
Expand Down
12 changes: 10 additions & 2 deletions src/modules/components/HashedRekord.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Box, Typography } from "@mui/material";
import { Box, Link, Typography } from "@mui/material";
import { dump } from "js-yaml";
import NextLink from "next/link";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { atomDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
import { HashedRekord } from "../api/generated/types/hashedrekord";
Expand Down Expand Up @@ -32,14 +33,21 @@ export function HashedRekordViewer({
variant="h5"
sx={{ py: 1 }}
>
Hash
<NextLink
href={`/?hash=${hashedRekord.data.hash?.algorithm}:${hashedRekord.data.hash?.value}`}
passHref
>
<Link>Hash</Link>
</NextLink>
</Typography>

<SyntaxHighlighter
language="text"
style={atomDark}
>
{`${hashedRekord.data.hash?.algorithm}:${hashedRekord.data.hash?.value}`}
</SyntaxHighlighter>

<Typography
variant="h5"
sx={{ py: 1 }}
Expand Down

1 comment on commit 29b20a2

@vercel
Copy link

@vercel vercel bot commented on 29b20a2 Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rekor-search-ui – ./

rekor-search-ui.vercel.app
rekor-search-ui.chainguard.app
rekor.tlog.dev
rekor-search-ui-git-main.chainguard.app

Please sign in to comment.