mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-10-08 03:36:44 +00:00
📝 Docs: 添加商店表单支持 (#2460)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
35
website/src/components/Form/Plugin.tsx
Normal file
35
website/src/components/Form/Plugin.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from "react";
|
||||
|
||||
import { Form } from ".";
|
||||
|
||||
export default function PluginForm(): JSX.Element {
|
||||
const formItems = [
|
||||
{
|
||||
name: "包信息",
|
||||
items: [
|
||||
{ type: "text", name: "pypi", labelText: "PyPI 项目名" },
|
||||
{ type: "text", name: "module", labelText: "插件 import 包名" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "其他信息",
|
||||
items: [{ type: "tag", name: "tags", labelText: "标签" }],
|
||||
},
|
||||
];
|
||||
const handleSubmit = (result: Record<string, string>) => {
|
||||
window.open(
|
||||
`https://github.com/nonebot/nonebot2/issues/new?${new URLSearchParams({
|
||||
assignees: "",
|
||||
labels: "Plugin",
|
||||
projects: "",
|
||||
template: "plugin_publish.yml",
|
||||
title: `Plugin: ${result.pypi}`,
|
||||
...result,
|
||||
})}`
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Form type="plugin" formItems={formItems} handleSubmit={handleSubmit} />
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user