Hello-World-Software-Studios / calculator

Carpenter's tool for wall layout
0 stars 1 forks source link

Refactor Dashboard #85

Closed ecumene closed 2 years ago

ecumene commented 2 years ago
          <Button onClick={handleDeleteShow} variant="dark">
            Delete Project
          </Button>
          <>
            <Modal show={isDeleteModalOpen} onHide={handleDeleteClose}>
              <Modal.Header>
                <Modal.Title>Delete Project</Modal.Title>
              </Modal.Header>
              <Modal.Body>Are you sure? This can&apos;t be undone.</Modal.Body>
              <Modal.Footer>
                <Button variant="secondary" onClick={handleDeleteClose}>
                  Close
                </Button>
                <Button onClick={deleteProject} variant="primary">
                  Yes, delete this project!
                </Button>
              </Modal.Footer>
            </Modal>
          </>
  const numberOfFeetOfPlate = isImperialUnit
    ? Math.ceil(numberOfStuds * 3.3)
    : Math.ceil(numberOfStuds * (3.3 * CONVERSION_COEFFICIENT));
  const topAndBottomPlates = isImperialUnit
    ? `${numberOfFeetOfPlate} feet `
    : `${numberOfFeetOfPlate} metres `;
  const studHeightDivisor = isImperialUnit ? 8 : 2.4;
  // TODO make this toggleable
  const studCost = twoByFourPrice;
  const totalCost =
    numberOfStuds * studCost + (numberOfFeetOfPlate / studHeightDivisor) * studCost;
JPM709 commented 2 years ago

DeleteProject.jsx Modal finished.

JPM709 commented 2 years ago

Calculator Modal abstracted to its own component.

JPM709 commented 2 years ago

totals calculations moved into the component that uses it: TotalModal.jsx