Skip to content

Commit 2bc5b33

Browse files
committed
fix(jss): Use clsx instead if classnames
1 parent bab0ae6 commit 2bc5b33

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

package-lock.json

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/react": "^18.0.0",
4949
"@types/react-dom": "^18.0.0",
5050
"@types/react-router-dom": "^5.3.3",
51-
"classnames": "^2.2.5",
51+
"clsx": "^2.0.0",
5252
"copyfiles": "^2.4.1",
5353
"react": "^18.0.0",
5454
"react-dom": "^18.0.0",

packages/module/patternfly-docs/content/extensions/component-groups/examples/LongTextTooltip/LongTextTooltipExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import React from 'react';
22
import { TooltipPosition } from '@patternfly/react-core';
33
import LongTextTooltip from "@patternfly/react-component-groups/dist/dynamic/LongTextTooltip";
44

5-
export const LongTextTooltipExample: React.FunctionComponent = () => (
5+
export const BasicExample: React.FunctionComponent = () => (
66
<LongTextTooltip
77
content="This is a very long tooltip that will be truncated to fit the screen. It will also have a max width of 400px."
88
maxLength={40}
99
tooltipPosition={TooltipPosition.bottom}/>
10-
)
10+
);

packages/module/src/Ansible/Ansible.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import classNames from 'classnames';
2+
import clsx from 'clsx';
33
import { createUseStyles } from 'react-jss';
44

55
export interface AnsibleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
@@ -32,7 +32,7 @@ const useStyles = createUseStyles({
3232

3333
const Ansible: React.FunctionComponent<AnsibleProps> = ({ unsupported, className, ...props }: AnsibleProps) => {
3434
const classes = useStyles();
35-
const ansibleLogoClass = classNames(
35+
const ansibleLogoClass = clsx(
3636
classes.ansible,
3737
{ [classes.supported]: !unsupported || unsupported === 0 },
3838
{ [classes.unsupported]: unsupported || unsupported === 1 },

packages/module/src/Battery/Battery.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import classNames from 'classnames';
2+
import clsx from 'clsx';
33
import { createUseStyles } from 'react-jss'
44

55
const batteryDefault = {
@@ -77,7 +77,7 @@ export interface BatteryProps extends React.DetailedHTMLProps<React.HTMLAttribut
7777

7878
const Battery: React.FunctionComponent<BatteryProps> = ({ severity, label, labelHidden, className, ...props }: BatteryProps) => {
7979
const classes = useStyles();
80-
const batteryClasses = classNames(classes.battery, classes[`battery-${severity}`], className);
80+
const batteryClasses = clsx(classes.battery, classes[String(batteryLevels(severity, true))], className);
8181

8282
let ariaLabels = {};
8383
if (labelHidden) {

0 commit comments

Comments
 (0)