add theme store and input, update some components to use theme
This commit is contained in:
parent
43c205e577
commit
0c55c9996f
12 changed files with 459 additions and 68 deletions
27
frontend/src/stores/company.js
Normal file
27
frontend/src/stores/company.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useCompanyStore = defineStore("company", {
|
||||
state: () => ({
|
||||
companies: ["SprinklersNW", "Nuco Yard Care", "Lowe Fencing", "Veritas Stone", "Daniel's Landscape Supplies"],
|
||||
selectedCompany: "SprinklersNW",
|
||||
}),
|
||||
|
||||
getters: {
|
||||
currentCompany: (state) => state.selectedCompany,
|
||||
},
|
||||
|
||||
actions: {
|
||||
setSelectedCompany(companyName) {
|
||||
if (this.companies.includes(companyName)) {
|
||||
this.selectedCompany = companyName;
|
||||
}
|
||||
},
|
||||
|
||||
setCompanies(companies = []) {
|
||||
this.companies = [...companies];
|
||||
if (!this.companies.includes(this.selectedCompany)) {
|
||||
this.selectedCompany = this.companies[0] || null;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue