forked from github/plane
47abe9db5e
* style: gantt chart polishing * chore: sidebar y-axis drag and drop * chore: remove y-axis drag and drop from the main content * refactor: drop end function * refactor: resizing logic * chore: x-axis block move * chore: x-axis block move flag * chore: update scroll end logic * style: modules gantt chart * style: block background tint * refactor: context dispatcher types * refactor: draggable component * chore: filters added to gantt chart * refactor: folder structure * style: cycle blocks * chore: move to block arrow * chore: move to block on the right side arrow * chore: added proper comments for functions * refactor: blocks render logic * fix: x-axis drag and drop * chore: minor ui fixes * chore: remove link tag from blocks --------- Co-authored-by: Aaryan Khandelwal <aaryan610@Aaryans-MacBook-Pro.local>
67 lines
1.5 KiB
TypeScript
67 lines
1.5 KiB
TypeScript
import {
|
|
BacklogStateIcon,
|
|
CancelledStateIcon,
|
|
CompletedStateIcon,
|
|
StartedStateIcon,
|
|
UnstartedStateIcon,
|
|
} from "components/icons";
|
|
// constants
|
|
import { STATE_GROUP_COLORS } from "constants/state";
|
|
|
|
export const getStateGroupIcon = (
|
|
stateGroup: "backlog" | "unstarted" | "started" | "completed" | "cancelled",
|
|
width = "20",
|
|
height = "20",
|
|
color?: string
|
|
) => {
|
|
switch (stateGroup) {
|
|
case "backlog":
|
|
return (
|
|
<BacklogStateIcon
|
|
width={width}
|
|
height={height}
|
|
color={color ?? STATE_GROUP_COLORS["backlog"]}
|
|
className="flex-shrink-0"
|
|
/>
|
|
);
|
|
case "unstarted":
|
|
return (
|
|
<UnstartedStateIcon
|
|
width={width}
|
|
height={height}
|
|
color={color ?? STATE_GROUP_COLORS["unstarted"]}
|
|
className="flex-shrink-0"
|
|
/>
|
|
);
|
|
case "started":
|
|
return (
|
|
<StartedStateIcon
|
|
width={width}
|
|
height={height}
|
|
color={color ?? STATE_GROUP_COLORS["started"]}
|
|
className="flex-shrink-0"
|
|
/>
|
|
);
|
|
case "completed":
|
|
return (
|
|
<CompletedStateIcon
|
|
width={width}
|
|
height={height}
|
|
color={color ?? STATE_GROUP_COLORS["completed"]}
|
|
className="flex-shrink-0"
|
|
/>
|
|
);
|
|
case "cancelled":
|
|
return (
|
|
<CancelledStateIcon
|
|
width={width}
|
|
height={height}
|
|
color={color ?? STATE_GROUP_COLORS["cancelled"]}
|
|
className="flex-shrink-0"
|
|
/>
|
|
);
|
|
default:
|
|
return <></>;
|
|
}
|
|
};
|