-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build mobile view for roadmap kanban
- Loading branch information
Showing
10 changed files
with
98 additions
and
9 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
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,25 @@ | ||
import type { KanbanColumnProps } from './types' | ||
import { LABEL_MAPPING, DESCRIPTION_MAPPING } from '@/constants/issue-statuses' | ||
import KanbanElement from '@/components/kanban-element' | ||
|
||
export default function KanbanColumn({ status, issues }: KanbanColumnProps) { | ||
return ( | ||
<div className="flex flex-col gap-6"> | ||
<div className="flex flex-col gap-1"> | ||
<h2 className="text-marian-blue font-sans font-bold text-xl"> | ||
{ LABEL_MAPPING[status] } ({ issues.length }) | ||
</h2> | ||
|
||
<p className="text-glaucous font-sans text-xs font-normal"> | ||
{ DESCRIPTION_MAPPING[status] } | ||
</p> | ||
</div> | ||
|
||
<div className="flex flex-col gap-4"> | ||
{ issues.map(issue => ( | ||
<KanbanElement issue={issue} key={issue.uuid} /> | ||
)) } | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { Issue, IssueStatus } from '@/feedbackr-api/v1/schemas' | ||
|
||
export interface KanbanColumnProps { | ||
issues: Issue[]; | ||
status: IssueStatus; | ||
} |
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,36 @@ | ||
import type { KanbanElementProps } from './types' | ||
import StatusLabel from '@/components/status-label' | ||
import { BG_COLOR_MAPPING } from '@/constants/issue-statuses' | ||
import CategoryLabel from '@/components/category-label' | ||
import ISSUE_CATEGORY_LABELS from '@/constants/issue-category-labels' | ||
import invariant from 'tiny-invariant' | ||
import UpvoteButton from '@/components/upvote-button' | ||
import CommentsCounter from '@/components/comments-counter' | ||
|
||
export default function KanbanElement({ issue }: KanbanElementProps) { | ||
const categoryLabel = ISSUE_CATEGORY_LABELS.find((category) => category.name === issue.category.name)?.label | ||
invariant(categoryLabel, `Category label not found for category name: ${issue.category.name}`) | ||
|
||
return ( | ||
<div className="flex flex-col gap-4 relative p-6 rounded-xl bg-white"> | ||
<div className={`absolute w-full left-0 top-0 h-1.5 rounded-tl-xl rounded-tr-xl ${BG_COLOR_MAPPING[issue.status]}`} /> | ||
|
||
<StatusLabel status={issue.status} size="small" /> | ||
|
||
<div className="flex flex-col gap-2"> | ||
<h3 className="font-sans font-bold text-xs text-marian-blue"> | ||
{ issue.title } | ||
</h3> | ||
<p className="font-sans font-normal text-xs text-glaucous"> | ||
{ issue.detail } | ||
</p> | ||
<CategoryLabel label={categoryLabel} /> | ||
</div> | ||
|
||
<div className='flex justify-between items-center'> | ||
<UpvoteButton issueUuid={issue.uuid} upvotes={issue.upvotes} initialActive={issue.alreadyUpvoted} /> | ||
<CommentsCounter commentsCount={issue.commentsCount} /> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { Issue } from '@/feedbackr-api/v1/schemas' | ||
|
||
export interface KanbanElementProps { | ||
issue: Issue; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import type { IssueStatus } from '@/feedbackr-api/v1/schemas' | ||
|
||
export interface StatusSelectorProps { | ||
activeStatus: string; | ||
onStatusChange: (status: string) => void; | ||
onStatusChange: (status: IssueStatus) => void; | ||
issuesCount: { [key: string]: number }; | ||
} |
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