Skip to content

Commit

Permalink
Merge pull request #1914 from ever-co/update/add-comment-icons
Browse files Browse the repository at this point in the history
Update/add comment icons
  • Loading branch information
evereq authored Nov 30, 2023
2 parents 0f714a2 + bf4d333 commit d86276b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/web/lib/components/Kanban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function headerStyleChanger(snapshot: DraggableStateSnapshot, bgColor: any){
* @param param0
* @returns
*/
function InnerItemList({items}: {
function InnerItemList({items, title}: {
title: string,
items: any[]
}) {
return (
Expand All @@ -61,6 +62,11 @@ function InnerItemList({items}: {
isDragging={dragSnapshot.isDragging}
isGroupedOver={Boolean(dragSnapshot.combineTargetFor)}
provided={dragProvided}
style={title === 'review' && {
borderWidth: '1px',
borderColor: '#6FCF97',
borderStyle: 'solid'
}}
/>
)}
</Draggable>
Expand All @@ -82,14 +88,14 @@ function InnerList(props: {
dropProvided: DroppableProvided,
dropSnapshot: DroppableStateSnapshot
}) {
const { items, dropProvided, dropSnapshot } = props;
const { items, dropProvided, dropSnapshot, title } = props;

return (

<div
style={getBackgroundColor(dropSnapshot)}
ref={dropProvided.innerRef}>
<InnerItemList items={items} />
<InnerItemList items={items} title={title} />
<>
{dropProvided.placeholder}
</>
Expand Down
30 changes: 30 additions & 0 deletions apps/web/lib/components/kanban-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ function getStyle(provided: DraggableProvided, style: any) {
};
}

function setCommentIconColor(commentType: "tagged" | "untagged") {

let style;

if(commentType === "tagged"){
style = {
backgroundColor: '#D95F5F'
}
}else if(commentType === "untagged"){
style = {
backgroundColor: '#27AE60'
}
} else {
style = {

}
}

return style
}

function Tag({title, backgroundColor, color}: {
title: string,
backgroundColor: string,
Expand Down Expand Up @@ -170,6 +191,15 @@ export default function Item(props: any) {
</div>
</div>
</div>
{item.hasComment !== "none" &&
(<div className="flex flex-row items-center justify-center rounded-full w-5 h-5 z-10 bg-[#e5e7eb] dark:bg-[#181920] absolute top-0 right-0">
<div
className="w-3.5 h-3.5 rounded-full"
style={setCommentIconColor(item.hasComment)}
>
</div>
</div>)
}
</section>
);
}
Expand Down
6 changes: 6 additions & 0 deletions apps/web/pages/kanban/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const demoData = {
{
id: '1',
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
hasComment: "tagged",
tags: [
{
id: 'tag-1',
Expand All @@ -48,6 +49,7 @@ const demoData = {
{
id: '4',
content: 'demo content2',
hasComment: "none",
tags: [
{
id: 'tag-1',
Expand All @@ -69,6 +71,7 @@ const demoData = {
{
id: '2',
content: 'another content',
hasComment: "untagged",
tags: [
{
id: 'tag-1',
Expand All @@ -88,6 +91,7 @@ const demoData = {
{
id: '5',
content: 'another content2',
hasComment: "none",
tags: [
{
id: 'tag-1',
Expand All @@ -109,6 +113,7 @@ const demoData = {
{
id: '3',
content: 'a simple tes',
hasComment: "none",
tags: [
{
id: 'tag-1',
Expand All @@ -128,6 +133,7 @@ const demoData = {
{
id: '6',
content: 'a simple tes',
hasComment: "none",
tags: [
{
id: 'tag-1',
Expand Down

0 comments on commit d86276b

Please sign in to comment.