mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
4c2cb2368a
* chore: store various shades of accent color * refactor: custom theme selector * refactor: custom theme selector * chore: update custom theme input labels * fix: color generator function logic * fix: accent color preloaded data * chore: new theming structure * chore: update shades calculation logic * refactor: variable names * chore: update color scheming * chore: new color scheming * refactor: themes folder structure * chore: update classnames to the new ones * chore: update static colors * chore: sidebar link colors * chore: placeholder color * chore: update border classnames
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import React from "react";
|
|
|
|
// ui
|
|
import { CustomSelect } from "components/ui";
|
|
// icons
|
|
import { getPriorityIcon } from "components/icons/priority-icon";
|
|
// constants
|
|
import { PRIORITIES } from "constants/project";
|
|
|
|
type Props = {
|
|
value: string | null;
|
|
onChange: (value: string) => void;
|
|
};
|
|
|
|
export const IssuePrioritySelect: React.FC<Props> = ({ value, onChange }) => (
|
|
<CustomSelect
|
|
value={value}
|
|
label={
|
|
<div className="flex items-center justify-center gap-2 text-xs">
|
|
<span className="flex items-center">
|
|
{getPriorityIcon(value, `text-xs ${value ? "" : "text-custom-text-200"}`)}
|
|
</span>
|
|
<span className={`${value ? "" : "text-custom-text-200"} capitalize`}>
|
|
{value ?? "Priority"}
|
|
</span>
|
|
</div>
|
|
}
|
|
onChange={onChange}
|
|
noChevron
|
|
>
|
|
{PRIORITIES.map((priority) => (
|
|
<CustomSelect.Option key={priority} value={priority}>
|
|
<div className="flex w-full justify-between gap-2 rounded">
|
|
<div className="flex items-center justify-start gap-2">
|
|
<span>{getPriorityIcon(priority)}</span>
|
|
<span className="capitalize">{priority ?? "None"}</span>
|
|
</div>
|
|
</div>
|
|
</CustomSelect.Option>
|
|
))}
|
|
</CustomSelect>
|
|
);
|