mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-26 00:21:36 +01:00
Merge branch 'with-either-props' into 'dev'
Fix for withEither See merge request turris/reforis/foris-js!40
This commit is contained in:
commit
b3bb4de646
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "foris",
|
"name": "foris",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "foris",
|
"name": "foris",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"description": "Set of components and utils for Foris and its plugins.",
|
"description": "Set of components and utils for Foris and its plugins.",
|
||||||
"author": "CZ.NIC, z.s.p.o.",
|
"author": "CZ.NIC, z.s.p.o.",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -24,18 +24,18 @@ Spinner.defaultProps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Spinner({
|
export function Spinner({
|
||||||
fullScreen, children, className, ...props
|
fullScreen, children, className,
|
||||||
}) {
|
}) {
|
||||||
if (!fullScreen) {
|
if (!fullScreen) {
|
||||||
return (
|
return (
|
||||||
<div className={`spinner-wrapper ${className || "my-3 text-center"}`} {...props}>
|
<div className={`spinner-wrapper ${className || "my-3 text-center"}`}>
|
||||||
<SpinnerElement>{children}</SpinnerElement>
|
<SpinnerElement>{children}</SpinnerElement>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="spinner-fs-wrapper" {...props}>
|
<div className="spinner-fs-wrapper">
|
||||||
<div className="spinner-fs-background">
|
<div className="spinner-fs-background">
|
||||||
<SpinnerElement>{children}</SpinnerElement>
|
<SpinnerElement>{children}</SpinnerElement>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { ErrorMessage } from "./ErrorMessage";
|
||||||
function withEither(conditionalFn, Either) {
|
function withEither(conditionalFn, Either) {
|
||||||
return (Component) => (props) => {
|
return (Component) => (props) => {
|
||||||
if (conditionalFn(props)) {
|
if (conditionalFn(props)) {
|
||||||
return <Either />;
|
return <Either {...props} />;
|
||||||
}
|
}
|
||||||
return <Component {...props} />;
|
return <Component {...props} />;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user