Skip to content

Commit

Permalink
Revert "refactor: switch CollaboratorRow to JSX"
Browse files Browse the repository at this point in the history
This reverts commit 4b96db7.
  • Loading branch information
fboulnois committed Jan 17, 2024
1 parent c2d1c3a commit 146b04e
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions src/pages/dar_application/collaborator/CollaboratorRow.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
import React from 'react';
import { CollaboratorSummary } from './CollaboratorSummary';
import { div, h } from 'react-hyperscript-helpers';
import CollaboratorForm from './CollaboratorForm';

export const CollaboratorRow = (props) => {
const {
index,
validation,
onCollaboratorValidationChange,
collaborator,
editMode,
} = props;

return (
<div id={index + '_collaboratorForm'}>
<CollaboratorForm
{...props}
collaborator={collaborator}
index={index}
isRendered={editMode === true}
validation={validation}
onCollaboratorValidationChange={onCollaboratorValidationChange}
/>
<CollaboratorSummary
{...props}
collaborator={collaborator}
index={index}
isRendered={!editMode}
/>
</div>
);
return div({id: index+'_collaboratorForm'}, [
h(CollaboratorForm, {
...props,
collaborator: props.collaborator, index: index,
isRendered: props.editMode === true,
validation,
onCollaboratorValidationChange
}),
h(CollaboratorSummary, {
...props,
collaborator: props.collaborator, index: index,
isRendered: !props.editMode
})
]);
};

export default CollaboratorRow;

0 comments on commit 146b04e

Please sign in to comment.