Skip to content

Commit

Permalink
feat(SimpleList): apply tokens (#9953)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul authored Jan 22, 2024
1 parent 0dfe65d commit e75ff01
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class SimpleListItem extends React.Component<SimpleListItemProps> {
className={css(
styles.simpleListItemLink,
isCurrentItem && styles.modifiers.current,
!isButton && styles.modifiers.link,
componentClassName
)}
onClick={(evt: React.MouseEvent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ propComponents: ['SimpleList', 'SimpleListGroup', 'SimpleListItem']
### Simple list

```ts file="SimpleListBasic.tsx"

```

### Simple list with links

```ts file="SimpleListLinks.tsx"

```

### Grouped list

```ts file="SimpleListGrouped.tsx"

```

### Uncontrolled simple list

```ts file="SimpleListUncontrolled.tsx"
```

```
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export const SimpleListBasic: React.FunctionComponent = () => {
<SimpleListItem key="item1" isActive>
List item 1
</SimpleListItem>,
<SimpleListItem key="item2" component="a" href="#">
List item 2
</SimpleListItem>,
<SimpleListItem key="item2">List item 2</SimpleListItem>,
<SimpleListItem key="item3">List item 3</SimpleListItem>
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { SimpleList, SimpleListItem } from '@patternfly/react-core';

export const SimpleListLinks: React.FunctionComponent = () => {
const items = [
<SimpleListItem key="item1" component="a" href="#" isActive>
List item 1
</SimpleListItem>,
<SimpleListItem key="item2" component="a" href="#">
List item 2
</SimpleListItem>,
<SimpleListItem key="item3" component="a" href="#">
List item 3
</SimpleListItem>
];

return <SimpleList aria-label="Simple List Links Example">{items}</SimpleList>;
};

0 comments on commit e75ff01

Please sign in to comment.