ente/src/components/SubmitButton.tsx

31 lines
721 B
TypeScript
Raw Normal View History

2021-04-11 05:02:32 +00:00
import React from 'react';
import { Button, Spinner } from 'react-bootstrap';
interface Props {
loading: boolean;
buttonText: string;
2021-04-26 07:37:34 +00:00
inline?: any;
2021-04-11 05:02:32 +00:00
}
2021-04-26 07:37:34 +00:00
const SubmitButton = ({ loading, buttonText, inline }: Props) => (
2021-04-11 10:07:57 +00:00
<Button
2021-04-25 15:01:44 +00:00
className="submitButton"
variant="outline-success"
2021-04-11 10:07:57 +00:00
type="submit"
2021-04-26 07:37:34 +00:00
block={!inline}
2021-04-11 10:07:57 +00:00
disabled={loading}
2021-04-26 07:37:34 +00:00
style={{ padding: '6px 1em' }}
2021-04-11 10:07:57 +00:00
>
2021-04-11 05:02:32 +00:00
{loading ? (
<Spinner
as="span"
animation="border"
2021-04-11 14:20:24 +00:00
style={{ width: '22px', height: '22px', borderWidth: '0.20em' }}
2021-04-11 05:02:32 +00:00
/>
) : (
buttonText
)}
</Button>
);
export default SubmitButton;