forked from github/plane
fix: workspace name and breadcrumb title , refactor: command palette (#290)
* refactor: command pallette * fix: workspace name trim * fix: breadcrumb title responsiveness added
This commit is contained in:
parent
6ed5c05164
commit
a28be95002
@ -44,10 +44,10 @@ const BreadcrumbItem: React.FC<BreadcrumbItemProps> = ({ title, link, icon }) =>
|
||||
</a>
|
||||
</Link>
|
||||
) : (
|
||||
<div className="px-3 text-sm">
|
||||
<div className="px-3 text-sm max-w-64">
|
||||
<p className={`${icon ? "flex items-center gap-2" : ""}`}>
|
||||
{icon}
|
||||
{title}
|
||||
<span className="break-all">{title}</span>
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
@ -102,10 +102,10 @@ export const CommandPalette: React.FC = () => {
|
||||
!(e.target instanceof HTMLInputElement) &&
|
||||
!(e.target as Element).classList?.contains("remirror-editor")
|
||||
) {
|
||||
if ((e.ctrlKey || e.metaKey) && (e.key === "k" || e.key === "K")) {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "k") {
|
||||
e.preventDefault();
|
||||
setIsPaletteOpen(true);
|
||||
} else if ((e.ctrlKey || e.metaKey) && (e.key === "c" || e.key === "C")) {
|
||||
} else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "c") {
|
||||
if (e.altKey) {
|
||||
e.preventDefault();
|
||||
if (!router.query.issueId) return;
|
||||
@ -124,26 +124,23 @@ export const CommandPalette: React.FC = () => {
|
||||
title: "Some error occurred",
|
||||
});
|
||||
});
|
||||
console.log("URL Copied");
|
||||
} else {
|
||||
console.log("Text copied");
|
||||
}
|
||||
} else if (e.key === "c" || e.key === "C") {
|
||||
} else if (e.key.toLowerCase() === "c") {
|
||||
e.preventDefault();
|
||||
setIsIssueModalOpen(true);
|
||||
} else if (e.key === "p" || e.key === "P") {
|
||||
} else if (e.key.toLowerCase() === "p") {
|
||||
e.preventDefault();
|
||||
setIsProjectModalOpen(true);
|
||||
} else if ((e.ctrlKey || e.metaKey) && (e.key === "b" || e.key === "B")) {
|
||||
} else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "b") {
|
||||
e.preventDefault();
|
||||
toggleCollapsed();
|
||||
} else if (e.key === "h" || e.key === "H") {
|
||||
} else if (e.key.toLowerCase() === "h") {
|
||||
e.preventDefault();
|
||||
setIsShortcutsModalOpen(true);
|
||||
} else if (e.key === "q" || e.key === "Q") {
|
||||
} else if (e.key.toLowerCase() === "q") {
|
||||
e.preventDefault();
|
||||
setIsCreateCycleModalOpen(true);
|
||||
} else if (e.key === "m" || e.key === "M") {
|
||||
} else if (e.key.toLowerCase() === "m") {
|
||||
e.preventDefault();
|
||||
setIsCreateModuleModalOpen(true);
|
||||
} else if (e.key === "Delete") {
|
||||
|
@ -107,7 +107,10 @@ const CreateWorkspace: NextPage = () => {
|
||||
placeholder="Enter name"
|
||||
autoComplete="off"
|
||||
onChange={(e) =>
|
||||
setValue("slug", e.target.value.toLocaleLowerCase().replace(/ /g, "-"))
|
||||
setValue(
|
||||
"slug",
|
||||
e.target.value.toLocaleLowerCase().trim().replace(/ /g, "-")
|
||||
)
|
||||
}
|
||||
validations={{
|
||||
required: "Workspace name is required",
|
||||
|
Loading…
Reference in New Issue
Block a user