11import React from 'react' ;
22import { ReactComponent as ImageOops } from 'images/img-oops.svg' ;
3+ import './PlayErrorBoundary.css' ;
34
45class PlayErrorBoundary extends React . Component {
56 constructor ( props ) {
@@ -32,23 +33,23 @@ class PlayErrorBoundary extends React.Component {
3233 render ( ) {
3334 if ( this . state . hasError ) {
3435 return (
35- < div className = "play-error-boundary" style = { styles . container } >
36- < ImageOops style = { styles . image } />
37- < h2 style = { styles . title } >
36+ < div className = "play-error-boundary play-error- container" >
37+ < ImageOops className = "play-error- image" />
38+ < h2 className = "play-error- title" >
3839 { this . state . isChunkError ? 'Failed to load this play' : 'Something went wrong' }
3940 </ h2 >
40- < p style = { styles . message } >
41+ < p className = "play-error- message" >
4142 { this . state . isChunkError
4243 ? 'There was a network error loading this play. Please check your connection and try again.'
4344 : `An error occurred while rendering "${ this . props . playName || 'this play' } ".` }
4445 </ p >
45- < div style = { styles . actions } >
46+ < div className = "play-error- actions" >
4647 { this . state . isChunkError && (
47- < button style = { styles . retryButton } onClick = { this . handleRetry } >
48+ < button className = "play-error-retry-button" onClick = { this . handleRetry } >
4849 Retry
4950 </ button >
5051 ) }
51- < button style = { styles . backButton } onClick = { this . handleGoBack } >
52+ < button className = "play-error-back-button" onClick = { this . handleGoBack } >
5253 Back to Plays
5354 </ button >
5455 </ div >
@@ -60,61 +61,4 @@ class PlayErrorBoundary extends React.Component {
6061 }
6162}
6263
63- const styles = {
64- container : {
65- display : 'flex' ,
66- flexDirection : 'column' ,
67- alignItems : 'center' ,
68- justifyContent : 'center' ,
69- padding : '3rem 1.5rem' ,
70- textAlign : 'center' ,
71- minHeight : '50vh'
72- } ,
73- image : {
74- width : '200px' ,
75- height : 'auto' ,
76- marginBottom : '1.5rem' ,
77- opacity : 0.8
78- } ,
79- title : {
80- fontSize : '1.5rem' ,
81- fontWeight : 600 ,
82- color : '#333' ,
83- margin : '0 0 0.75rem'
84- } ,
85- message : {
86- fontSize : '1rem' ,
87- color : '#666' ,
88- maxWidth : '500px' ,
89- lineHeight : 1.5 ,
90- margin : '0 0 1.5rem'
91- } ,
92- actions : {
93- display : 'flex' ,
94- gap : '1rem'
95- } ,
96- retryButton : {
97- padding : '0.6rem 1.5rem' ,
98- fontSize : '0.95rem' ,
99- fontWeight : 600 ,
100- border : 'none' ,
101- borderRadius : '6px' ,
102- cursor : 'pointer' ,
103- background : '#00f2fe' ,
104- color : '#fff' ,
105- transition : 'opacity 0.2s'
106- } ,
107- backButton : {
108- padding : '0.6rem 1.5rem' ,
109- fontSize : '0.95rem' ,
110- fontWeight : 600 ,
111- border : '2px solid #00f2fe' ,
112- borderRadius : '6px' ,
113- cursor : 'pointer' ,
114- background : 'transparent' ,
115- color : '#00f2fe' ,
116- transition : 'opacity 0.2s'
117- }
118- } ;
119-
12064export default PlayErrorBoundary ;
0 commit comments