Skip to content

Commit

Permalink
chore: modal content changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed Apr 17, 2024
1 parent 859598f commit 8512693
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
12 changes: 1 addition & 11 deletions src/renderer/components/blocks/modals/UpsertProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,7 @@ const UpsertProjectModal: React.FC<UpsertModalProps> = ({ onClose }: UpsertModal
<Modal show={true} onClose={onClose}>
<ModalHeader />
<Modal.Body>
<>
{createProjectModalActive || !projectData ? (
<>
<p>todo blank project details form</p>
</>
) : (
<>
<p>todo edit project details for project id {projectData?.projectId}</p>
</>
)}
</>
<p>the project form goes here {projectData?.warehouseProjectId}</p>
</Modal.Body>
</Modal>
);
Expand Down
20 changes: 5 additions & 15 deletions src/renderer/components/blocks/modals/UpsertUnitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ interface UpsertModalProps {

const UpsertUnitModal: React.FC<UpsertModalProps> = ({ onClose }: UpsertModalProps) => {
const [, createUnitModalActive] = useWildCardUrlHash('create-unit');
const [UnitUpsertFragment] = useWildCardUrlHash('edit-unit');
const warehouseUnitId = UnitUpsertFragment.replace('edit-unit-', '');
const { data: UnitData, isLoading: UnitLoading } = useGetUnitQuery({ warehouseUnitId });
const [unitUpsertFragment] = useWildCardUrlHash('edit-unit');
const warehouseUnitId = unitUpsertFragment.replace('edit-unit-', '');
const { data: unitData, isLoading: unitLoading } = useGetUnitQuery({ warehouseUnitId });

const ModalHeader: React.FC = () => {
return (
Expand All @@ -22,7 +22,7 @@ const UpsertUnitModal: React.FC<UpsertModalProps> = ({ onClose }: UpsertModalPro
);
};

if (UnitLoading) {
if (unitLoading) {
return (
<Modal show={true} onClose={onClose}>
<ModalHeader />
Expand All @@ -37,17 +37,7 @@ const UpsertUnitModal: React.FC<UpsertModalProps> = ({ onClose }: UpsertModalPro
<Modal show={true} onClose={onClose}>
<ModalHeader />
<Modal.Body>
<>
{createUnitModalActive || !UnitData ? (
<>
<p>todo blank Unit details form</p>
</>
) : (
<>
<p>todo edit Unit details for Unit id {UnitData?.warehouseUnitId}</p>
</>
)}
</>
<p>the unit form goes here {unitData?.warehouseUnitId}</p>
</Modal.Body>
</Modal>
);
Expand Down

0 comments on commit 8512693

Please sign in to comment.