fix(tailwind): Ensure tailwind properly purges unused utility classes (#2485)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-07-26 13:22:25 +02:00
1 parent 44e935f209
commit 3220af737c
33 files changed
+1028 -243

No files matched your search

-1
View File
@@ -6,7 +6,6 @@ import 'regenerator-runtime/runtime';
import App from './App.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
// test
/**
* EXTENSIONS
@@ -63,20 +63,21 @@ function DataSourceWrapper(props) {
setIsLoading(true);
const studies = await dataSource.query.studies.search(queryFilterValues);
setIsLoading(false);
setData({
studies: studies || [],
total: studies.length,
resultsPerPage: queryFilterValues.resultsPerPage,
pageNumber: queryFilterValues.pageNumber,
});
setIsLoading(false);
}
try {
// Cache invalidation :thinking:
// - Anytime change is not just next/previous page
// - And we didn't cross a result offset range
const isFirstLoad = data.studies.length === 0;
const isFirstLoad = data.studies.length === 0 && !isLoading;
const isSamePage = data.pageNumber === queryFilterValues.pageNumber;
const previousOffset =
Math.floor((data.pageNumber * data.resultsPerPage) / STUDIES_LIMIT) *
@@ -88,7 +89,7 @@ function DataSourceWrapper(props) {
) *
(STUDIES_LIMIT - 1);
const isDataInvalid =
isFirstLoad || isSamePage || newOffset !== previousOffset;
isFirstLoad || !isSamePage || newOffset !== previousOffset;
if (isDataInvalid) {
getData();
@@ -97,7 +98,7 @@ function DataSourceWrapper(props) {
console.warn(ex);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [location, params]);
}, [data, location, params, isLoading, setIsLoading]);
// queryFilterValues
// TODO: Better way to pass DataSource?