mirror of
https://ghproxy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-07-21 12:16:59 +08:00
* add: reviews module * add: logic for the days * Update modules/reviews/assets/src/layouts/user-feedback-form.js Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com> * fix: button name and action * add: feedback url * fix: endpoint for feedback * remove: unused imports * add: app_name * update: move app name to the request --------- Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com>
26 lines
634 B
JavaScript
26 lines
634 B
JavaScript
import { store as coreDataStore } from '@wordpress/core-data';
|
|
import { dispatch, useSelect } from '@wordpress/data';
|
|
|
|
const useStorage = () => {
|
|
const save = async (data) => {
|
|
return await dispatch(coreDataStore).saveEntityRecord('root', 'site', data);
|
|
};
|
|
|
|
// Fetch site data with useSelect and check resolution status
|
|
const get = useSelect((select) => {
|
|
return {
|
|
data: select(coreDataStore).getEntityRecord('root', 'site'),
|
|
hasFinishedResolution: select(coreDataStore).hasFinishedResolution(
|
|
'getEntityRecord',
|
|
['root', 'site'],
|
|
),
|
|
};
|
|
}, []);
|
|
|
|
return {
|
|
save,
|
|
get,
|
|
};
|
|
};
|
|
|
|
export default useStorage;
|