Skip to content

Commit

Permalink
Merge pull request #1882 from ever-co/update/add-task-circular-progress
Browse files Browse the repository at this point in the history
Update/add task circular progress
  • Loading branch information
evereq authored Nov 27, 2023
2 parents 7f9fa22 + d220553 commit 092d8c0
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 11 deletions.
13 changes: 13 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"words": [
"appdev",
"adipiscing",
"amet",
"aliqua",
"signin",
"APPSTORE",
"barcodes",
Expand All @@ -19,7 +22,12 @@
"clsxm",
"commitlint",
"compodoc",
"consectetur",
"dolor",
"dolore",
"dummyimage",
"eiusmod",
"elit",
"envalid",
"everco",
"everteamsdesktop",
Expand All @@ -31,11 +39,14 @@
"heroicons",
"Huhn",
"icnsutils",
"incididunt",
"isdragging",
"isdraggingfrom",
"isdropdisabled",
"ipsum",
"JITSU",
"kanban",
"Lorem",
"libappindicator",
"lucide",
"mathieudutour",
Expand All @@ -56,6 +67,7 @@
"testid",
"Timesheet",
"tanstack",
"tempor",
"vcpu",
"Vercel",
"HUBSTAFF",
Expand All @@ -78,6 +90,7 @@
"hyperscript",
"nocheck",
"locatio",
"labore",
"falsey",
"unhang",
"popperjs",
Expand Down
50 changes: 50 additions & 0 deletions apps/web/components/ui/svgs/circular-progress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export default function CircularProgress({
radius=24,
cx=24,
cy=24,
percentage=55
}: {
radius?: number,
cx?: number,
cy?: number,
percentage: number
}) {
const circumference = radius * 2 * Math.PI;

return (
<>
<div
x-data="scrollProgress"
className="relative -rotate-90 inline-flex items-center justify-center overflow-hidden rounded-full"
>

<svg className="w-12 h-12">
<circle
className="text-gray-300"
strokeWidth="8"
stroke="currentColor"
fill="transparent"
r={radius}
cx={cx}
cy={cy}
/>
<circle
className="text-[#27AE60]"
strokeWidth="8"
strokeDasharray={circumference}
strokeDashoffset={`calc(${circumference} - ${percentage / 100 * circumference})`}
strokeLinecap="round"
stroke="currentColor"
fill="transparent"
r={radius}
cx={cx}
cy={cy}
/>
</svg>
<span className="absolute text-xs font-normal text-black dark:text-white rotate-90" x-text={`${percentage}%`}>
{percentage}H
</span>
</div>
</>
)
}
21 changes: 11 additions & 10 deletions apps/web/lib/components/kanban-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BugIcon from "@components/ui/svgs/bug";
import Image from 'next/image';
import VerticalThreeDot from "@components/ui/svgs/vertical-three-dot";
import { DraggableProvided } from "react-beautiful-dnd";
import CircularProgress from "@components/ui/svgs/circular-progress";

function getStyle(provided: DraggableProvided, style: any) {
if (!style) {
Expand Down Expand Up @@ -78,9 +79,7 @@ const stackImages = (index: number, length: number) => {
* @param props
* @returns
*/
export default function Item(props: any) {


export default function Item(props: any) {

const {
item,
Expand All @@ -91,7 +90,7 @@ export default function Item(props: any) {
isClone,
index,
} = props;

return (
<section
href={``}
Expand All @@ -111,17 +110,19 @@ export default function Item(props: any) {
<div className="flex gap-1.5 border-b border-b-gray-200 pb-4">
<div className="flex flex-col gap-5 grow">
<TagList tags={item.tags}/>
<div className="flex flex-row items-center gap-2 text-sm not-italic font-semibold">
<div className="bg-indianRed rounded p-1">
<div className="flex flex-row flex-wrap items-center text-sm not-italic font-semibold">
<span className="bg-indianRed rounded p-1 mr-1">
<BugIcon/>
</div>
<p className="text-grey text-normal">#213</p>
<p className="text-black dark:text-white text-normal capitalize">{item.content}</p>
</span>
<span className="text-grey text-normal mr-1">#213</span>
<span className="text-black dark:text-white text-normal capitalize">{item.content}</span>

</div>
</div>
<div className="flex flex-col w-[48px] items-end">
<div className="flex flex-col justify-between w-[48px] items-end">
<VerticalThreeDot/>

<CircularProgress percentage={10}/>
</div>
</div>
<div className="flex flex-row justify-between items-center pt-4">
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/kanban/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Kanban= () => {
todo: [
{
id: '1',
content: 'demo content',
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
tags: [
{
id: 'tag-1',
Expand Down

0 comments on commit 092d8c0

Please sign in to comment.