Skip to content

Commit 0a53f49

Browse files
authored
Merge pull request #7723 from marmelab/7706-cannot-change-color-using-sx-on-loading-page
Add sx prop to Loading component
2 parents f8bc921 + 2875070 commit 0a53f49

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/ra-ui-materialui/src/layout/Loading.tsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import * as React from 'react';
22
import { styled } from '@mui/material/styles';
3+
import { SxProps } from '@mui/material';
34
import PropTypes from 'prop-types';
45
import CircularProgress from '@mui/material/CircularProgress';
56
import { useTranslate } from 'ra-core';
67

7-
export const Loading = props => {
8+
export const Loading = (props: LoadingProps) => {
89
const {
910
className,
1011
loadingPrimary = 'ra.page.loading',
1112
loadingSecondary = 'ra.message.loading',
13+
...rest
1214
} = props;
1315

1416
const translate = useTranslate();
1517
return (
16-
<Root className={className}>
18+
<Root className={className} {...rest}>
1719
<div className={LoadingClasses.message}>
1820
<CircularProgress
1921
className={LoadingClasses.icon}
@@ -37,6 +39,13 @@ Loading.defaultProps = {
3739
loadingSecondary: 'ra.message.loading',
3840
};
3941

42+
export interface LoadingProps {
43+
className?: string;
44+
loadingPrimary?: string;
45+
loadingSecondary?: string;
46+
sx?: SxProps;
47+
}
48+
4049
const PREFIX = 'RaLoading';
4150

4251
export const LoadingClasses = {

0 commit comments

Comments
 (0)