File tree Expand file tree Collapse file tree 6 files changed +42
-14
lines changed Expand file tree Collapse file tree 6 files changed +42
-14
lines changed Original file line number Diff line number Diff line change 1
- import Button from "@material-ui/core/Button"
1
+ import IconButton from "@material-ui/core/Button"
2
2
import { makeStyles } from "@material-ui/core/styles"
3
3
import Tooltip from "@material-ui/core/Tooltip"
4
4
import Check from "@material-ui/icons/Check"
@@ -45,16 +45,14 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
45
45
return (
46
46
< Tooltip title = "Copy to Clipboard" placement = "top" >
47
47
< div className = { combineClasses ( [ styles . copyButtonWrapper , wrapperClassName ] ) } >
48
- < Button
48
+ < IconButton
49
49
className = { combineClasses ( [ styles . copyButton , buttonClassName ] ) }
50
50
onClick = { copyToClipboard }
51
51
size = "small"
52
- startIcon = {
53
- isCopied ? < Check className = { styles . fileCopyIcon } /> : < FileCopyIcon className = { styles . fileCopyIcon } />
54
- }
55
52
>
56
- { ctaCopy && ctaCopy }
57
- </ Button >
53
+ { isCopied ? < Check className = { styles . fileCopyIcon } /> : < FileCopyIcon className = { styles . fileCopyIcon } /> }
54
+ { ctaCopy && < div className = { styles . buttonCopy } > { ctaCopy } </ div > }
55
+ </ IconButton >
58
56
</ div >
59
57
</ Tooltip >
60
58
)
@@ -80,4 +78,7 @@ const useStyles = makeStyles((theme) => ({
80
78
width : 20 ,
81
79
height : 20 ,
82
80
} ,
81
+ buttonCopy : {
82
+ marginLeft : theme . spacing ( 1 ) ,
83
+ } ,
83
84
} ) )
Original file line number Diff line number Diff line change 1
1
import { makeStyles } from "@material-ui/core/styles"
2
2
import React from "react"
3
3
import { CodeBlock } from "../CodeBlock/CodeBlock"
4
- import { createCtas } from "./ReportButtons "
4
+ import { createCtas } from "./createCtas "
5
5
6
6
const Language = {
7
7
reportLoading : "Generating crash report..." ,
Original file line number Diff line number Diff line change
1
+ import { ComponentMeta , Story } from "@storybook/react"
2
+ import React from "react"
3
+ import { RuntimeErrorState , RuntimeErrorStateProps } from "./RuntimeErrorState"
4
+
5
+ const error = new Error ( "An error occurred" )
6
+
7
+ export default {
8
+ title : "components/RuntimeErrorState" ,
9
+ component : RuntimeErrorState ,
10
+ argTypes : {
11
+ error : {
12
+ defaultValue : error ,
13
+ } ,
14
+ } ,
15
+ } as ComponentMeta < typeof RuntimeErrorState >
16
+
17
+ const Template : Story < RuntimeErrorStateProps > = ( args ) => < RuntimeErrorState { ...args } />
18
+
19
+ export const Errored = Template . bind ( { } )
20
+ Errored . parameters = {
21
+ // The RuntimeErrorState is noisy for chromatic, because it renders an actual error
22
+ // along with the stacktrace - and the stacktrace includes the full URL of
23
+ // scripts in the stack. This is problematic, because every deployment uses
24
+ // a different URL, causing the validation to fail.
25
+ chromatic : { disableSnapshot : true } ,
26
+ }
27
+
28
+ Errored . args = {
29
+ error,
30
+ }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const Language = {
15
15
link : "send it to us." ,
16
16
}
17
17
18
- interface RuntimeErrorStateProps {
18
+ export interface RuntimeErrorStateProps {
19
19
error : Error
20
20
}
21
21
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ const useStyles = makeStyles((theme) => ({
59
59
marginLeft : 0 ,
60
60
flex : theme . spacing ( 1 ) ,
61
61
textTransform : "uppercase" ,
62
- fontSize : theme . typography . button . fontSize ,
62
+ fontSize : theme . typography . fontSize ,
63
63
} ,
64
64
65
65
copyButton : {
66
66
width : "100%" ,
67
67
marginRight : theme . spacing ( 1 ) ,
68
68
backgroundColor : theme . palette . primary . main ,
69
69
textTransform : "uppercase" ,
70
- fontSize : theme . typography . button . fontSize ,
70
+ fontSize : theme . typography . fontSize ,
71
71
} ,
72
72
} ) )
Original file line number Diff line number Diff line change @@ -37,7 +37,4 @@ export const darkPalette: PaletteOptions = {
37
37
success : {
38
38
main : "#6BBE00" ,
39
39
} ,
40
- error : {
41
- main : "#DD4764" ,
42
- } ,
43
40
}
You can’t perform that action at this time.
0 commit comments