mirror of https://github.com/mkrhere/pw2
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
408 B
23 lines
408 B
import React from "react";
|
|
|
|
type Props = {
|
|
inline?: boolean;
|
|
x?: number;
|
|
y?: number;
|
|
};
|
|
|
|
const rem = (x?: number) => (x === 0 ? x : x ? `${x}rem` : "100%");
|
|
|
|
export const Spacer: React.FC<Props> = ({ inline, x, y = 1 }) => {
|
|
return (
|
|
<span
|
|
// identifier
|
|
className="spacer"
|
|
style={{
|
|
display: inline ? "inline-block" : "block",
|
|
minWidth: rem(x),
|
|
minHeight: rem(y),
|
|
}}
|
|
/>
|
|
);
|
|
};
|
|
|