zavadil-react-common 1.1.75 → 1.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {PropsWithChildren, useMemo} from "react";
|
|
2
|
+
|
|
3
|
+
export type SpreadProps = {
|
|
4
|
+
center?: boolean;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function Spread({children, center}: PropsWithChildren<SpreadProps>) {
|
|
8
|
+
const css = useMemo(
|
|
9
|
+
() => center === false ? '' : 'd-flex align-items-center justify-content-center',
|
|
10
|
+
[center]
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
return <div
|
|
14
|
+
className={`w-100 h-100 position-absolute ${css}`}
|
|
15
|
+
style={{left: 0, right: 0, top: 0, bottom: 0}}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Spread;
|