From 1891a6f3963d3ddeae0ea093f9a7e3608a97b4d7 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 13 May 2021 16:35:01 +0200 Subject: ui: Simplify projects page This change simplifies the logic and components of the projects page and reduces its dependency on Redux for simple operations. --- .../src/components/projects/ProjectList.js | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 opendc-web/opendc-web-ui/src/components/projects/ProjectList.js (limited to 'opendc-web/opendc-web-ui/src/components/projects/ProjectList.js') diff --git a/opendc-web/opendc-web-ui/src/components/projects/ProjectList.js b/opendc-web/opendc-web-ui/src/components/projects/ProjectList.js new file mode 100644 index 00000000..90d42326 --- /dev/null +++ b/opendc-web/opendc-web-ui/src/components/projects/ProjectList.js @@ -0,0 +1,39 @@ +import PropTypes from 'prop-types' +import React from 'react' +import { Authorization } from '../../shapes' +import ProjectRow from './ProjectRow' + +const ProjectList = ({ authorizations }) => { + return ( +
+ {authorizations.length === 0 ? ( +
+ + No projects here yet... Add some with the 'New Project' button! +
+ ) : ( + + + + + + + + + + {authorizations.map((authorization) => ( + + ))} + +
Project nameLast editedAccess rights +
+ )} +
+ ) +} + +ProjectList.propTypes = { + authorizations: PropTypes.arrayOf(Authorization).isRequired, +} + +export default ProjectList -- cgit v1.2.3