Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 9bb7f40

Browse files
committed
feat: add loading spinner
1 parent 4da0738 commit 9bb7f40

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/App.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from "react";
2-
import { Container, Row, Col, Tabs, Tab } from "react-bootstrap";
2+
import { Container, Row, Col, Tabs, Tab, Spinner } from "react-bootstrap";
33
import { Editor } from "@/components/Editor";
44
import { RuleConfig } from "@/components/RuleConfig";
55
import { Messages } from "@/components/Messages";
@@ -78,14 +78,23 @@ export const App: FC = () => {
7878
</Tabs>
7979
</Col>
8080
<Col>
81-
<Tabs>
82-
<Tab eventKey="messages" title="Messages">
83-
<Messages messages={messages} />
84-
</Tab>
85-
<Tab eventKey="fixed" title="Fixed">
86-
<Fixed code={fixed} />
87-
</Tab>
88-
</Tabs>
81+
{linter === null ? (
82+
<div>
83+
<Spinner animation="border" role="status" variant="primary">
84+
<span className="sr-only">Loading...</span>
85+
</Spinner>
86+
Loading... please wait
87+
</div>
88+
) : (
89+
<Tabs>
90+
<Tab eventKey="messages" title="Messages">
91+
<Messages messages={messages} />
92+
</Tab>
93+
<Tab eventKey="fixed" title="Fixed">
94+
<Fixed code={fixed} />
95+
</Tab>
96+
</Tabs>
97+
)}
8998
</Col>
9099
</Row>
91100
</Container>

0 commit comments

Comments
 (0)