enhance release v2 experience
This commit is contained in:
1 parent
9b4970583e
commit
ef2ed6c602
152 files changed
+7236
-764
No files matched your search
@@ -1,8 +1,10 @@
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import { Group, Text } from "@mantine/core";
|
||||
import {
|
||||
IconBox,
|
||||
IconCategoryPlus,
|
||||
IconMailForward,
|
||||
IconPlus,
|
||||
IconPlug,
|
||||
IconUserPlus,
|
||||
IconUsersGroup,
|
||||
@@ -47,8 +49,26 @@ export const globalCommandGroup = createGroup<Command>({
|
||||
useOptions() {
|
||||
const tOption = useScopedI18n("search.mode.command.group.globalCommand.option");
|
||||
const { data: session } = useSession();
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const commands: (Command & { hidden?: boolean })[] = [
|
||||
{
|
||||
commandKey: "create",
|
||||
icon: IconPlus,
|
||||
name: tOption("create.label"),
|
||||
useInteraction() {
|
||||
return {
|
||||
type: "javaScript",
|
||||
onSelect() {
|
||||
const nextSearchParams = new URLSearchParams(searchParams.toString());
|
||||
nextSearchParams.set("create", "true");
|
||||
router.replace(`${pathname}?${nextSearchParams.toString()}`, { scroll: false });
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
commandKey: "newBoard",
|
||||
icon: IconCategoryPlus,
|
||||
|
||||
Reference in new issue
Block a user