diff --git a/src/renderer/components/blocks/modals/ProjectModal.tsx b/src/renderer/components/blocks/modals/ProjectModal.tsx new file mode 100644 index 00000000..c086c749 --- /dev/null +++ b/src/renderer/components/blocks/modals/ProjectModal.tsx @@ -0,0 +1,30 @@ +import React from 'react'; +import { Modal, Tabs } from '@/components'; +import { FormattedMessage } from 'react-intl'; + +interface ProjectModalProps { + warehouseProjectId: string; + onClose: () => void; +} + +const ProjectModal: React.FC = ({ warehouseProjectId, onClose }: ProjectModalProps) => { + return ( + + + + + + + }> + this is the project tab for warehouse project {warehouseProjectId} + + }>this is the issuance tab + }>this is the project locations tab + }>this is the project estimations tab + + + + ); +}; + +export { ProjectModal }; diff --git a/src/renderer/components/blocks/modals/index.ts b/src/renderer/components/blocks/modals/index.ts index 693da49f..64810459 100644 --- a/src/renderer/components/blocks/modals/index.ts +++ b/src/renderer/components/blocks/modals/index.ts @@ -1 +1 @@ -export {} \ No newline at end of file +export * from './ProjectModal'; \ No newline at end of file diff --git a/src/renderer/components/proxy/Modal.tsx b/src/renderer/components/proxy/Modal.tsx new file mode 100644 index 00000000..b5088ff5 --- /dev/null +++ b/src/renderer/components/proxy/Modal.tsx @@ -0,0 +1,23 @@ +import { Modal as FlowbiteModal, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps } from 'flowbite-react'; + +function Modal({ children, ...props }: ModalProps) { + return {children}; +} + +function Body({ children, ...props }: ModalBodyProps) { + return {children}; +} + +function Header({ children, ...props }: ModalHeaderProps) { + return {children}; +} + +function Footer({ children, ...props }: ModalFooterProps) { + return {children}; +} + +Modal.Body = Body; +Modal.Header = Header; +Modal.Footer = Footer; + +export { Modal }; diff --git a/src/renderer/components/proxy/Tabs.tsx b/src/renderer/components/proxy/Tabs.tsx new file mode 100644 index 00000000..286f42f8 --- /dev/null +++ b/src/renderer/components/proxy/Tabs.tsx @@ -0,0 +1,17 @@ +import { TabItemProps, Tabs as FlowbiteTabs, TabsProps } from 'flowbite-react'; + +function Tabs({ children, ...props }: TabsProps) { + return {children}; +} + +function Item({ children, ...props }: TabItemProps) { + return ( + + {children} + + ); +} + +Tabs.Item = Item; + +export { Tabs }; diff --git a/src/renderer/components/proxy/index.ts b/src/renderer/components/proxy/index.ts index 7da552aa..c08175cc 100644 --- a/src/renderer/components/proxy/index.ts +++ b/src/renderer/components/proxy/index.ts @@ -5,4 +5,6 @@ export * from './TextInput'; export * from './Spinner'; export * from './Sidebar'; export * from './Tooltip'; -export * from './Card'; \ No newline at end of file +export * from './Modal'; +export * from './Tabs'; +export * from './Card'; diff --git a/src/renderer/pages/ProjectsList/ProjectsListPage.tsx b/src/renderer/pages/ProjectsList/ProjectsListPage.tsx index 3c3a30dd..819fd48e 100644 --- a/src/renderer/pages/ProjectsList/ProjectsListPage.tsx +++ b/src/renderer/pages/ProjectsList/ProjectsListPage.tsx @@ -1,15 +1,14 @@ import React, { useCallback } from 'react'; import { useGetProjectsQuery } from '@/api'; -import { useQueryParamState, useColumnOrderHandler } from '@/hooks'; -import { debounce, DebouncedFunc } from 'lodash'; +import { useColumnOrderHandler, useQueryParamState, useWildCardUrlHash } from '@/hooks'; +import { debounce } from 'lodash'; import { - OrganizationSelector, IndeterminateProgressOverlay, - SkeletonTable, + OrganizationSelector, + ProjectModal, ProjectsListTable, SearchBox, - SyncIndicator, - OrgUidBadge, + SkeletonTable, } from '@/components'; import { FormattedMessage } from 'react-intl'; @@ -19,6 +18,7 @@ const ProjectsListPage: React.FC = () => { const [search, setSearch] = useQueryParamState('search', undefined); const [order, setOrder] = useQueryParamState('order', undefined); const handleSetOrder = useColumnOrderHandler(order, setOrder); + const [projectDetailsFragment, projectDetailsModalActive, setProjectModalActive] = useWildCardUrlHash('project-'); const { data: projectsData, @@ -27,7 +27,7 @@ const ProjectsListPage: React.FC = () => { error: projectsError, } = useGetProjectsQuery({ page: Number(currentPage), orgUid, search, order }); - const handlePageChange: DebouncedFunc = useCallback( + const handlePageChange = useCallback( debounce((page) => setCurrentPage(page), 800), [setCurrentPage], ); @@ -39,7 +39,7 @@ const ProjectsListPage: React.FC = () => { [setOrgUid], ); - const handleSearchChange: DebouncedFunc = useCallback( + const handleSearchChange = useCallback( debounce((event: any) => { setSearch(event.target.value); }, 800), @@ -61,15 +61,9 @@ const ProjectsListPage: React.FC = () => { return ( <> {projectsFetching && } -
+
- - - +
{projectsLoading ? ( @@ -86,6 +80,12 @@ const ProjectsListPage: React.FC = () => { totalCount={projectsData.pageCount * 10} /> )} + {projectDetailsModalActive && ( + setProjectModalActive(false)} + warehouseProjectId={projectDetailsFragment.replace('project-', '')} + /> + )} ); }; diff --git a/src/renderer/translations/tokens/en-US.json b/src/renderer/translations/tokens/en-US.json index ffb6dddc..87536ac9 100644 --- a/src/renderer/translations/tokens/en-US.json +++ b/src/renderer/translations/tokens/en-US.json @@ -40,5 +40,10 @@ "glossary": "Glossary", "term": "Term", "description": "Description", + "detailed-project-view": "Detailed Project View", + "project": "Project", + "issuance": "Issuance", + "project-locations": "Project Locations", + "estimations": "Estimations" "warehouse": "Warehouse" }