From 83f1c601bdf56c87e01567a783fc35522fa3d158 Mon Sep 17 00:00:00 2001 From: Alexandra Vargas Date: Tue, 29 Nov 2022 16:15:54 +0100 Subject: [PATCH] user essentials mob! :trident: --- .../src/components/LoadingBar/LoadingBar.tsx | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx index 4a5f939f148..b9791a4cfde 100644 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx +++ b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx @@ -19,25 +19,13 @@ export interface LoadingBarProps { /** * @internal */ -export const LoadingBar: React.FC = ({ - containerWidth, - width, - height, - ariaLabel = 'Loading bar', - barColor = 'blue', -}) => { - const theme = useTheme2(); - const loadingStyles = getLoadingStyes(theme, containerWidth, width, height, barColor); - return
; +export const LoadingBar: React.FC = ({ containerWidth, width, height, ariaLabel = 'Loading bar' }) => { + const loadingStyles = getLoadingStyes(containerWidth, width, height); + return
; }; -const getLoadingStyes = ( - theme: GrafanaTheme2, - containerWidth: number, - width?: number, - height?: number, - barColor?: string -) => { +const getLoadingStyes = (containerWidth: number, width?: number, height?: number) => { + const theme = useTheme2(); const loadingWidth = width ?? 128; const loadingAnimation = keyframes({ '0%': { @@ -50,8 +38,8 @@ const getLoadingStyes = ( return { loading: css({ width: `${loadingWidth}px`, - height: `${height ?? 2}px`, - background: 'linear-gradient(90deg, rgba(110, 159, 255, 0) 0%, #6E9FFF 80.75%, rgba(110, 159, 255, 0) 100%)', + height: `${height ?? 2}ipx`, + background: `linear-gradient(90deg, rgba(110, 159, 255, 0) 0%, ${theme.palette.blueLight} 80.75%, rgba(110, 159, 255, 0) 100%)`, position: 'absolute', animation: `${loadingAnimation} 2s infinite linear`, willChange: 'transform',