You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

2 years ago
  1. // state
  2. export const state = () => ({
  3. pictureUpdate: false,
  4. drawerIsActive: false,
  5. searchDialogIsActive: false,
  6. socialRegisterUpdate: false,
  7. currency: "USD",
  8. hidePrice:false,
  9. });
  10. // actions
  11. export const actions = {
  12. updatePicture({ commit }) {
  13. commit("changePicture");
  14. },
  15. updateRegister({ commit }) {
  16. commit("changeRegisterState");
  17. },
  18. toggleDrawer({ commit }, value) {
  19. commit("toggleDrawerState",value);
  20. },
  21. toggleSearchDialog({ commit },value) {
  22. commit("toggleSearchDialogState",value);
  23. },
  24. updateCurrency({ commit }, value) {
  25. commit("updateCurrencyValue", (value = value));
  26. },
  27. hideSwitchPrice({ commit }, value) {
  28. commit("hideSwitchPriceValue", value);
  29. }
  30. };
  31. // mutations
  32. export const mutations = {
  33. changePicture(state) {
  34. state.pictureUpdate = !state.pictureUpdate;
  35. },
  36. changeRegisterState(state) {
  37. state.socialRegisterUpdate = !state.socialRegisterUpdate;
  38. },
  39. toggleDrawerState(state, payload) {
  40. state.drawerIsActive = payload;
  41. },
  42. toggleSearchDialogState(state,payload) {
  43. state.searchDialogIsActive = payload;
  44. },
  45. updateCurrencyValue(state, value) {
  46. state.currency = value;
  47. },
  48. hideSwitchPriceValue(state,payload) {
  49. state.hidePrice = payload
  50. }
  51. };
  52. // getters
  53. export const getters = {
  54. getPictureStatus(state) {
  55. return state.pictureUpdate;
  56. },
  57. getRegisterStatus(state) {
  58. return state.socialRegisterUpdate;
  59. },
  60. getDrawerStatus(state) {
  61. return state.drawerIsActive;
  62. },
  63. getSearchDialogStatus(state) {
  64. return state.searchDialogIsActive;
  65. },
  66. getCurrency(state) {
  67. return state.currency;
  68. },
  69. getHidePrice(state) {
  70. return state.hidePrice;
  71. },
  72. };