Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Loading /> #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ import "./App.scss";
import Home from "./Home";
import Appointment from "./Appointment";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";

const Loading = () => (
<div className="loading">
<span>/</span>
<span>-</span>
<span>\</span>
<span>|</span>
<div>Loading...</div>
</div>
);
const App = () => (
<Router>
<div className="App">
Expand Down Expand Up @@ -38,6 +48,8 @@ const App = () => (
</svg>
</a>
</h1>

<Loading />
<Switch>
<Route path="/:id/:ts" component={Appointment} />
<Route path="/" component={Home} />
Expand Down
28 changes: 28 additions & 0 deletions client/src/components/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@
* {
box-sizing: border-box;
}
@keyframes loading {
0% {
opacity: 1;
}
25% {
opacity: 0;
}
100% {
opacity: 0;
}
}
.loading {
position: relative;
display: inline-block;
padding-left: 1rem;
}
.loading span {
position: absolute;
left: 0;
opacity: 0;
animation: loading 0.5s infinite step-end;
display: inline-block;
@for $i from 1 through 4 {
&:nth-child(#{$i}) {
animation-delay: #{$i / 8}s;
}
}
}

html,
body,
Expand Down