-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modal proxy feat: tabs proxy
- Loading branch information
Showing
7 changed files
with
96 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ProjectModalProps> = ({ warehouseProjectId, onClose }: ProjectModalProps) => { | ||
return ( | ||
<Modal onClose={onClose} show={true} size={'8xl'}> | ||
<Modal.Header> | ||
<FormattedMessage id={'detailed-project-view'} /> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<Tabs> | ||
<Tabs.Item title={<FormattedMessage id={'project'} />}> | ||
this is the project tab for warehouse project {warehouseProjectId} | ||
</Tabs.Item> | ||
<Tabs.Item title={<FormattedMessage id={'issuance'} />}>this is the issuance tab</Tabs.Item> | ||
<Tabs.Item title={<FormattedMessage id={'project-locations'} />}>this is the project locations tab</Tabs.Item> | ||
<Tabs.Item title={<FormattedMessage id={'estimations'} />}>this is the project estimations tab</Tabs.Item> | ||
</Tabs> | ||
</Modal.Body> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export { ProjectModal }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export {} | ||
export * from './ProjectModal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Modal as FlowbiteModal, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps } from 'flowbite-react'; | ||
|
||
function Modal({ children, ...props }: ModalProps) { | ||
return <FlowbiteModal {...props}>{children}</FlowbiteModal>; | ||
} | ||
|
||
function Body({ children, ...props }: ModalBodyProps) { | ||
return <FlowbiteModal.Body {...props}>{children}</FlowbiteModal.Body>; | ||
} | ||
|
||
function Header({ children, ...props }: ModalHeaderProps) { | ||
return <FlowbiteModal.Header {...props}>{children}</FlowbiteModal.Header>; | ||
} | ||
|
||
function Footer({ children, ...props }: ModalFooterProps) { | ||
return <FlowbiteModal.Footer {...props}>{children}</FlowbiteModal.Footer>; | ||
} | ||
|
||
Modal.Body = Body; | ||
Modal.Header = Header; | ||
Modal.Footer = Footer; | ||
|
||
export { Modal }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { TabItemProps, Tabs as FlowbiteTabs, TabsProps } from 'flowbite-react'; | ||
|
||
function Tabs({ children, ...props }: TabsProps) { | ||
return <FlowbiteTabs {...props}>{children}</FlowbiteTabs>; | ||
} | ||
|
||
function Item({ children, ...props }: TabItemProps) { | ||
return ( | ||
<FlowbiteTabs.Item className={'active:on:bg-gray-100 text-cyan-600 dark:bg-gray-800 dark:text-cyan-500'} {...props}> | ||
{children} | ||
</FlowbiteTabs.Item> | ||
); | ||
} | ||
|
||
Tabs.Item = Item; | ||
|
||
export { Tabs }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters