Skip to content

Commit 18ea2e0

Browse files
committed
retaining code structure of CSS file
1 parent e3ece0f commit 18ea2e0

2 files changed

Lines changed: 68 additions & 64 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.play-error-container {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
justify-content: center;
6+
padding: 3rem 1.5rem;
7+
text-align: center;
8+
min-height: 50vh;
9+
}
10+
11+
.play-error-image {
12+
width: 200px;
13+
height: auto;
14+
margin-bottom: 1.5rem;
15+
opacity: 0.8;
16+
}
17+
18+
.play-error-title {
19+
font-size: 1.5rem;
20+
font-weight: 600;
21+
color: #333;
22+
margin: 0 0 0.75rem;
23+
}
24+
25+
.play-error-message {
26+
font-size: 1rem;
27+
color: #666;
28+
max-width: 500px;
29+
line-height: 1.5;
30+
margin: 0 0 1.5rem;
31+
}
32+
33+
.play-error-actions {
34+
display: flex;
35+
gap: 1rem;
36+
}
37+
38+
.play-error-retry-button {
39+
padding: 0.6rem 1.5rem;
40+
font-size: 0.95rem;
41+
font-weight: 600;
42+
border: none;
43+
border-radius: 6px;
44+
cursor: pointer;
45+
background: #00f2fe;
46+
color: #fff;
47+
transition: opacity 0.2s;
48+
}
49+
50+
.play-error-back-button {
51+
padding: 0.6rem 1.5rem;
52+
font-size: 0.95rem;
53+
font-weight: 600;
54+
border: 2px solid #00f2fe;
55+
border-radius: 6px;
56+
cursor: pointer;
57+
background: transparent;
58+
color: #00f2fe;
59+
transition: opacity 0.2s;
60+
}
Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { ReactComponent as ImageOops } from 'images/img-oops.svg';
3+
import './PlayErrorBoundary.css';
34

45
class 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-
12064
export default PlayErrorBoundary;

0 commit comments

Comments
 (0)