mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
one way of approaching nav
This commit is contained in:
48
src/pages/Organizations.jsx
Normal file
48
src/pages/Organizations.jsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import {
|
||||
Gallery,
|
||||
GalleryItem,
|
||||
PageSection,
|
||||
PageSectionVariants,
|
||||
Title,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import OrganizationCard from '../components/OrganizationCard';
|
||||
import api from '../api';
|
||||
|
||||
class Organizations extends Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
|
||||
this.state = { organizations: [] };
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
api.getOrganizations()
|
||||
.then(({ data }) => this.setState({ organizations: data.results }));
|
||||
}
|
||||
|
||||
render () {
|
||||
const { light, medium } = PageSectionVariants;
|
||||
const { organizations } = this.state;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<PageSection variant={light}>
|
||||
<Title size="2xl">Organizations</Title>
|
||||
</PageSection>
|
||||
<PageSection variant={medium}>
|
||||
<Gallery gutter="md">
|
||||
{organizations.map(o => (
|
||||
<GalleryItem key={o.id}>
|
||||
<OrganizationCard key={o.id} organization={o} />
|
||||
</GalleryItem>
|
||||
))}
|
||||
</Gallery>
|
||||
</PageSection>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Organizations;
|
||||
Reference in New Issue
Block a user