mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-26 00:21:36 +01:00
Merge branch 'spinner-element-class-name' into 'dev'
Add className to SpinnerElement. See merge request turris/reforis/foris-js!55
This commit is contained in:
commit
fd1518265f
|
@ -46,6 +46,8 @@ export function Spinner({
|
||||||
SpinnerElement.propTypes = {
|
SpinnerElement.propTypes = {
|
||||||
/** Spinner's size */
|
/** Spinner's size */
|
||||||
small: PropTypes.bool,
|
small: PropTypes.bool,
|
||||||
|
/** Additional className */
|
||||||
|
className: PropTypes.string,
|
||||||
/** Children components */
|
/** Children components */
|
||||||
children: PropTypes.oneOfType([
|
children: PropTypes.oneOfType([
|
||||||
PropTypes.arrayOf(PropTypes.node),
|
PropTypes.arrayOf(PropTypes.node),
|
||||||
|
@ -53,13 +55,16 @@ SpinnerElement.propTypes = {
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
export function SpinnerElement({ small, children }) {
|
export function SpinnerElement({ small, className, children }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`spinner-border ${small ? "spinner-border-sm" : ""}`} role="status">
|
<div
|
||||||
|
className={`spinner-border ${small ? "spinner-border-sm" : ""} ${className || ""}`.trim()}
|
||||||
|
role="status"
|
||||||
|
>
|
||||||
<span className="sr-only" />
|
<span className="sr-only" />
|
||||||
</div>
|
</div>
|
||||||
<div className="spinner-text">{children}</div>
|
{children && <div className="spinner-text">{children}</div>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,6 @@ exports[`conditional HOCs withSpinner should render spinner 1`] = `
|
||||||
class="sr-only"
|
class="sr-only"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="spinner-text"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -53,9 +50,6 @@ exports[`conditional HOCs withSpinnerOnSending should render spinner 1`] = `
|
||||||
class="sr-only"
|
class="sr-only"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="spinner-text"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user