mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 02:21:48 +08:00

* initial attempt at body scrolling * fix login layout * minor fixes * "fix" some fixed position stuff * remember scroll position in dashboard page * fix unit tests * expose chrome header height in runtime and fix connections sticky header * fix panel edit in scenes * fix unit tests * make useChromeHeaderHeight backwards compatible, fix plugin details double scrollbar * fix sticky behaviour in explore metrics * handle when undefined * deprecate scrollRef/scrollTop * fix extra overflow on firefox
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { css, cx } from '@emotion/css';
|
|
|
|
import { GrafanaTheme2 } from '@grafana/data';
|
|
import { config } from '@grafana/runtime';
|
|
import { useStyles2 } from '@grafana/ui';
|
|
|
|
import { BouncingLoader } from '../components/BouncingLoader/BouncingLoader';
|
|
|
|
export function GrafanaRouteLoading() {
|
|
const styles = useStyles2(getStyles);
|
|
|
|
return (
|
|
<div
|
|
className={cx({
|
|
[styles.loadingPage]: !config.featureToggles.bodyScrolling,
|
|
[styles.loadingPageBodyScrolling]: config.featureToggles.bodyScrolling,
|
|
})}
|
|
>
|
|
<BouncingLoader />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const getStyles = (theme: GrafanaTheme2) => ({
|
|
loadingPage: css({
|
|
backgroundColor: theme.colors.background.primary,
|
|
height: '100%',
|
|
flexDrection: 'column',
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
}),
|
|
loadingPageBodyScrolling: css({
|
|
backgroundColor: theme.colors.background.primary,
|
|
flex: 1,
|
|
flexDrection: 'column',
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
}),
|
|
});
|