From 36cd4c469274b2a7308be168c74696c4d3f27ced Mon Sep 17 00:00:00 2001 From: mertsincan Date: Sat, 30 Mar 2024 09:30:59 +0000 Subject: [PATCH] Theming API: Update actions --- .../themes/actions/{extendPreset.js => definePreset.js} | 0 components/lib/themes/actions/index.js | 5 +++-- components/lib/themes/actions/usePreset.js | 7 +++++++ .../lib/themes/actions/{updateTheme.js => useTheme.js} | 0 4 files changed, 10 insertions(+), 2 deletions(-) rename components/lib/themes/actions/{extendPreset.js => definePreset.js} (100%) create mode 100644 components/lib/themes/actions/usePreset.js rename components/lib/themes/actions/{updateTheme.js => useTheme.js} (100%) diff --git a/components/lib/themes/actions/extendPreset.js b/components/lib/themes/actions/definePreset.js similarity index 100% rename from components/lib/themes/actions/extendPreset.js rename to components/lib/themes/actions/definePreset.js diff --git a/components/lib/themes/actions/index.js b/components/lib/themes/actions/index.js index 727194f8c..21d1646d8 100644 --- a/components/lib/themes/actions/index.js +++ b/components/lib/themes/actions/index.js @@ -1,5 +1,6 @@ -export { default as extendPreset } from './extendPreset'; +export { default as definePreset } from './definePreset'; export { default as updatePreset } from './updatePreset'; export { default as updatePrimary } from './updatePrimary'; export { default as updateSurface } from './updateSurface'; -export { default as updateTheme } from './updateTheme'; +export { default as usePreset } from './usePreset'; +export { default as useTheme } from './useTheme'; diff --git a/components/lib/themes/actions/usePreset.js b/components/lib/themes/actions/usePreset.js new file mode 100644 index 000000000..6b37ba089 --- /dev/null +++ b/components/lib/themes/actions/usePreset.js @@ -0,0 +1,7 @@ +import Theme from 'primevue/themes'; + +export default (preset) => { + Theme.setPreset(preset); + + return preset; +}; diff --git a/components/lib/themes/actions/updateTheme.js b/components/lib/themes/actions/useTheme.js similarity index 100% rename from components/lib/themes/actions/updateTheme.js rename to components/lib/themes/actions/useTheme.js