mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 02:01:29 +10:00
feat(homepage): add new sections to homepage
This commit is contained in:
21
libs/dto/src/contributors/index.ts
Normal file
21
libs/dto/src/contributors/index.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { createZodDto } from "nestjs-zod/dto";
|
||||
import { z } from "nestjs-zod/z";
|
||||
|
||||
export const contributorSchema = z.object({
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
url: z.string(),
|
||||
avatar: z.string(),
|
||||
});
|
||||
|
||||
export class ContributorDto extends createZodDto(contributorSchema) {}
|
||||
|
||||
export const languageSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
locale: z.string(),
|
||||
editorCode: z.string(),
|
||||
progress: z.number(),
|
||||
});
|
||||
|
||||
export class LanguageDto extends createZodDto(languageSchema) {}
|
||||
@ -1,4 +1,5 @@
|
||||
export * from "./auth";
|
||||
export * from "./contributors";
|
||||
export * from "./resume";
|
||||
export * from "./statistics";
|
||||
export * from "./user";
|
||||
|
||||
@ -9,7 +9,6 @@ export const defaultLayout = [
|
||||
|
||||
// Schema
|
||||
export const metadataSchema = z.object({
|
||||
locale: z.string().default("en-US"),
|
||||
template: z.string().default("rhyhorn"),
|
||||
layout: z.array(z.array(z.array(z.string()))).default(defaultLayout), // pages -> columns -> sections
|
||||
css: z.object({
|
||||
@ -37,6 +36,7 @@ export const metadataSchema = z.object({
|
||||
size: z.number().default(14),
|
||||
}),
|
||||
lineHeight: z.number().default(1.5),
|
||||
hideIcons: z.boolean().default(false),
|
||||
underlineLinks: z.boolean().default(true),
|
||||
}),
|
||||
notes: z.string().default(""),
|
||||
@ -47,7 +47,6 @@ export type Metadata = z.infer<typeof metadataSchema>;
|
||||
|
||||
// Defaults
|
||||
export const defaultMetadata: Metadata = {
|
||||
locale: "en-US",
|
||||
template: "rhyhorn",
|
||||
layout: defaultLayout,
|
||||
css: {
|
||||
@ -75,6 +74,7 @@ export const defaultMetadata: Metadata = {
|
||||
size: 14,
|
||||
},
|
||||
lineHeight: 1.5,
|
||||
hideIcons: false,
|
||||
underlineLinks: true,
|
||||
},
|
||||
notes: "",
|
||||
|
||||
@ -452,7 +452,6 @@ export const sampleResume: ResumeData = {
|
||||
},
|
||||
},
|
||||
metadata: {
|
||||
locale: "en-US",
|
||||
template: "pikachu",
|
||||
layout: [
|
||||
[
|
||||
@ -490,6 +489,7 @@ export const sampleResume: ResumeData = {
|
||||
size: 13,
|
||||
},
|
||||
lineHeight: 2,
|
||||
hideIcons: false,
|
||||
underlineLinks: true,
|
||||
},
|
||||
notes:
|
||||
|
||||
@ -36,7 +36,7 @@ type ComboboxPropsMultiple = {
|
||||
|
||||
export type ComboboxProps = ComboboxPropsSingle | ComboboxPropsMultiple;
|
||||
|
||||
export const handleSingleSelect = (props: ComboboxPropsSingle, option: ComboboxOption) => {
|
||||
const handleSingleSelect = (props: ComboboxPropsSingle, option: ComboboxOption) => {
|
||||
if (props.clearable) {
|
||||
props.onValueChange?.(option.value === props.value ? "" : option.value);
|
||||
} else {
|
||||
@ -44,7 +44,7 @@ export const handleSingleSelect = (props: ComboboxPropsSingle, option: ComboboxO
|
||||
}
|
||||
};
|
||||
|
||||
export const handleMultipleSelect = (props: ComboboxPropsMultiple, option: ComboboxOption) => {
|
||||
const handleMultipleSelect = (props: ComboboxPropsMultiple, option: ComboboxOption) => {
|
||||
if (props.value?.includes(option.value)) {
|
||||
if (!props.clearable && props.value.length === 1) return false;
|
||||
props.onValueChange?.(props.value.filter((value) => value !== option.value));
|
||||
|
||||
Reference in New Issue
Block a user