This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
import { ref } from "vue"; | ||
import { defineStore } from "pinia"; | ||
|
||
// @ts-expect-error - TS error with "state: () => {}" syntax | ||
// Use option API to take advantage of automatic persistence | ||
// @ts-expect-error - TS does not handle option API syntax | ||
export const useLetterStore = defineStore("letter", { | ||
state: () => { | ||
const recipientDetails = ref<string[]>([]); | ||
const subject = ref(""); | ||
const reference = ref(""); | ||
const paragraphs = ref<string[]>([]); | ||
|
||
return { | ||
paragraphs, | ||
recipientDetails, | ||
reference, | ||
subject, | ||
}; | ||
}, | ||
state: () => ({ | ||
paragraphs: [] as string[], | ||
recipientDetails: [] as string[], | ||
reference: "", | ||
subject: "", | ||
}), | ||
persist: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
import { ref } from "vue"; | ||
import { defineStore } from "pinia"; | ||
import type { Template } from "@/types"; | ||
import { templateColors, templates } from "@/globals"; | ||
|
||
// @ts-expect-error - TS error with "state: () => {}" syntax | ||
// Use option API to take advantage of automatic persistence | ||
// @ts-expect-error - TS does not handle option API syntax | ||
export const useProfileStore = defineStore("profile", { | ||
state: () => { | ||
const template = ref<Template>(templates[0]); | ||
|
||
const name = ref(""); | ||
const title = ref(""); | ||
|
||
const isThemeCustomized = ref(false); | ||
const colors = ref(templateColors[template.value]); | ||
|
||
return { | ||
colors, | ||
isThemeCustomized, | ||
name, | ||
template, | ||
title, | ||
}; | ||
}, | ||
state: () => ({ | ||
colors: templateColors[templates[0]], | ||
isThemeCustomized: false, | ||
name: "", | ||
template: templates[0] as Template, | ||
title: "", | ||
}), | ||
persist: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import { ref } from "vue"; | ||
import { defineStore } from "pinia"; | ||
import type { Category, Detail, Link } from "@/types"; | ||
|
||
// @ts-expect-error - TS error with "state: () => {}" syntax | ||
// Use option API to take advantage of automatic persistence | ||
// @ts-expect-error - TS does not handle option API syntax | ||
export const useResumeStore = defineStore("resume", { | ||
state: () => { | ||
const about = ref(""); | ||
const contactDetails = ref<Detail[]>([]); | ||
const socialLinks = ref<Link[]>([]); | ||
const categories = ref<Category[]>([]); | ||
|
||
return { | ||
about, | ||
categories, | ||
contactDetails, | ||
socialLinks, | ||
}; | ||
}, | ||
state: () => ({ | ||
about: "", | ||
categories: [] as Category[], | ||
contactDetails: [] as Detail[], | ||
socialLinks: [] as Link[], | ||
}), | ||
persist: true, | ||
}); |