AcceptedFileExtension.js
export const ACCEPTED_IMAGE_FILE_EXTENSION = List([
"jpg",
"jpeg",
"png",
"gif"
]);
export const ACCEPTED_IMAGE_FILE_EXTENSION_STRING = transToString(
ACCEPTED_IMAGE_FILE_EXTENSION
);
export const ACCEPTED_VIDEO_FILE_EXTENSION = List([
"mp4"
]);
export const ACCEPTED_VIDEO_FILE_EXTENSION_STRING = transToString(
ACCEPTED_VIDEO_FILE_EXTENSION
);
export const ALL_ACCEPTED_FILE_EXTENSION = List([
"htm",
"html",
"css",
"js",
"txt",
"json",
...ACCEPTED_IMAGE_FILE_EXTENSION,
"svg",
...ACCEPTED_VIDEO_FILE_EXTENSION
]);
AcceptedFileExtension.js
export const PC_BREAKPOINT_WIDTH = 1025;
export const TABLET_BREAKPOINT_WIDTH = 640;
export const MOBILE_BREAKPOINT_WIDTH = 639;
genWarningMsg.js
const WARNING_MSG = {
none: "",
invalid: "is invalid",
empty: "不可為空",
zero: "cannot be zero",
emptyZero: "cannot be empty or 0",
positive: "should be a positive number",
lessThan: "should less than",
noLessThan: "cannot less than",
emptyZeroNoLessThan: "cannot be empty or 0 or less than",
greaterThan: "should greater than",
noGreaterThan: "cannot greater than",
emptyZeroNoGreaterThan: "cannot be empty or 0 or greater than"
};
export default function genWarningMsg(title, condition = "none", rules = "") {
const error_type = WARNING_MSG[condition];
return `${title} ${error_type} ${rules}`;
}