mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
3c2f5d12ed
* chore: add next theme and initial setup * chore: add dark mode colors to layouts * chore: user general setting page theming * chore: dashboard theming * chore: project page theming * chore: workspace setting page theming * chore: my issue page theming * chore: cmdk theming * chore: change hardcode bg and text color to theme * chore: change color name according to the design * style: fix card in the dashboard * style: fix merge conflict design issues * style: add light high contrast and dark high contrast * style: fix cmd k menu color and selection * feat: change theme from cmdk menu * chore: add multiple theme field to custom theme * chore: removed custom theming * fix: build error --------- Co-authored-by: Saheb Giri <iamsahebgiri@gmail.com>
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import React from "react";
|
|
|
|
// ui
|
|
import { CustomSelect } from "components/ui";
|
|
// icons
|
|
import { ChartBarIcon } from "@heroicons/react/24/outline";
|
|
import { getPriorityIcon } from "components/icons/priority-icon";
|
|
// types
|
|
import { UserAuth } from "types";
|
|
// constants
|
|
import { PRIORITIES } from "constants/project";
|
|
|
|
type Props = {
|
|
value: string | null;
|
|
onChange: (val: string) => void;
|
|
userAuth: UserAuth;
|
|
};
|
|
|
|
export const SidebarPrioritySelect: React.FC<Props> = ({ value, onChange, userAuth }) => {
|
|
const isNotAllowed = userAuth.isGuest || userAuth.isViewer;
|
|
|
|
return (
|
|
<div className="flex flex-wrap items-center py-2">
|
|
<div className="flex items-center gap-x-2 text-sm sm:basis-1/2">
|
|
<ChartBarIcon className="h-4 w-4 flex-shrink-0" />
|
|
<p>Priority</p>
|
|
</div>
|
|
<div className="sm:basis-1/2">
|
|
<CustomSelect
|
|
label={
|
|
<span
|
|
className={`flex items-center gap-2 text-left capitalize ${
|
|
value ? "" : "text-brand-base"
|
|
}`}
|
|
>
|
|
{getPriorityIcon(value && value !== "" ? value ?? "" : "None", "text-sm")}
|
|
{value && value !== "" ? value : "None"}
|
|
</span>
|
|
}
|
|
value={value}
|
|
onChange={onChange}
|
|
width="w-full"
|
|
position="right"
|
|
disabled={isNotAllowed}
|
|
>
|
|
{PRIORITIES.map((option) => (
|
|
<CustomSelect.Option key={option} value={option} className="capitalize">
|
|
<>
|
|
{getPriorityIcon(option, "text-sm")}
|
|
{option ?? "None"}
|
|
</>
|
|
</CustomSelect.Option>
|
|
))}
|
|
</CustomSelect>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|