Skip to content

Commit afbd8d9

Browse files
refactor: [M3-8827] - Migrate CircleProgress to ui package (#11214)
1 parent 1d0051e commit afbd8d9

File tree

130 files changed

+263
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+263
-289
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Removed
3+
---
4+
5+
Migrate CircleProgress to ui package ([#11214](https://github.com/linode/manager/pull/11214))

packages/manager/src/components/Autocomplete/Autocomplete.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CircleProgress } from '@linode/ui';
12
import { Box, InputAdornment } from '@linode/ui';
23
import CloseIcon from '@mui/icons-material/Close';
34
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
@@ -6,7 +7,6 @@ import React from 'react';
67

78
import { TextField } from 'src/components/TextField';
89

9-
import { CircleProgress } from '../CircleProgress';
1010
import {
1111
CustomPopper,
1212
SelectedIcon,

packages/manager/src/components/CircleProgress/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/manager/src/components/DebouncedSearchTextField/DebouncedSearchTextField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { CircleProgress } from '@linode/ui';
12
import { IconButton, InputAdornment } from '@linode/ui';
23
import Clear from '@mui/icons-material/Clear';
34
import Search from '@mui/icons-material/Search';
45
import { styled } from '@mui/material/styles';
56
import * as React from 'react';
67
import { debounce } from 'throttle-debounce';
78

8-
import { CircleProgress } from 'src/components/CircleProgress';
99
import { TextField } from 'src/components/TextField';
1010

1111
import type { TextFieldProps } from 'src/components/TextField';

packages/manager/src/components/DrawerContent/DrawerContent.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { Notice } from '@linode/ui';
1+
import { CircleProgress, Notice } from '@linode/ui';
22
import * as React from 'react';
33

4-
import { CircleProgress } from 'src/components/CircleProgress';
5-
64
export interface DrawerContentProps {
75
children: React.ReactNode;
86
error: boolean;

packages/manager/src/components/EnhancedSelect/components/LoadingIndicator.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { CircleProgress } from '@linode/ui';
12
import { styled } from '@mui/material/styles';
23
import * as React from 'react';
34

4-
import { CircleProgress } from 'src/components/CircleProgress';
5-
65
export const LoadingIndicator = () => {
76
return <StyledCircleProgress data-testid="input-loading" size="sm" />;
87
};

packages/manager/src/components/LinkButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { Box } from '@linode/ui';
1+
import { Box, CircleProgress } from '@linode/ui';
22
import * as React from 'react';
33
import { makeStyles } from 'tss-react/mui';
44

5-
import { CircleProgress } from 'src/components/CircleProgress';
6-
75
import { StyledLinkButton } from './Button/StyledLinkButton';
86

97
import type { Theme } from '@mui/material/styles';

packages/manager/src/components/PromiseLoader/PromiseLoader.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import { CircleProgress } from '@linode/ui';
12
import * as React from 'react';
23

3-
import { CircleProgress } from 'src/components/CircleProgress';
4-
54
interface State {
65
[name: string]: any;
76
loading: boolean;
@@ -22,6 +21,21 @@ export interface PromiseLoaderResponse<T> {
2221
export default function preload<P>(requests: RequestMap<P>) {
2322
return function (Component: React.ComponentType<P>) {
2423
return class LoadedComponent extends React.Component<P, State> {
24+
static displayName = `PromiseLoader(${
25+
Component.displayName || Component.name
26+
})`;
27+
handleDone = () => {
28+
if (!this.mounted) {
29+
return;
30+
}
31+
32+
this.setState((prevState) => ({ ...prevState, loading: false }));
33+
};
34+
35+
mounted: boolean = false;
36+
37+
state = { loading: true };
38+
2539
componentDidMount() {
2640
this.mounted = true;
2741
const promises = Object.entries(requests).map(([name, request]) =>
@@ -50,6 +64,7 @@ export default function preload<P>(requests: RequestMap<P>) {
5064

5165
Promise.all(promises).then(this.handleDone).catch(this.handleDone);
5266
}
67+
5368
componentWillUnmount() {
5469
this.mounted = false;
5570
}
@@ -62,22 +77,6 @@ export default function preload<P>(requests: RequestMap<P>) {
6277

6378
return <Component {...this.props} {...responses} />;
6479
}
65-
66-
static displayName = `PromiseLoader(${
67-
Component.displayName || Component.name
68-
})`;
69-
70-
handleDone = () => {
71-
if (!this.mounted) {
72-
return;
73-
}
74-
75-
this.setState((prevState) => ({ ...prevState, loading: false }));
76-
};
77-
78-
mounted: boolean = false;
79-
80-
state = { loading: true };
8180
};
8281
};
8382
}

packages/manager/src/components/SplashScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Box } from '@linode/ui';
1+
import { Box, CircleProgress } from '@linode/ui';
22
import * as React from 'react';
33

4-
import { CircleProgress } from 'src/components/CircleProgress';
54
import { srSpeak } from 'src/utilities/accessibility';
65

76
export const SplashScreen = () => {

packages/manager/src/components/SuspenseLoader.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import { CircleProgress } from '@linode/ui';
12
import * as React from 'react';
23

3-
import { CircleProgress } from 'src/components/CircleProgress';
4-
54
interface Props {
65
/**
76
* Ammount of time before the CircleProgress shows

0 commit comments

Comments
 (0)