1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

refactor(frontend): 🏗️ scafold pages and componenets folder

Setup the file structure for components, pages, layouts, api, and all new frontend structure
This commit is contained in:
hay-kot 2021-07-31 14:45:28 -08:00
parent 8d3db89327
commit 91f56b42de
47 changed files with 1027 additions and 146 deletions

View file

@ -0,0 +1 @@
export { fieldTypes } from "./use-field-types";

View file

@ -0,0 +1,11 @@
export const fieldTypes = {
TEXT: "text",
TEXT_AREA: "textarea",
LIST: "list",
SELECT: "select",
OBJECT: "object",
BOOLEAN: "boolean",
COLOR: "color",
};

View file

@ -0,0 +1,8 @@
const EMAIL_REGEX =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
export const validators = {
required: (v: string) => !!v || "This Field is Required",
email: (v: string) => !v || EMAIL_REGEX.test(v) || "Email Must Be Valid",
whitespace: (v: string) => !v || v.split(" ").length <= 1 || "No Whitespace Allowed"
}