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

Added loading animation buttons #49

Merged
merged 1 commit into from
Jan 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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