import { useSelect } from '@wordpress/data'; import Preview from './preview'; import Export from './export'; import TemplatesContent from './templates-content'; const Content = ( { importTemplate, getOrder, setQuery, getSearchQuery, setSorting, isSearch, setSearch, } ) => { const isFetching = useSelect( ( select ) => select( 'tpc/beaver' ).isFetching() ); const isPreview = useSelect( ( select ) => select( 'tpc/beaver' ).isPreview() ); const currentTab = useSelect( ( select ) => select( 'tpc/beaver' ).getCurrentTab() ); if ( isPreview ) { return ( ); } if ( 'export' === currentTab ) { return ; } return (
); }; export default Content; /* global localStorage, lodash, FLBuilder */ import { stringifyUrl } from 'query-string'; import { v4 as uuidv4 } from 'uuid'; import apiFetch from '@wordpress/api-fetch'; import { dispatch, select } from '@wordpress/data'; const { omit } = lodash; const dispatchNotification = ( message ) => FLBuilder.alert( message ); const { setFetching } = dispatch( 'tpc/beaver' ); export const fetchTemplates = async ( additionalParams = {} ) => { const params = { cache: localStorage.getItem( 'tpcCacheBuster' ), ...window.tiTpc.params, per_page: 20, page: 0, premade: true, template_site_slug: 'general', ...omit( additionalParams, 'isScroll' ), }; const url = stringifyUrl( { url: window.tiTpc.endpoint + 'page-templates', query: params, } ); try { setFetching( true ); const response = await apiFetch( { url, method: 'GET', parse: false, } ); setFetching( false ); if ( response.ok ) { const templates = await response.json(); if ( templates.message ) { return dispatchNotification( templates.message ); } let items = templates; if ( additionalParams.isScroll ) { const library = select( 'tpc/beaver' ).getTemplates(); items = [ ...library.items, ...templates ]; } const totalPages = response.headers.get( 'x-wp-totalpages' ); const currentPage = params.page; dispatch( 'tpc/beaver' ).updateTemplates( items, currentPage, totalPages ); } } catch ( error ) { if ( error.message ) { dispatchNotification( error.message ); } } }; export const fetchLibrary = async ( additionalParams = {} ) => { const params = { per_page: 20, page: 0, ...omit( additionalParams, 'isScroll' ), }; const url = stringifyUrl( { url: window.tiTpc.endpoint + 'templates', query: { cache: localStorage.getItem( 'tpcCacheBuster' ), ...window.tiTpc.params, ...params, }, } ); try { setFetching( true ); const response = await apiFetch( { url, method: 'GET', parse: false, } ); setFetching( false ); if ( response.ok ) { const templates = await response.json(); if ( templates.message ) { return dispatchNotification( templates.message ); } let items = templates; if ( additionalParams.isScroll ) { const library = select( 'tpc/beaver' ).getLibrary(); items = [ ...library.items, ...templates ]; } const totalPages = response.headers.get( 'x-wp-totalpages' ); const currentPage = params.page; dispatch( 'tpc/beaver' ).updateLibrary( items, currentPage, totalPages ); } } catch ( error ) { if ( error.message ) { dispatchNotification( error.message ); } } }; export const importTemplate = async ( template ) => { const url = stringifyUrl( { url: `${ window.tiTpc.endpoint }templates/${ template }/import`, query: { cache: localStorage.getItem( 'tpcCacheBuster' ), ...window.tiTpc.params, }, } ); let content = {}; try { const response = await apiFetch( { url, method: 'GET', parse: false, } ); if ( response.ok ) { content = await response.json(); if ( content.message ) { return dispatchNotification( content.message ); } } } catch ( error ) { if ( error.message ) { dispatchNotification( error.message ); } } return content; }; export const updateTemplate = async ( params ) => { const url = stringifyUrl( { url: `${ window.tiTpc.endpoint }templates/${ params.template_id }`, query: { cache: localStorage.getItem( 'tpcCacheBuster' ), ...window.tiTpc.params, ...params, }, } ); try { const response = await apiFetch( { url, method: 'POST', parse: false, } ); if ( response.ok ) { const content = await response.json(); if ( content.message ) { return dispatchNotification( content.message ); } } localStorage.setItem( 'tpcCacheBuster', uuidv4() ); await fetchLibrary(); } catch ( error ) { if ( error.message ) { dispatchNotification( error.message ); } } }; export const deleteTemplate = async ( template ) => { const url = stringifyUrl( { url: `${ window.tiTpc.endpoint }templates/${ template }`, query: { cache: localStorage.getItem( 'tpcCacheBuster' ), _method: 'DELETE', ...window.tiTpc.params, }, } ); try { const response = await apiFetch( { url, method: 'POST' } ); if ( response.ok ) { const content = await response.json(); if ( content.message ) { return dispatchNotification( content.message ); } } localStorage.setItem( 'tpcCacheBuster', uuidv4() ); await fetchLibrary(); } catch ( error ) { if ( error.message ) { dispatchNotification( error.message ); } } }; Contact Us - We Ummat

Contact Us

Get in Touch with Us

We would love to hear from you! Whether you have a question, feedback, or need assistance, our team is here to help. Reach out to us through any of the methods listed below, and we will get back to you promptly.

Phone Number

If you prefer to speak directly with one of our representatives, give us a call:

+918955714398

WhatsApp

For quick communication, you can also message us on WhatsApp:

+918955714398

Email

For detailed inquiries or to send us documents, feel free to email us at:

contact@weummat.com

Visit Our Office

Our office is located at the following address. You are welcome to visit us during our business hours:

HGW3+CQW, Barsinghpura Road, Near Bharat Gas Agency, Khandela, Rajasthan-332709

Our Location on Google Maps

You can find us easily with the map below. Click the map to open Google Maps for directions:

Contact Us Form

If you prefer, you can also fill out our contact form below, and we will get back to you shortly:

[contact-form-7 id=”5643″ title=”Contact-US Form”]
All Rights Reserved 2023.
Proudly powered by WordPress | Theme: Falcha News by Candid Themes.