Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links for uuid, hash & log index #29

Merged
merged 2 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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