mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02:00
fix: now project overview has skeleton instead of placeholders (#5696)
Removed `ref` dependency from `useLoading` hook, it was being overly reactive and breaking skeleton.
This commit is contained in:
parent
1a79921a38
commit
bb5b322475
@ -45,6 +45,7 @@ import { FeatureSegmentCell } from 'component/common/Table/cells/FeatureSegmentC
|
|||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
import { FeatureToggleListTable as LegacyFeatureToggleListTable } from './LegacyFeatureToggleListTable';
|
import { FeatureToggleListTable as LegacyFeatureToggleListTable } from './LegacyFeatureToggleListTable';
|
||||||
import { FeatureToggleListActions } from './FeatureToggleListActions/FeatureToggleListActions';
|
import { FeatureToggleListActions } from './FeatureToggleListActions/FeatureToggleListActions';
|
||||||
|
import useLoading from 'hooks/useLoading';
|
||||||
|
|
||||||
export const featuresPlaceholder = Array(15).fill({
|
export const featuresPlaceholder = Array(15).fill({
|
||||||
name: 'Name of the feature',
|
name: 'Name of the feature',
|
||||||
@ -107,6 +108,7 @@ const FeatureToggleListTableComponent: VFC = () => {
|
|||||||
value ? `${value}` : undefined,
|
value ? `${value}` : undefined,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
const bodyLoadingRef = useLoading(loading);
|
||||||
const { favorite, unfavorite } = useFavoriteFeaturesApi();
|
const { favorite, unfavorite } = useFavoriteFeaturesApi();
|
||||||
const onFavorite = useCallback(
|
const onFavorite = useCallback(
|
||||||
async (feature: FeatureSchema) => {
|
async (feature: FeatureSchema) => {
|
||||||
@ -257,7 +259,6 @@ const FeatureToggleListTableComponent: VFC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
isLoading={loading}
|
|
||||||
bodyClass='no-padding'
|
bodyClass='no-padding'
|
||||||
header={
|
header={
|
||||||
<PageHeader
|
<PageHeader
|
||||||
@ -311,7 +312,9 @@ const FeatureToggleListTableComponent: VFC = () => {
|
|||||||
state={filterState}
|
state={filterState}
|
||||||
/>
|
/>
|
||||||
<SearchHighlightProvider value={query || ''}>
|
<SearchHighlightProvider value={query || ''}>
|
||||||
<PaginatedTable tableInstance={table} totalItems={total} />
|
<div ref={bodyLoadingRef}>
|
||||||
|
<PaginatedTable tableInstance={table} totalItems={total} />
|
||||||
|
</div>
|
||||||
</SearchHighlightProvider>
|
</SearchHighlightProvider>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={rows.length === 0}
|
condition={rows.length === 0}
|
||||||
|
@ -16,7 +16,7 @@ const useLoading = (loading: boolean, selector = '[data-loading=true]') => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [loading, ref]);
|
}, [loading]);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user