Skip to content

Commit 59be45a

Browse files
committed
add body txt and standardize btn size
1 parent 2d6531b commit 59be45a

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

site/src/components/CodeBlock/CodeBlock.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({ lines, ctas, className = "
3535
const useStyles = makeStyles((theme) => ({
3636
root: {
3737
minHeight: 156,
38+
maxHeight: 240,
39+
overflowY: "scroll",
3840
background: theme.palette.background.default,
3941
color: theme.palette.text.primary,
4042
fontFamily: MONOSPACE_FONT_FAMILY,

site/src/components/RuntimeErrorState/ReportButtons.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ const useStyles = makeStyles((theme) => ({
5959
marginLeft: 0,
6060
flex: theme.spacing(1),
6161
textTransform: "uppercase",
62+
fontSize: theme.typography.button.fontSize,
6263
},
6364

6465
copyButton: {
6566
width: "100%",
6667
marginRight: theme.spacing(1),
6768
backgroundColor: theme.palette.primary.main,
6869
textTransform: "uppercase",
70+
fontSize: theme.typography.button.fontSize,
6971
},
7072
}))

site/src/components/RuntimeErrorState/RuntimeErrorState.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ import Box from "@material-ui/core/Box"
22
import { makeStyles } from "@material-ui/core/styles"
33
import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"
44
import React, { useEffect, useReducer } from "react"
5+
import { Link } from "react-router-dom"
56
import { mapStackTrace } from "sourcemapped-stacktrace"
67
import { Margins } from "../Margins/Margins"
78
import { Section } from "../Section/Section"
9+
import { Typography } from "../Typography/Typography"
810
import { reducer, RuntimeErrorReport, stackTraceAvailable, stackTraceUnavailable } from "./RuntimeErrorReport"
911

1012
const Language = {
1113
title: "Coder encountered an error",
14+
body: "Please copy the crash log using the button below and",
15+
link: "send it to us.",
1216
}
1317

1418
interface RuntimeErrorStateProps {
@@ -20,7 +24,6 @@ interface RuntimeErrorStateProps {
2024
*/
2125
const ErrorStateTitle = () => {
2226
const styles = useStyles()
23-
2427
return (
2528
<Box className={styles.title} display="flex" alignItems="center">
2629
<ErrorOutlineIcon />
@@ -29,6 +32,28 @@ const ErrorStateTitle = () => {
2932
)
3033
}
3134

35+
/**
36+
* A description for our error boundary UI
37+
*/
38+
const ErrorStateDescription = () => {
39+
const styles = useStyles()
40+
return (
41+
<Typography variant="body2" color="textSecondary">
42+
{Language.body}&nbsp;
43+
<Link
44+
to="#"
45+
onClick={(e) => {
46+
window.location.href = "mailto:support@coder.com"
47+
e.preventDefault()
48+
}}
49+
className={styles.link}
50+
>
51+
{Language.link}
52+
</Link>
53+
</Typography>
54+
)
55+
}
56+
3257
/**
3358
* An error UI that is displayed when our error boundary (ErrorBoundary.tsx) is triggered
3459
*/
@@ -47,7 +72,7 @@ export const RuntimeErrorState: React.FC<RuntimeErrorStateProps> = ({ error }) =
4772
return (
4873
<Box display="flex" flexDirection="column">
4974
<Margins>
50-
<Section className={styles.reportContainer} title={<ErrorStateTitle />}>
75+
<Section className={styles.reportContainer} title={<ErrorStateTitle />} description={<ErrorStateDescription />}>
5176
<RuntimeErrorReport error={reportState.error} mappedStack={reportState.mappedStack} />
5277
</Section>
5378
</Margins>
@@ -65,7 +90,10 @@ const useStyles = makeStyles((theme) => ({
6590
color: theme.palette.error.main,
6691
},
6792
},
68-
93+
link: {
94+
textDecoration: "none",
95+
color: theme.palette.primary.main,
96+
},
6997
reportContainer: {
7098
display: "flex",
7199
justifyContent: "center",

site/src/components/Stack/Stack.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const useStyles = makeStyles((theme) => ({
1414
}))
1515

1616
export const Stack: React.FC<StackProps> = ({ children, spacing = 2 }) => {
17-
throw new Error("uh oh")
18-
1917
const styles = useStyles({ spacing })
2018
return <div className={styles.stack}>{children}</div>
2119
}

0 commit comments

Comments
 (0)