♻️ Address pull request feedback

This commit is contained in:
Meier Lukas
2023-08-06 14:12:39 +02:00
parent 4b2c5f2816
commit 9e576f1498
53 changed files with 934 additions and 746 deletions

40
src/validations/boards.ts Normal file
View File

@@ -0,0 +1,40 @@
import { DEFAULT_THEME, MANTINE_COLORS, MantineColor } from '@mantine/core';
import { z } from 'zod';
export const createBoardSchemaValidation = z.object({
name: z.string().min(2).max(25),
});
export const boardCustomizationSchema = z.object({
layout: z.object({
leftSidebarEnabled: z.boolean(),
rightSidebarEnabled: z.boolean(),
pingsEnabled: z.boolean(),
}),
gridstack: z.object({
sm: z.number().min(1).max(8),
md: z.number().min(3).max(16),
lg: z.number().min(5).max(20),
}),
pageMetadata: z.object({
pageTitle: z.string(),
metaTitle: z.string(),
logoSrc: z.string(),
faviconSrc: z.string(),
}),
appearance: z.object({
backgroundSrc: z.string(),
primaryColor: z.custom<MantineColor>(
(value) => typeof value === 'string' && MANTINE_COLORS.includes(value)
),
secondaryColor: z.custom<MantineColor>(
(value) => typeof value === 'string' && MANTINE_COLORS.includes(value)
),
shade: z
.number()
.min(0)
.max(DEFAULT_THEME.colors['blue'].length - 1),
opacity: z.number().min(10).max(100),
customCss: z.string(),
}),
});