Skip to content

Commit 1e192b0

Browse files
update tests/reports page with rd and styles
1 parent 4eb8e11 commit 1e192b0

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

editor/pages/_app.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function GlobalCss() {
1313
<Global
1414
styles={css`
1515
html {
16-
background-color: ${colors.color_editor_bg_on_dark};
1716
touch-action: none;
1817
}
1918
`}

editor/pages/tests/reports/index.tsx

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,53 @@ import Head from "next/head";
22
import React from "react";
33
import { Client } from "@codetest/editor-client";
44
import Link from "next/link";
5+
import styled from "@emotion/styled";
6+
import { ArchiveIcon } from "@radix-ui/react-icons";
57

68
export default function QAFilesPage({ files }) {
79
return (
810
<>
911
<Head>
10-
<title>QA - Files</title>
12+
<title>@codetest/reports</title>
1113
</Head>
12-
<main>
13-
<h1>QA - Files</h1>
14+
<main
15+
style={{
16+
fontFamily: "monospace",
17+
margin: "auto",
18+
marginTop: 120,
19+
width: 400,
20+
}}
21+
>
22+
<h1>
23+
<code>@codetest/reports</code>
24+
</h1>
25+
<p>
26+
reports coverage generated by <code>@codetest/reports</code> (locally)
27+
will be listed here
28+
</p>
1429
<div
1530
style={{
1631
display: "flex",
1732
flexDirection: "column",
33+
gap: 8,
1834
}}
1935
>
2036
{files.map((file) => (
2137
<Link
2238
href={{
23-
pathname: `/test/reports/[key]`,
39+
pathname: `/tests/reports/[key]`,
2440
query: {
2541
key: file,
2642
},
2743
}}
2844
>
29-
<a>{file}</a>
45+
<Row>
46+
<a href={file}>
47+
<ArchiveIcon />
48+
<div style={{ width: 8 }} />
49+
reports/{file}
50+
</a>
51+
</Row>
3052
</Link>
3153
))}
3254
</div>
@@ -35,6 +57,23 @@ export default function QAFilesPage({ files }) {
3557
);
3658
}
3759

60+
const Row = styled.div`
61+
cursor: pointer;
62+
padding: 16px;
63+
background: rgba(0, 0, 0, 0.1);
64+
border-radius: 4;
65+
border: 1px solid rgba(255, 255, 255, 0.1);
66+
67+
a {
68+
display: flex;
69+
align-items: center;
70+
}
71+
72+
&:hover {
73+
background: rgba(0, 0, 0, 0.2);
74+
}
75+
`;
76+
3877
export async function getServerSideProps(context: any) {
3978
const client = Client({
4079
baseURL: "http://localhost:6627",
@@ -50,7 +89,10 @@ export async function getServerSideProps(context: any) {
5089
};
5190
} catch (e) {
5291
return {
53-
notFound: true,
92+
redirect: {
93+
destination: "/tests/reports/how-to-setup",
94+
permanent: false,
95+
},
5496
};
5597
}
5698
}

0 commit comments

Comments
 (0)