🔥 Docs: 删除商店插件发布多余模块 (#2095)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
forchannot 2023-06-12 21:18:25 +08:00 committed by GitHub
parent 156807c365
commit dccf2f3ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,12 +29,9 @@ export default function Plugin(): JSX.Element {
const currentPlugins = filteredPlugins.slice(startIndex, endIndex + 1); const currentPlugins = filteredPlugins.slice(startIndex, endIndex + 1);
const [form, setForm] = useState<{ const [form, setForm] = useState<{
name: string;
desc: string;
projectLink: string; projectLink: string;
moduleName: string; moduleName: string;
homepage: string; }>({ projectLink: "", moduleName: "" });
}>({ name: "", desc: "", projectLink: "", moduleName: "", homepage: "" });
const ref = useRef<HTMLInputElement>(null); const ref = useRef<HTMLInputElement>(null);
const [tags, setTags] = useState<Tag[]>([]); const [tags, setTags] = useState<Tag[]>([]);
@ -48,13 +45,13 @@ export default function Plugin(): JSX.Element {
setModalOpen(false); setModalOpen(false);
const queries: { key: string; value: string }[] = [ const queries: { key: string; value: string }[] = [
{ key: "template", value: "plugin_publish.yml" }, { key: "template", value: "plugin_publish.yml" },
{ key: "title", value: form.name && `Plugin: ${form.name}` }, {
key: "title",
value: form.projectLink && `Plugin: ${form.projectLink}`,
},
{ key: "labels", value: "Plugin" }, { key: "labels", value: "Plugin" },
{ key: "name", value: form.name },
{ key: "description", value: form.desc },
{ key: "pypi", value: form.projectLink }, { key: "pypi", value: form.projectLink },
{ key: "module", value: form.moduleName }, { key: "module", value: form.moduleName },
{ key: "homepage", value: form.homepage },
{ key: "tags", value: JSON.stringify(tags) }, { key: "tags", value: JSON.stringify(tags) },
]; ];
const urlQueries = queries const urlQueries = queries
@ -95,10 +92,6 @@ export default function Plugin(): JSX.Element {
const delTag = (index: number) => { const delTag = (index: number) => {
setTags(tags.filter((_, i) => i !== index)); setTags(tags.filter((_, i) => i !== index));
}; };
const insertTagType = (text: string) => {
setLabel(text + label);
ref.current.value = text + label;
};
return ( return (
<> <>
@ -137,25 +130,6 @@ export default function Plugin(): JSX.Element {
<ModalContent> <ModalContent>
<form onSubmit={onSubmit}> <form onSubmit={onSubmit}>
<div className="grid grid-cols-1 gap-4 p-4"> <div className="grid grid-cols-1 gap-4 p-4">
<label className="flex flex-wrap">
<span className="mr-2">:</span>
<input
type="text"
name="name"
maxLength={20}
className="px-2 flex-grow rounded bg-light-nonepress-200 dark:bg-dark-nonepress-200"
onChange={onChange}
/>
</label>
<label className="flex flex-wrap">
<span className="mr-2">:</span>
<input
type="text"
name="desc"
className="px-2 flex-grow rounded bg-light-nonepress-200 dark:bg-dark-nonepress-200"
onChange={onChange}
/>
</label>
<label className="flex flex-wrap"> <label className="flex flex-wrap">
<span className="mr-2">PyPI :</span> <span className="mr-2">PyPI :</span>
<input <input
@ -174,15 +148,6 @@ export default function Plugin(): JSX.Element {
onChange={onChange} onChange={onChange}
/> />
</label> </label>
<label className="flex flex-wrap">
<span className="mr-2">/:</span>
<input
type="text"
name="homepage"
className="px-2 flex-grow rounded bg-light-nonepress-200 dark:bg-dark-nonepress-200"
onChange={onChange}
/>
</label>
</div> </div>
</form> </form>
<div className="px-4"> <div className="px-4">
@ -211,21 +176,7 @@ export default function Plugin(): JSX.Element {
disableAlpha={true} disableAlpha={true}
onChangeComplete={onChangeColor} onChangeComplete={onChangeColor}
/> />
<div className="flex flex-wrap mt-2 items-center">
<span className="mr-2">Type:</span>
<button
className="px-2 h-9 min-w-[64px] rounded text-hero hover:bg-hero hover:bg-opacity-[.08]"
onClick={() => insertTagType("a:")}
>
Adapter
</button>
<button
className="px-2 h-9 min-w-[64px] rounded text-hero hover:bg-hero hover:bg-opacity-[.08]"
onClick={() => insertTagType("t:")}
>
Topic
</button>
</div>
<div className="flex mt-2"> <div className="flex mt-2">
<TagComponent label={label} color={color} /> <TagComponent label={label} color={color} />
<button <button