Skip to content

Commit a1153f2

Browse files
changed loader
1 parent 2b5e30f commit a1153f2

File tree

2 files changed

+15
-40
lines changed

2 files changed

+15
-40
lines changed
Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,23 @@
1-
import { Box, CircularProgress, CircularProgressProps, Typography, type BoxProps } from '@mui/material';
2-
import { type ReactNode, type FC } from 'react';
3-
4-
import { useTheme2 } from '@grafana/ui';
1+
import { type FC } from 'react';
52

63
import { CodeRabbitLogo } from './CodeRabbitLogo';
74

85
export type FnLoaderProps = {
9-
outerContainerProps?: Omit<BoxProps, 'children'>;
10-
innerContainerProps?: Omit<BoxProps, 'children'>;
11-
circularProgressProps?: CircularProgressProps;
12-
text?: ReactNode;
6+
size?: 'small' | 'medium' | 'large';
7+
loadingMessage?: string;
138
};
149

15-
export const FnLoader: FC<FnLoaderProps> = ({
16-
outerContainerProps,
17-
innerContainerProps,
18-
circularProgressProps,
19-
text,
20-
}) => {
21-
const theme = useTheme2();
22-
10+
export const FnLoader: FC<FnLoaderProps> = ({ size = 'medium', loadingMessage = 'Loading dashboard...' }) => {
2311
return (
24-
<Box
25-
display="flex"
26-
justifyContent="center"
27-
alignItems="center"
28-
flexDirection="column"
29-
paddingTop="150px"
30-
{...outerContainerProps}
31-
>
32-
<CodeRabbitLogo width={350} />
33-
<Box marginTop="100px" {...innerContainerProps}>
34-
<CircularProgress
35-
role="alert"
36-
aria-busy="true"
37-
aria-label="Loading..."
38-
disableShrink
39-
sx={{
40-
color: theme.colors.primary.main,
41-
}}
42-
{...circularProgressProps}
43-
/>
44-
</Box>
45-
{typeof text === 'string' ? <Typography>{text}</Typography> : text || null}
46-
</Box>
12+
<div className="hide-theme-toggle relative">
13+
<div className="mx-auto flex w-10/12 flex-col items-center sm:w-full">
14+
{size === 'medium' && <CodeRabbitLogo width={200} className="" />}
15+
<div className="flex items-center justify-center gap-x-4">
16+
<p className="font-poppins text-shimmer from-muted via-secondary to-foreground -mt-2 ml-1 bg-gradient-to-r bg-clip-text text-lg tracking-wide text-transparent">
17+
{loadingMessage}
18+
</p>
19+
</div>
20+
</div>
21+
</div>
4722
);
4823
};

public/microfrontends/fn_dashboard/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<script nonce="" src="../../../public/build/runtime~fn_dashboard.551314fa089c5f51c211.js" type="text/javascript"></script>
2121

22-
<script nonce="" src="../../../public/build/fn_dashboard.40eafadbed9530afa04b.js" type="text/javascript"></script>
22+
<script nonce="" src="../../../public/build/fn_dashboard.cba3a3077df2f940f692.js" type="text/javascript"></script>
2323

2424
</body>
2525
</html>

0 commit comments

Comments
 (0)