Skip to content

Commit

Permalink
Merge pull request #49 from VipinVIP/button-improve
Browse files Browse the repository at this point in the history
Added  loading animation buttons
  • Loading branch information
anandbaburajan authored Jan 30, 2021
2 parents 99e77b6 + 5a2ccc5 commit b04b8b8
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

1 comment on commit b04b8b8

@vercel
Copy link

@vercel vercel bot commented on b04b8b8 Jan 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.