mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
refactor: loading
This commit is contained in:
parent
df448e66e8
commit
3fb8a4f5f3
@ -7,9 +7,10 @@ import SearchField from '../../common/SearchField/SearchField';
|
|||||||
import PageContent from '../../common/PageContent/PageContent';
|
import PageContent from '../../common/PageContent/PageContent';
|
||||||
import HeaderTitle from '../../common/HeaderTitle';
|
import HeaderTitle from '../../common/HeaderTitle';
|
||||||
import useApplications from '../../../hooks/api/getters/useApplications/useApplications';
|
import useApplications from '../../../hooks/api/getters/useApplications/useApplications';
|
||||||
|
import ConditionallyRender from '../../common/ConditionallyRender';
|
||||||
|
|
||||||
const ApplicationList = () => {
|
const ApplicationList = () => {
|
||||||
const { applications } = useApplications();
|
const { applications, loading } = useApplications();
|
||||||
const [filter, setFilter] = useState('');
|
const [filter, setFilter] = useState('');
|
||||||
|
|
||||||
const filteredApplications = useMemo(() => {
|
const filteredApplications = useMemo(() => {
|
||||||
@ -49,11 +50,17 @@ const ApplicationList = () => {
|
|||||||
</div>
|
</div>
|
||||||
<PageContent headerContent={<HeaderTitle title="Applications" />}>
|
<PageContent headerContent={<HeaderTitle title="Applications" />}>
|
||||||
<div className={commonStyles.fullwidth}>
|
<div className={commonStyles.fullwidth}>
|
||||||
{filteredApplications.length > 0 ? (
|
<ConditionallyRender
|
||||||
<AppsLinkList apps={filteredApplications} />
|
condition={filteredApplications.length > 0}
|
||||||
) : (
|
show={<AppsLinkList apps={filteredApplications} />}
|
||||||
<RenderNoApplications />
|
elseShow={
|
||||||
)}
|
<ConditionallyRender
|
||||||
|
condition={loading}
|
||||||
|
show={<div>...loading</div>}
|
||||||
|
elseShow={<RenderNoApplications />}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</PageContent>
|
</PageContent>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user