Skip to content

Commit

Permalink
Fix imports form 'react-component-groups'
Browse files Browse the repository at this point in the history
  • Loading branch information
fhlavac committed Sep 19, 2023
1 parent 326b478 commit cc5e3ef
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 32 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dependencies": {
"@redhat-cloud-services/frontend-components-utilities": "^4.0.0",
"@redhat-cloud-services/types": "^0.0.24",
"@patternfly/react-component-groups": "^1.0.13",
"@patternfly/react-component-groups": "^1.0.17",
"@scalprum/core": "^0.5.1",
"@scalprum/react-core": "^0.5.1",
"sanitize-html": "^2.7.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Battery/Battery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { Battery as BatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import BatteryPF, { BatteryProps } from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated Battery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Battery: React.FunctionComponent<any> = BatteryPF;
const Battery: React.FunctionComponent<BatteryProps> = BatteryPF;

export default Battery;
4 changes: 2 additions & 2 deletions packages/components/src/Battery/CriticalBattery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { CriticalBattery as CriticalBatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import Battery, { BatteryProps } from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated CriticalBattery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const CriticalBattery: React.FunctionComponent = CriticalBatteryPF;
const CriticalBattery: React.FunctionComponent<BatteryProps> = (props) => <Battery {...props} severity="critical" />;

export default CriticalBattery;
4 changes: 2 additions & 2 deletions packages/components/src/Battery/HighBattery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { HighBattery as HighBatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import Battery, { BatteryProps } from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated HighBattery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const HighBattery: React.FunctionComponent = HighBatteryPF;
const HighBattery: React.FunctionComponent<BatteryProps> = (props) => <Battery {...props} severity="high" />;

export default HighBattery;
4 changes: 2 additions & 2 deletions packages/components/src/Battery/LowBattery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { LowBattery as LowBatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import Battery, { BatteryProps } from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated LowBattery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const LowBattery: React.FunctionComponent = LowBatteryPF;
const LowBattery: React.FunctionComponent<BatteryProps> = (props) => <Battery {...props} severity="low" />;

export default LowBattery;
4 changes: 2 additions & 2 deletions packages/components/src/Battery/MediumBattery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { MediumBattery as MediumBatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import Battery, { BatteryProps } from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated MediumBattery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const MediumBattery: React.FunctionComponent = MediumBatteryPF;
const MediumBattery: React.FunctionComponent<BatteryProps> = (props) => <Battery {...props} severity="medium" />;

export default MediumBattery;
4 changes: 2 additions & 2 deletions packages/components/src/Battery/NullBattery.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { NullBattery as NullBatteryPF } from '@patternfly/react-component-groups/dist/dynamic/Battery';
import Battery from '@patternfly/react-component-groups/dist/dynamic/Battery';

/**
* @deprecated Do not use deprecated NullBattery import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const NullBattery: React.FunctionComponent = NullBatteryPF;
const NullBattery: React.FunctionComponent<any> = (props) => <Battery {...props} severity="null" />;

export default NullBattery;
6 changes: 4 additions & 2 deletions packages/components/src/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import { ErrorBoundary as ErrorBoundaryPF } from '@patternfly/react-component-groups/dist/dynamic/ErrorBoundary';
import ErrorBoundaryPF, { ErrorPageProps } from '@patternfly/react-component-groups/dist/dynamic/ErrorBoundary';
import { DefaultErrorMessage } from '../ErrorState';

/**
* @deprecated Do not use deprecated ErrorBoundary import, the component has been moved to @patternfly/react-component-groups
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const ErrorBoundary: React.FunctionComponent<any> = (props) => <ErrorBoundaryPF defaultErrorDescription={DefaultErrorMessage} {...props} />;
const ErrorBoundary: React.FunctionComponent<ErrorPageProps> = (props) => (
<ErrorBoundaryPF defaultErrorDescription={<DefaultErrorMessage />} {...props} />
);

export default ErrorBoundary;
4 changes: 2 additions & 2 deletions packages/components/src/ErrorState/ErrorState.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { ErrorState as ErrorStatePF } from '@patternfly/react-component-groups/dist/dynamic/ErrorState';
import ErrorStatePF, { ErrorStateProps } from '@patternfly/react-component-groups/dist/dynamic/ErrorState';
import DefaultErrorMessage from './DefaultErrorMessage';

/**
* @deprecated Do not use deprecated ErrorState import, the component has been moved to @patternfly/react-component-groups
*/
const ErrorState: React.FunctionComponent = (props) => <ErrorStatePF defaultErrorDescription={<DefaultErrorMessage />} {...props} />;
const ErrorState: React.FunctionComponent<ErrorStateProps> = (props) => <ErrorStatePF defaultErrorDescription={<DefaultErrorMessage />} {...props} />;

export default ErrorState;
7 changes: 1 addition & 6 deletions packages/components/src/NotAuthorized/NotAuthorized.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React from 'react';
import { NotAuthorized as NotAuthorizedPF } from '@patternfly/react-component-groups/dist/dynamic/NotAuthorized';

interface NotAuthorizedProps {
/** Custom description */
description?: React.ReactNode;
}
import NotAuthorizedPF, { NotAuthorizedProps } from '@patternfly/react-component-groups/dist/dynamic/NotAuthorized';

/**
* @deprecated Do not use deprecated NotAuthorized import, the component has been moved to @patternfly/react-component-groups
Expand Down

0 comments on commit cc5e3ef

Please sign in to comment.