mirror of
https://github.com/ansible/awx.git
synced 2026-02-14 01:34:45 -03:30
Style pop up modal
This commit is contained in:
34
src/components/ListItem/ListItem.jsx
Normal file
34
src/components/ListItem/ListItem.jsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { I18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import {
|
||||
Checkbox,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
export default ({
|
||||
itemId,
|
||||
name,
|
||||
isSelected,
|
||||
onSelect,
|
||||
}) => (
|
||||
<li key={itemId} className="pf-c-data-list__item" aria-labelledby="check-action-item1">
|
||||
<div className="pf-c-data-list__check">
|
||||
<I18n>
|
||||
{({ i18n }) => (
|
||||
<Checkbox
|
||||
checked={isSelected}
|
||||
onChange={onSelect}
|
||||
aria-label={i18n._(t`selected ${itemId}`)}
|
||||
id={`selectd-${itemId}`}
|
||||
value={itemId}
|
||||
/>
|
||||
)}
|
||||
</I18n>
|
||||
</div>
|
||||
<div className="pf-c-data-list__cell">
|
||||
<span id="check-action-item1">
|
||||
<b>{name}</b>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
3
src/components/ListItem/index.js
Normal file
3
src/components/ListItem/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import ListItem from './ListItem';
|
||||
|
||||
export default ListItem;
|
||||
@@ -3,15 +3,14 @@ import React from 'react';
|
||||
import { SearchIcon } from '@patternfly/react-icons';
|
||||
import {
|
||||
Modal,
|
||||
List,
|
||||
ListItem,
|
||||
Checkbox,
|
||||
Button,
|
||||
ActionGroup,
|
||||
Toolbar,
|
||||
ToolbarGroup,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import ListItem from '../ListItem'
|
||||
|
||||
class Lookup extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -54,24 +53,23 @@ class Lookup extends React.Component {
|
||||
<span className="pf-c-input-group__text" aria-label="search" id="search" onClick={this.onLookup}><SearchIcon /></span>
|
||||
<div className="pf-c-form-control">{this.wrapTags(this.props.data)}</div>
|
||||
<Modal
|
||||
isLarge
|
||||
className="awx-c-modal"
|
||||
title={`Select ${this.props.lookup_header}`}
|
||||
isOpen={isModalOpen}
|
||||
onClose={this.handleModalToggle}
|
||||
>
|
||||
<List>
|
||||
<ul className="pf-c-data-list awx-c-list">
|
||||
{data.map(i =>
|
||||
<ListItem key={i.id}>
|
||||
<Checkbox
|
||||
label={i.name}
|
||||
checked={i.isChecked}
|
||||
onChange={this.onChecked}
|
||||
aria-label="result checkbox"
|
||||
id={`checked-${i.id}`}
|
||||
value={i.id}
|
||||
/>
|
||||
</ListItem>)}
|
||||
</List>
|
||||
<ListItem
|
||||
key={i.id}
|
||||
itemId={i.id}
|
||||
name={i.name}
|
||||
isSelected={i.isChecked}
|
||||
onSelect={this.onChecked}
|
||||
/>
|
||||
)}
|
||||
</ul>
|
||||
<ActionGroup className="at-align-right">
|
||||
<Toolbar>
|
||||
<ToolbarGroup>
|
||||
|
||||
Reference in New Issue
Block a user