Skip to content

Commit

Permalink
Organize component files
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Dec 1, 2023
1 parent dc84b41 commit 7ef659c
Show file tree
Hide file tree
Showing 41 changed files with 100 additions and 100 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import toast from 'react-hot-toast';
import { BsArrowLeftRight } from 'react-icons/bs';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import { AddInventoryItemDto, OrganizationDto } from 'shared-types';
import useProductsDetails from '../hooks/useProductsDetails';
import { Utils } from '../utils';
import Button from './Button';
import { CurrentAppContext } from './Context/CurrentAppContext';
import FormError from './Form/FormError';
import FormInput from './Form/FormInput';
import useProductsDetails from '../../hooks/useProductsDetails';
import { Utils } from '../../utils';
import Button from '../Button';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import FormError from '../Form/FormError';
import FormInput from '../Form/FormInput';

type Inputs = {
quantity: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { useContext } from 'react';
import { BsEye, BsPencil, BsTagFill, BsTrash } from 'react-icons/bs';
import { Link } from 'react-router-dom';
import { InventoryItemDto } from 'shared-types';
import { Utils } from '../utils';
import { CurrentAppContext } from './Context/CurrentAppContext';
import EntityActionsRow from './Entity/EntityActionsRow';
import EntityContainer from './Entity/EntityContainer';
import EntityImageColumn from './Entity/EntityImageColumn';
import EntityInfoTable from './Entity/EntityInfoTable';
import HeaderWithHint from './HeaderWithHint';
import Blockquote from './Helpers/Blockquote';
import IconButton from './IconButton';
import { Utils } from '../../utils';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import EntityActionsRow from '../Entity/EntityActionsRow';
import EntityContainer from '../Entity/EntityContainer';
import EntityImageColumn from '../Entity/EntityImageColumn';
import EntityInfoTable from '../Entity/EntityInfoTable';
import HeaderWithHint from '../HeaderWithHint';
import Blockquote from '../Helpers/Blockquote';
import IconButton from '../IconButton';

export interface InventoryEntityInfoProps {
inventoryItem: InventoryItemDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useContext } from 'react';
import { BsInfoCircleFill, BsPencilFill, BsTrashFill } from 'react-icons/bs';
import { useNavigate } from 'react-router-dom';
import { BasicInventoryItemDto } from 'shared-types';
import ActionButton from './ActionButton';
import { CurrentAppContext } from './Context/CurrentAppContext';
import TableActionsWrapper from './TableActionsWrapper';
import ActionButton from '../ActionButton';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import TableActionsWrapper from '../TableActionsWrapper';

export interface ProductActionsProps {
item: BasicInventoryItemDto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table';
import { useNavigate } from 'react-router-dom';
import { BasicInventoryItemDto, BasicProductDto } from 'shared-types';
import Table from './Helpers/Table';
import Table from '../Helpers/Table';
import InventoryItemActions from './InventoryItemActions';

const columnHelper = createColumnHelper<BasicInventoryItemDto>();
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BsPerson, BsShieldLock } from 'react-icons/bs';
import { Link, useNavigate } from 'react-router-dom';
import { UserLoginDto } from 'shared-types';
import { HTTPResponseError, Utils } from '../utils';
import Alert from './Alert';
import Alert from './Helpers/Alert';
import Button from './Button';
import TextInput from './Form/FancyInput';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BsSliders } from 'react-icons/bs';
import { OrganizationDto } from 'shared-types';
import ActionButton from './ActionButton';
import ActionButton from '../ActionButton';
import { Link } from 'react-router-dom';

export interface OrganizationSettingsButtonProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BsBoxes, BsBuilding, BsTag } from 'react-icons/bs';
import { OrganizationDto } from 'shared-types';
import OrganizationSettingsButton from './OrganizationActions';
import WarehousesList from './WarehousesList';
import WarehousesList from '../Warehouse/WarehousesList';

export interface OrganizationCardProps {
organization: OrganizationDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import { CreateOrganizationDto, OrganizationDto } from 'shared-types';
import { Utils } from '../utils';
import Button from './Button';
import FormInput from './Form/FormInput';
import FromHeading from './Form/FromHeading';
import FormError from './Form/FormError';
import { Utils } from '../../utils';
import Button from '../Button';
import FormInput from '../Form/FormInput';
import FromHeading from '../Form/FromHeading';
import FormError from '../Form/FormError';
import toast from 'react-hot-toast';

type Inputs = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext } from 'react';
import { Link } from 'react-router-dom';
import { CurrentAppContext } from './Context/CurrentAppContext.js';
import { CurrentAppContext } from '../Context/CurrentAppContext.js';

function OrganizationSelect() {
const appContext = useContext(CurrentAppContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OrganizationDto } from 'shared-types';
import RealtimeOrgSettingSelect from './RealtimeOrgSettingSelect';
import RealtimeOrgSettingSelect from '../RealtimeOrgSettingSelect';

export interface OrganizationSettingsProps {
organization: OrganizationDto;
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/Pages/DashboardHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BigNumberCard from '../BigNumberCard';
import Card from '../Card';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import DashboardContent from '../DashboardContent';
import WarehousesValueChart from '../WarehousesValueChart';
import WarehousesValueChart from '../Warehouse/WarehousesValueChart';
import ChartCard from '../ChartCard';
import TotalSalesChart from '../TotalSalesChart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext } from 'react';
import { CurrentAppContext } from '../../Context/CurrentAppContext';
import GoBackButton from '../../GoBackButton';
import InventoryAddForm from '../../InventoryAddForm';
import InventoryAddForm from '../../InventoryItem/InventoryAddForm';
import TableTopBar from '../../TableTopBar';

function InventoryAddPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import useInventoryList from '../../../hooks/useInventoryList';
import { CurrentAppContext } from '../../Context/CurrentAppContext';
import IconButton from '../../IconButton';
import InventoryTable from '../../InventoryTable';
import InventoryTable from '../../InventoryItem/InventoryTable';
import Loader from '../../Loader';
import TableTopBar from '../../TableTopBar';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useParams } from 'react-router-dom';
import useInventoryItemDetails from '../../../hooks/useInventoryItemDetails';
import GoBackButton from '../../GoBackButton';
import InventoryEntityInfo from '../../InventoryEntityInfo';
import InventoryEntityInfo from '../../InventoryItem/InventoryEntityInfo';
import Loader from '../../Loader';
import TableTopBar from '../../TableTopBar';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import IconButton from '../../IconButton';
import DashboardLayout from '../../Layout/DasboardLayout';
import Loader from '../../Loader';
import { SecondaryNavbar } from '../../SecondaryNavbar';
import WarehousesList from '../../WarehousesList';
import WarehousesList from '../../Warehouse/WarehousesList';

function OrganizationViewPage() {
const { id } = useParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import Button from '../../Button';
import Container from '../../Container';
import DashboardLayout from '../../Layout/DasboardLayout';
import OrganizationCreateForm from '../../OrganizationCreateForm';
import OrganizationCreateForm from '../../Organization/OrganizationCreateForm';
import { SecondaryNavbar } from '../../SecondaryNavbar';

function OrganizationCreatePage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '../../Button';
import Container from '../../Container';
import DashboardLayout from '../../Layout/DasboardLayout';
import Loader from '../../Loader';
import OrganizationCard from '../../OrganizationCard';
import OrganizationCard from '../../Organization/OrganizationCard';
import { SecondaryNavbar } from '../../SecondaryNavbar';

function OrganizationSelectPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '../../Button';
import Container from '../../Container';
import DashboardLayout from '../../Layout/DasboardLayout';
import Loader from '../../Loader';
import OrganizationSettings from '../../OrganizationSettings';
import OrganizationSettings from '../../Organization/OrganizationSettings';
import { SecondaryNavbar } from '../../SecondaryNavbar';

function OrganizationSettingsPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
import useProductsDetails from '../../../hooks/useProductsDetails';
import GoBackButton from '../../GoBackButton';
import Loader from '../../Loader';
import ProductEditForm from '../../ProductUpdateForm';
import ProductEditForm from '../../Product/ProductUpdateForm';
import TableTopBar from '../../TableTopBar';

function ProductEditPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
import useProductsDetails from '../../../hooks/useProductsDetails';
import GoBackButton from '../../GoBackButton';
import Loader from '../../Loader';
import ProductEntityInfo from '../../ProductEntityInfo';
import ProductEntityInfo from '../../Product/ProductEntityInfo';
import TableTopBar from '../../TableTopBar';

function ProductViewPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext } from 'react';
import { CurrentAppContext } from '../../Context/CurrentAppContext';
import GoBackButton from '../../GoBackButton';
import ProductCreateForm from '../../ProductCreateForm';
import ProductCreateForm from '../../Product/ProductCreateForm';
import TableTopBar from '../../TableTopBar';

function ProductsCreatePage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useProductsList from '../../../hooks/useProductsList';
import { CurrentAppContext } from '../../Context/CurrentAppContext';
import IconButton from '../../IconButton';
import Loader from '../../Loader';
import ProductsTable from '../../ProductsTable';
import ProductsTable from '../../Product/ProductsTable';
import TableTopBar from '../../TableTopBar';

function ProductsListPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import { CurrentAppContext } from '../../Context/CurrentAppContext';
import GoBackButton from '../../GoBackButton';
import TableTopBar from '../../TableTopBar';
import WarehouseCreateForm from '../../WarehouseCreateForm';
import WarehouseCreateForm from '../../Warehouse/WarehouseCreateForm';

function WarehousesCreatePage() {
const appContext = useContext(CurrentAppContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CurrentAppContext } from '../../Context/CurrentAppContext';
import IconButton from '../../IconButton';
import Loader from '../../Loader';
import TableTopBar from '../../TableTopBar';
import WarehousesTable from '../../WarehousesTable';
import WarehousesTable from '../../Warehouse/WarehousesTable';

function WarehousesListPage() {
const appContext = useContext(CurrentAppContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useContext } from 'react';
import { BsInfoCircleFill, BsPencilFill, BsTrashFill } from 'react-icons/bs';
import { useNavigate } from 'react-router-dom';
import { BasicProductDto } from 'shared-types';
import ActionButton from './ActionButton';
import { CurrentAppContext } from './Context/CurrentAppContext';
import TableActionsWrapper from './TableActionsWrapper';
import ActionButton from '../ActionButton';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import TableActionsWrapper from '../TableActionsWrapper';

export interface ProductActionsProps {
product: BasicProductDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useContext } from 'react';
import { BsBox, BsEye } from 'react-icons/bs';
import { Link } from 'react-router-dom';
import { ProductDto } from 'shared-types';
import { HTTPResponseError, Utils } from '../utils';
import { CurrentAppContext } from './Context/CurrentAppContext';
import IconButton from './IconButton';
import useInventoryItemByProduct from '../hooks/useInventoryItemByProduct';
import { HTTPResponseError, Utils } from '../../utils';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import IconButton from '../IconButton';
import useInventoryItemByProduct from '../../hooks/useInventoryItemByProduct';

export interface ProductAddToInventoryButtonProps {
product: ProductDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useForm } from 'react-hook-form';
import toast from 'react-hot-toast';
import { useNavigate } from 'react-router-dom';
import { CreateProductDto, ProductDto } from 'shared-types';
import { Utils } from '../utils';
import Button from './Button';
import { CurrentAppContext } from './Context/CurrentAppContext';
import FormError from './Form/FormError';
import FormInput from './Form/FormInput';
import { Utils } from '../../utils';
import Button from '../Button';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import FormError from '../Form/FormError';
import FormInput from '../Form/FormInput';

type Inputs = {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ProductDto } from 'shared-types';
import EntityContainer from './Entity/EntityContainer';
import EntityImageColumn from './Entity/EntityImageColumn';
import HeaderWithHint from './HeaderWithHint';
import Blockquote from './Helpers/Blockquote';
import EntityInfoTable from './Entity/EntityInfoTable';
import EntityContainer from '../Entity/EntityContainer';
import EntityImageColumn from '../Entity/EntityImageColumn';
import HeaderWithHint from '../HeaderWithHint';
import Blockquote from '../Helpers/Blockquote';
import EntityInfoTable from '../Entity/EntityInfoTable';
import { useContext } from 'react';
import { CurrentAppContext } from './Context/CurrentAppContext';
import { Utils } from '../utils';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import { Utils } from '../../utils';
import ProductInventoryPeek from './ProductInventoryPeek';
import EntityActionsRow from './Entity/EntityActionsRow';
import EntityActionsRow from '../Entity/EntityActionsRow';
import ProductAddToInventoryButton from './ProductAddToInventoryButton';
import IconButton from './IconButton';
import IconButton from '../IconButton';
import { BsPencil, BsTrash } from 'react-icons/bs';
import { Link } from 'react-router-dom';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BasicWarehouseDto, ProductDto } from 'shared-types';
import useInventoryItemByProduct from '../hooks/useInventoryItemByProduct';
import { HTTPResponseError } from '../utils';
import EntityInfoTable from './Entity/EntityInfoTable';
import Loader from './Loader';
import useInventoryItemByProduct from '../../hooks/useInventoryItemByProduct';
import { HTTPResponseError } from '../../utils';
import EntityInfoTable from '../Entity/EntityInfoTable';
import Loader from '../Loader';

export interface ProductInventoryPeek {
warehouse: BasicWarehouseDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useForm } from 'react-hook-form';
import toast from 'react-hot-toast';
import { useNavigate } from 'react-router-dom';
import { CreateProductDto, ProductDto, UpdateProductDto } from 'shared-types';

Check warning on line 5 in apps/client/src/components/Product/ProductUpdateForm.tsx

View workflow job for this annotation

GitHub Actions / Lint

'CreateProductDto' is defined but never used
import { Utils } from '../utils';
import Button from './Button';
import { CurrentAppContext } from './Context/CurrentAppContext';
import FormError from './Form/FormError';
import FormInput from './Form/FormInput';
import { Utils } from '../../utils';
import Button from '../Button';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import FormError from '../Form/FormError';
import FormInput from '../Form/FormInput';
import { useQueryClient } from 'react-query';

export interface ProductCreateFormProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/re
import { useContext } from 'react';
import { useNavigate } from 'react-router-dom';
import { BasicProductDto } from 'shared-types';
import placeholderImage from '../assets/placeholder.png';
import { Utils } from '../utils';
import { CurrentAppContext } from './Context/CurrentAppContext';
import Table from './Helpers/Table';
import placeholderImage from '../../assets/placeholder.png';
import { Utils } from '../../utils';
import { CurrentAppContext } from '../Context/CurrentAppContext';
import Table from '../Helpers/Table';
import ProductActions from './ProductActions';
import TableImage from './TableImage';
import TableImage from '../TableImage';

const columnHelper = createColumnHelper<BasicProductDto>();

Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BsEnvelopeAt, BsPerson, BsShieldLock } from 'react-icons/bs';
import { useNavigate } from 'react-router-dom';
import { UserLoginDto, UserRegisterDto } from 'shared-types';
import { Utils } from '../utils';
import Alert from './Alert';
import Alert from './Helpers/Alert';
import Button from './Button';
import { UserContext } from './Context/UserContext';
import FancyInput from './Form/FancyInput';
Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OrganizationSelect from '../OrganizationSelect';
import OrganizationSelect from '../Organization/OrganizationSelect';
import StockedUpLogo from '../StockedUpLogo';
import WarehouseSelect from '../WarehouseSelect';
import WarehouseSelect from '../Warehouse/WarehouseSelect';
import SidebarNavigation from './SidebarNavigation';

function Sidebar() {
Expand Down
Loading

0 comments on commit 7ef659c

Please sign in to comment.