-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: priority icon component (#2132)
- Loading branch information
Showing
27 changed files
with
117 additions
and
95 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
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
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,22 +1,25 @@ | ||
export const getPriorityIcon = (priority: string | null, className?: string) => { | ||
if (!className || className === "") className = "text-xs flex items-center"; | ||
// types | ||
import { TIssuePriorities } from "types"; | ||
|
||
type Props = { | ||
priority: TIssuePriorities | null; | ||
className?: string; | ||
}; | ||
|
||
priority = priority?.toLowerCase() ?? null; | ||
export const PriorityIcon: React.FC<Props> = ({ priority, className = "" }) => { | ||
if (!className || className === "") className = "text-xs flex items-center"; | ||
|
||
switch (priority) { | ||
case "urgent": | ||
return <span className={`material-symbols-rounded ${className}`}>error</span>; | ||
case "high": | ||
return <span className={`material-symbols-rounded ${className}`}>signal_cellular_alt</span>; | ||
case "medium": | ||
return ( | ||
<span className={`material-symbols-rounded ${className}`}>signal_cellular_alt_2_bar</span> | ||
); | ||
case "low": | ||
return ( | ||
<span className={`material-symbols-rounded ${className}`}>signal_cellular_alt_1_bar</span> | ||
); | ||
default: | ||
return <span className={`material-symbols-rounded ${className}`}>block</span>; | ||
} | ||
return ( | ||
<span className={`material-symbols-rounded ${className}`}> | ||
{priority === "urgent" | ||
? "error" | ||
: priority === "high" | ||
? "signal_cellular_alt" | ||
: priority === "medium" | ||
? "signal_cellular_alt_2_bar" | ||
: priority === "low" | ||
? "signal_cellular_alt_1_bar" | ||
: "block"} | ||
</span> | ||
); | ||
}; |
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
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
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
Oops, something went wrong.
7bb73b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
plane-dev – ./web/
plane-dev-plane.vercel.app
plane-dev-git-develop-plane.vercel.app
plane-dev.vercel.app
7bb73b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
plane-sh-dev – ./space/
plane-space-dev.vercel.app
plane-sh-dev-plane.vercel.app
plane-sh-dev-git-develop-plane.vercel.app