Skip to content

Commit

Permalink
Added loading animation
Browse files Browse the repository at this point in the history
  • Loading branch information
VipinVIP committed Jan 30, 2021
1 parent 99e77b6 commit 5a2ccc5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
10 changes: 9 additions & 1 deletion pages/poll/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Container,
Jumbotron,
Button,
Spinner,
OverlayTrigger,
Tooltip,
} from "react-bootstrap";
Expand Down Expand Up @@ -152,7 +153,14 @@ const Create = (): JSX.Element => {
disabled
}
>
Create Poll
{!disabled ? (
`Create Poll`
) : (
<>
<Spinner as="span" animation="grow" size="sm" />
&nbsp;Loading...
</>
)}
</Button>
<ResponseMessage
response={response}
Expand Down
11 changes: 9 additions & 2 deletions src/components/SubmitChoices.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "react-bootstrap";
import { Button, Spinner } from "react-bootstrap";
import { useState } from "react";
import Router from "next/router";
import { serverAPI } from "../api/server";
Expand Down Expand Up @@ -47,7 +47,14 @@ const SubmitChoices = (props: {
disabled={!newVote.name || newVote.choices.length === 0 || disabled}
onClick={handleSubmit}
>
Mark your availability
{!disabled ? (
`Mark your availability`
) : (
<>
<Spinner as="span" animation="grow" size="sm" />
&nbsp;Loading...
</>
)}
</Button>
<ResponseMessage
response={response}
Expand Down
11 changes: 9 additions & 2 deletions src/components/SubmitFinalChoice.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "react-bootstrap";
import { Button, Spinner } from "react-bootstrap";
import { useSelector } from "react-redux";
import { useState } from "react";
import Router from "next/router";
Expand Down Expand Up @@ -58,7 +58,14 @@ const SubmitFinalChoice = (props: {
disabled={!finalChoice || disabled}
onClick={handleSubmit}
>
Mark final option
{!disabled ? (
`Mark final option`
) : (
<>
<Spinner as="span" animation="grow" size="sm" />
&nbsp;Loading...
</>
)}
</Button>
<ResponseMessage
response={response}
Expand Down

0 comments on commit 5a2ccc5

Please sign in to comment.