fix(ui):修正影响编译的问题。
This commit is contained in:
parent
019652ca67
commit
86d7823aae
|
@ -9,9 +9,9 @@ export function LicenseCode() {
|
||||||
const licenseCode = useLicenseCodeStore((state) => state.licenceCode);
|
const licenseCode = useLicenseCodeStore((state) => state.licenceCode);
|
||||||
const copyLicenseCode = async () => {
|
const copyLicenseCode = async () => {
|
||||||
if (not(isEmpty(licenseCode))) {
|
if (not(isEmpty(licenseCode))) {
|
||||||
await navigator.clipboard.writeText(licenseCode);
|
await navigator.clipboard.writeText(licenseCode ?? "");
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: "授权码已复制",
|
message: "授权码已复制",
|
||||||
color: "green",
|
color: "green",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ async function generateLicense(form: LicenseInfoForm, selectedProducts: string[]
|
||||||
const validDays = now.add(validYears, "year").diff(now, "day");
|
const validDays = now.add(validYears, "year").diff(now, "day");
|
||||||
if (isEmpty(selectedProducts)) {
|
if (isEmpty(selectedProducts)) {
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: "至少需要选择一个产品",
|
message: "至少需要选择一个产品",
|
||||||
color: "red",
|
color: "red",
|
||||||
});
|
});
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -22,7 +22,7 @@ export const useProductsStore = create<ProductsStore>((set, get) => ({
|
||||||
append: (code: string) => {
|
append: (code: string) => {
|
||||||
const selectedProduct: Product | undefined = find(propEq(code, "id"), get().products);
|
const selectedProduct: Product | undefined = find(propEq(code, "id"), get().products);
|
||||||
set((state) => ({
|
set((state) => ({
|
||||||
selectedProducts: uniq([...state.selectedProducts, code, ...(selectedProduct.couple ?? [])]),
|
selectedProducts: uniq([...state.selectedProducts, code, ...(selectedProduct?.couple ?? [])]),
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
remove: (code: string) =>
|
remove: (code: string) =>
|
||||||
|
|
|
@ -4,5 +4,11 @@ export const theme = createTheme({
|
||||||
focusRing: "never",
|
focusRing: "never",
|
||||||
fontSmoothing: true,
|
fontSmoothing: true,
|
||||||
defaultRadius: "xs",
|
defaultRadius: "xs",
|
||||||
lineHeights: "xs",
|
lineHeights: {
|
||||||
|
xs: "1.2",
|
||||||
|
sm: "1.25",
|
||||||
|
md: "1.35",
|
||||||
|
lg: "1.4",
|
||||||
|
xl: "1.5",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
import cx, { ClassDictionary } from "clsx";
|
import cx, { ClassDictionary } from "clsx";
|
||||||
import { defaultTo, isEmpty, isNil, prop } from "ramda";
|
import { isEmpty, isNil, prop } from "ramda";
|
||||||
import { ChangeHandler } from "react-hook-form";
|
|
||||||
|
|
||||||
export function convertFormEvent(
|
|
||||||
name: string,
|
|
||||||
event: InputEvent,
|
|
||||||
property: string = "value",
|
|
||||||
defaultValue?: unknown = null
|
|
||||||
): Parameters<ChangeHandler> {
|
|
||||||
return {
|
|
||||||
target: {
|
|
||||||
name,
|
|
||||||
value: defaultTo(defaultValue)(prop(property, event.currentTarget)),
|
|
||||||
},
|
|
||||||
type: event.type,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function composite(classesDefination: ClassDictionary, ...classes: string[]) {
|
export function composite(classesDefination: ClassDictionary, ...classes: string[]) {
|
||||||
/** @type {import("clsx").ClassArray} */
|
/** @type {import("clsx").ClassArray} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user