-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
119 additions
and
85 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,51 @@ | ||
import { ITeamTask } from '@app/interfaces'; | ||
import { ChildIssueCard } from '@components/pages/task/ChildIssueCard'; | ||
import RichTextEditor from '@components/pages/task/description-block/task-description-editor'; | ||
import { RelatedIssueCard } from '@components/pages/task/IssueCard'; | ||
import TaskDetailsAside from '@components/pages/task/task-details-aside'; | ||
import TaskProperties from '@components/pages/task/TaskProperties'; | ||
import TaskTitleBlock from '@components/pages/task/title-block/task-title-block'; | ||
import { TaskActivity } from 'lib/features/task/task-activity'; | ||
|
||
interface ITaskDetailsComponentProps { | ||
task: ITeamTask; | ||
} | ||
|
||
/** | ||
* Task details component | ||
* | ||
* @param {object} props - The props object | ||
* @param {ITeamTask} props.task - The task to show details about | ||
* | ||
* @returns {JSX.Element} The Task details component | ||
*/ | ||
export function TaskDetailsComponent(props: ITaskDetailsComponentProps) { | ||
const { task } = props; | ||
return ( | ||
<div className="flex flex-col w-full min-h-screen pt-5"> | ||
<section className="flex flex-col justify-between lg:flex-row lg:items-start 3xl:gap-8"> | ||
<section className="md:mr-5 max-w-[57rem] 3xl:max-w-none xl:w-full mb-4 md:mb-0"> | ||
<TaskTitleBlock /> | ||
|
||
<div className="bg-[#F9F9F9] dark:bg-dark--theme-light p-2 md:p-6 pt-0 flex flex-col gap-8 rounded-sm"> | ||
<RichTextEditor /> | ||
{/* <TaskDescriptionBlock /> */} | ||
<ChildIssueCard /> | ||
<RelatedIssueCard /> | ||
|
||
{/* <IssueCard related={true} /> */} | ||
|
||
{/* <CompletionBlock /> */} | ||
{task && <TaskActivity task={task} />} | ||
</div> | ||
</section> | ||
<div className="flex flex-col mt-4 lg:mt-0 3xl:min-w-[24rem] w-full lg:w-[30%]"> | ||
<div className="flex flex-col bg-white dark:bg-dark--theme-light rounded-xl"> | ||
<TaskDetailsAside /> | ||
</div> | ||
<TaskProperties task={task} /> | ||
</div> | ||
</section> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Card, Modal } from 'lib/components'; | ||
import { useCallback } from 'react'; | ||
import { clsxm } from '@app/utils'; | ||
import { ITeamTask } from '@app/interfaces'; | ||
import { TaskDetailsComponent } from '@app/[locale]/task/[id]/component'; | ||
import { ScrollArea, ScrollBar } from '@components/ui/scroll-bar'; | ||
|
||
interface ITaskDetailsModalProps { | ||
closeModal: () => void; | ||
isOpen: boolean; | ||
task: ITeamTask; | ||
} | ||
|
||
/** | ||
* A Big Modal that shows task details | ||
* | ||
* @param {Object} props - The props Object | ||
* @param {boolean} props.open - If true open the modal otherwise close the modal | ||
* @param {() => void} props.closeModal - A function to close the modal | ||
* @param {ITeamTask} props.task - The task to show details about | ||
* | ||
* @returns {JSX.Element} The modal element | ||
*/ | ||
export function TaskDetailsModal(props: ITaskDetailsModalProps) { | ||
const { isOpen, closeModal, task } = props; | ||
|
||
const handleCloseModal = useCallback(() => { | ||
closeModal(); | ||
}, [closeModal]); | ||
|
||
return ( | ||
<Modal isOpen={isOpen} closeModal={handleCloseModal} className={clsxm('w-[90vw] h-[90vh]')}> | ||
<Card className="w-full h-full pt-12 overflow-hidden" shadow="custom"> | ||
<ScrollArea className="w-full h-full"> | ||
<TaskDetailsComponent task={task} /> | ||
<ScrollBar className="-pr-20" /> | ||
</ScrollArea> | ||
</Card> | ||
</Modal> | ||
); | ||
} |