From aac6c6bf2a7a115d90697d04a2205f267ba9b6d9 Mon Sep 17 00:00:00 2001 From: Bogdan Bodnar Date: Fri, 6 Dec 2019 11:31:43 +0100 Subject: [PATCH] Add className to SpinnerElement. --- src/bootstrap/Spinner.js | 11 ++++++++--- .../__snapshots__/conditionalHOCs.test.js.snap | 10 ++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/Spinner.js b/src/bootstrap/Spinner.js index 33cca31..07e856f 100644 --- a/src/bootstrap/Spinner.js +++ b/src/bootstrap/Spinner.js @@ -46,6 +46,8 @@ export function Spinner({ SpinnerElement.propTypes = { /** Spinner's size */ small: PropTypes.bool, + /** Additional className */ + className: PropTypes.string, /** Children components */ children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), @@ -53,13 +55,16 @@ SpinnerElement.propTypes = { ]), }; -export function SpinnerElement({ small, children }) { +export function SpinnerElement({ small, className, children }) { return ( <> -
+
-
{children}
+ {children &&
{children}
} ); } diff --git a/src/utils/__tests__/__snapshots__/conditionalHOCs.test.js.snap b/src/utils/__tests__/__snapshots__/conditionalHOCs.test.js.snap index f2e1040..3a178ea 100644 --- a/src/utils/__tests__/__snapshots__/conditionalHOCs.test.js.snap +++ b/src/utils/__tests__/__snapshots__/conditionalHOCs.test.js.snap @@ -26,16 +26,13 @@ exports[`conditional HOCs withSpinner should render spinner 1`] = ` class="spinner-wrapper my-3 text-center" >
-
`; @@ -46,16 +43,13 @@ exports[`conditional HOCs withSpinnerOnSending should render spinner 1`] = ` class="spinner-wrapper my-3 text-center" >
-
`;