nicholas/storage-manager#1: move components into 'components' dir;

This commit is contained in:
2025-04-10 18:27:17 -05:00
parent d20410cda7
commit bba9b06121
8 changed files with 6 additions and 12 deletions
@@ -1,5 +1,4 @@
import { useRef, useEffect, useState } from "react";
import { Ellipsis, Garbage } from "../../icons";
import { useRef, useEffect } from "react";
interface MenuItem {
label: string;
@@ -5,7 +5,7 @@ interface ModalProps {
children: ReactNode;
}
const Modal: React.FC<ModalProps> = ({ isOpen, children }) => {
export const Modal: React.FC<ModalProps> = ({ isOpen, children }) => {
if (!isOpen) return null;
return (
@@ -16,5 +16,3 @@ const Modal: React.FC<ModalProps> = ({ isOpen, children }) => {
</div>
);
};
export default Modal;
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from "react";
import { Box, BoxFormModal, deleteBox } from "../";
import { Item, ItemCard, ItemFormModal } from "../../item";
import { Plus, Ellipsis, Garbage, Pencil } from "../../../icons";
import { GenericMenu } from "../../generic-menu/GenericMenu";
import { GenericMenu } from '../../../components/GenericMenu';
interface BoxCardProps {
initialBox: Box;
@@ -1,7 +1,6 @@
import { useState } from "react";
import Modal from "../../../modal";
import { Modal } from '../../../components/Modal';
import { Box, createBox, updateBox } from "..";
import { Item } from "../../item";
interface BoxFormModalProps {
mode: string;
@@ -1,7 +1,7 @@
import { useState } from "react";
import { Item, ItemFormModal, deleteItem } from "../";
import { Ellipsis, Garbage, Pencil } from "../../../icons";
import { GenericMenu } from "../../generic-menu/GenericMenu";
import { GenericMenu } from "../../../components/GenericMenu";
interface ItemCardProps {
boxId: string;
@@ -1,7 +1,6 @@
import { useState } from "react";
import Modal from "../../../modal";
import {Modal} from '../../../components/Modal';
import { Item, createItem, updateItem } from "..";
import { createBox } from "../../box";
interface ItemFormModalProps {
mode: string;
-1
View File
@@ -114,7 +114,6 @@ app.post('/boxes/:boxId/items', async (request, response) => {
try {
const item = new Item(request.body);
const savedItem = await item.save();
console.log(item)
const box = await Box.findById(request.params.boxId);
if (!box) {
throw new Error('Box not found');