feat: 新增独立工坊宣传模板及配置导入验证
This commit is contained in:
1 parent
bf4bbf81c7
commit
04e42b3a80
43 files changed
+5726
-13
No files matched your search
@@ -21,9 +21,13 @@ import "./forms.css";
|
||||
export function Inquiry({
|
||||
workspace,
|
||||
preview = false,
|
||||
choiceStyle = "picker",
|
||||
beforeSubmit,
|
||||
}: {
|
||||
workspace: RuntimeWorkspace;
|
||||
preview?: boolean;
|
||||
choiceStyle?: "chips" | "picker";
|
||||
beforeSubmit?: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [offeringId, setOfferingId] = useState(router.params.offeringId || "");
|
||||
@@ -107,7 +111,8 @@ export function Inquiry({
|
||||
const value = values[field.key];
|
||||
const stringValue = typeof value === "string" ? value : "";
|
||||
const chips =
|
||||
compactForm && field.key === "type" && ["select", "radio"].includes(field.type);
|
||||
(choiceStyle === "chips" || (compactForm && field.key === "type")) &&
|
||||
["select", "radio"].includes(field.type);
|
||||
return (
|
||||
<View
|
||||
className={`form-field ${compactForm && compactFieldKeys.has(field.key) ? "half-field" : ""}`}
|
||||
@@ -200,6 +205,7 @@ export function Inquiry({
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
{beforeSubmit}
|
||||
{error && (
|
||||
<View className="form-error" role="alert">
|
||||
{error}
|
||||
|
||||
Reference in new issue
Block a user