mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
27f78dd283
* chore: project issues topbar * style: theming and minor UI fixes * refactor: file structure * chore: layout wise authorization added * style: filter dropdowns * chore: add fetch keys
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import React from "react";
|
|
|
|
// types
|
|
import { TIssueLayouts } from "types";
|
|
// constants
|
|
import { ISSUE_LAYOUTS } from "constants/issue";
|
|
|
|
type Props = {
|
|
layouts: TIssueLayouts[];
|
|
onChange: (layout: TIssueLayouts) => void;
|
|
selectedLayout: TIssueLayouts;
|
|
};
|
|
|
|
export const LayoutSelection: React.FC<Props> = (props) => {
|
|
const { layouts, onChange, selectedLayout } = props;
|
|
|
|
return (
|
|
<div className="flex items-center gap-1 p-1 rounded bg-custom-background-80">
|
|
{ISSUE_LAYOUTS.filter((l) => layouts.includes(l.key)).map((layout) => (
|
|
<button
|
|
key={layout.key}
|
|
type="button"
|
|
className={`w-7 h-[22px] rounded grid place-items-center transition-all hover:bg-custom-background-100 overflow-hidden group ${
|
|
selectedLayout == layout.key ? "bg-custom-background-100 shadow-custom-shadow-2xs" : ""
|
|
}`}
|
|
onClick={() => onChange(layout.key)}
|
|
>
|
|
<layout.icon
|
|
size={14}
|
|
strokeWidth={2}
|
|
className={`${selectedLayout == layout.key ? "text-custom-text-100" : "text-custom-text-200"}`}
|
|
/>
|
|
</button>
|
|
))}
|
|
</div>
|
|
);
|
|
};
|