Skip to content

Commit b93c556

Browse files
committed
Added proper loading, closes #89
1 parent e2d4cd8 commit b93c556

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

packages/graphql-playground/public/index.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,20 @@
3535
font-size: 32px;
3636
font-weight: 200;
3737
color: rgba(255,255,255,.6);
38-
margin-right: 20px;
38+
margin-left: 20px;
39+
}
40+
img {
41+
width: 78px;
42+
height: 78px;
43+
}
44+
.title {
45+
font-weight: 400;
3946
}
4047
</style>
48+
<img src='/logo.png' alt=''>
4149
<div class="loading">
42-
Loading Playground
50+
Loading <span class="title">GraphQL Playground</span>
4351
</div>
44-
<svg width="50px" height="50px" viewBox="0 0 50 50">
45-
<path d="M38.87,18.81c-1.77-1-4,0.3-4.35,0.53l-7.65,4.35c-1.29-1.03-3.17-0.81-4.19,0.48
46-
c-1.03,1.29-0.81,3.18,0.48,4.2c1.29,1.03,3.17,0.81,4.19-0.48c0.53-0.67,0.75-1.54,0.6-2.38l7.63-4.34l0.05-0.03
47-
c0.5-0.32,1.66-0.79,2.21-0.48c0.39,0.22,0.62,0.96,0.63,2.05h-0.01v9.59c0,0.89-0.48,1.72-1.25,2.17L26.25,40.8
48-
c-0.77,0.45-1.72,0.45-2.5,0l-10.96-6.35c-0.77-0.45-1.25-1.27-1.25-2.17V19.6c0-0.89,0.48-1.72,1.25-2.17l9.92-5.74
49-
c1.08,1.24,2.97,1.37,4.21,0.29c1.24-1.08,1.37-2.97,0.29-4.22C26.12,6.53,24.24,6.4,23,7.48c-0.64,0.55-1.01,1.35-1.02,2.2
50-
L11.74,15.6c-1.43,0.83-2.31,2.35-2.31,4v12.68c0,1.65,0.88,3.18,2.3,4l10.96,6.35c1.43,0.82,3.18,0.82,4.61,0l10.96-6.35
51-
c1.42-0.83,2.3-2.35,2.3-4v-9.22h0.01C40.63,20.91,40.05,19.47,38.87,18.81" fill="#27AE60"/>
52-
</svg>
5352
</div>
5453
<script>
5554
window.addEventListener('load', function(event) {
31.3 KB
Loading

packages/graphql-playground/src/components/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import createStore from '../createStore'
44
import Playground from './Playground'
55
import 'isomorphic-fetch'
66
import EndpointPopup from './EndpointPopup'
7+
import Loading from './Loading'
78
// import {BrowserRouter} from 'react-router-dom'
89

910
const store = createStore()
@@ -124,7 +125,7 @@ class App extends React.Component<Props, State> {
124125
}
125126
`}</style>
126127
{this.state.loading
127-
? <div className="loading">Loading</div>
128+
? <Loading />
128129
: !this.state.endpoint || this.state.endpoint.length === 0
129130
? <EndpointPopup
130131
onRequestClose={this.handleChangeEndpoint}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as React from 'react'
2+
3+
export default function Loading() {
4+
return (
5+
<div className="loading">
6+
<style>{`
7+
.loading {
8+
height: 100%;
9+
width: 100%;
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
}
14+
.text {
15+
font-size: 32px;
16+
font-weight: 200;
17+
color: rgba(255,255,255,.6);
18+
margin-left: 20px;
19+
}
20+
img {
21+
width: 78px;
22+
height: 78px;
23+
}
24+
.title {
25+
font-weight: 400;
26+
}
27+
`}</style>
28+
<img src="/logo.png" alt="" />
29+
<div className="text">
30+
Loading <span className="title">GraphQL Playground</span>
31+
</div>
32+
</div>
33+
)
34+
}

0 commit comments

Comments
 (0)