mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
use flex for centering
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
7d242385ab
commit
97b2fc7d31
@ -46,7 +46,11 @@ export class Sidebar extends React.Component<Props> {
|
|||||||
|
|
||||||
renderCustomResources() {
|
renderCustomResources() {
|
||||||
if (crdStore.isLoading) {
|
if (crdStore.isLoading) {
|
||||||
return <Spinner centerHorizontal />;
|
return (
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<Spinner />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.entries(crdStore.groups).map(([group, crds]) => {
|
return Object.entries(crdStore.groups).map(([group, crds]) => {
|
||||||
|
|||||||
@ -34,10 +34,6 @@
|
|||||||
margin-top: calc(var(--spinner-size) / -2);
|
margin-top: calc(var(--spinner-size) / -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.centerHorizontal {
|
|
||||||
margin-left: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes rotate {
|
@keyframes rotate {
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
|||||||
@ -6,19 +6,17 @@ import { cssNames } from "../../utils";
|
|||||||
export interface SpinnerProps extends React.HTMLProps<any> {
|
export interface SpinnerProps extends React.HTMLProps<any> {
|
||||||
singleColor?: boolean;
|
singleColor?: boolean;
|
||||||
center?: boolean;
|
center?: boolean;
|
||||||
centerHorizontal?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Spinner extends React.Component<SpinnerProps, {}> {
|
export class Spinner extends React.Component<SpinnerProps, {}> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
singleColor: true,
|
singleColor: true,
|
||||||
center: false,
|
center: false,
|
||||||
centerHorizontal: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { center, singleColor, centerHorizontal, className, ...props } = this.props;
|
const { center, singleColor, className, ...props } = this.props;
|
||||||
const classNames = cssNames("Spinner", className, { singleColor, center, centerHorizontal });
|
const classNames = cssNames("Spinner", className, { singleColor, center });
|
||||||
|
|
||||||
return <div {...props} className={classNames} />;
|
return <div {...props} className={classNames} />;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user