UNPKG

react-native-unit-components

Version:

Unit React Native components

31 lines 1.53 kB
import { DISPATCH_REQUEST_REFRESH } from './../../scripts/html/bodyScript'; import { WebComponentType } from '../../types/internal/webComponent.types'; export const getActivityParams = props => { const accountIdParam = props.accountId ? `account-id="${props.accountId}"` : ''; const queryFilterParam = props.queryFilter ? `query-filter="${props.queryFilter}"` : ''; const paginationTypeParam = props.paginationType ? `pagination-type="${props.paginationType}"` : ''; const transactionsPerPageParam = props.transactionsPerPage ? `transactions-per-page="${props.transactionsPerPage}"` : ''; return ` customer-token="${props.customerToken}" ${accountIdParam} hide-filter-button="${props.hideFilterButton || false}" hide-back-to-top="${props.hideBackToTop || false}" hide-title="${props.hideTitle || false}" ${queryFilterParam} ${paginationTypeParam} ${transactionsPerPageParam} style="height: 100%" `; }; export const getActivityScript = () => { return DISPATCH_REQUEST_REFRESH; }; export const injectRefreshEventIfNeeded = (currentWeb, requestRefreshEvent) => { if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.activity.valueOf())) { currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`); } }; export const injectFiltersChanged = (currentWeb, query) => { currentWeb?.injectJavaScript(`dispatchActivityFilterChangedEvent('${query}')`); }; //# sourceMappingURL=UNActivityComponent.utils.js.map