Skip to content

Commit 8433fb9

Browse files
feat: spinner on loading
feat: spinner loading added
2 parents f7189c9 + e8d809e commit 8433fb9

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

frontend/packages/volto-searchblocks/src/components/SearchBlocks/SearchBlocks.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
22
import { useDispatch, useSelector } from 'react-redux';
33
import { createPortal } from 'react-dom';
44
import { Link } from 'react-router-dom';
5-
import { Container, Segment, Header, Table } from 'semantic-ui-react';
5+
import { Container, Segment, Header, Table, Loader } from 'semantic-ui-react';
66
import { Helmet } from '@plone/volto/helpers';
77
import { SelectWidget } from '@plone/volto/components';
88
import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar';
@@ -174,9 +174,9 @@ const SearchBlocks = (props) => {
174174
<Segment>
175175
<div className="blocks-search-results">
176176
{loading && (
177-
<div className="loader">
177+
<Loader active inline="centered" size="medium">
178178
<FormattedMessage {...messages.loading} />
179-
</div>
179+
</Loader>
180180
)}
181181

182182
{!loading && items && items.length > 0 && (
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const SEARCH_BLOCKS = 'SEARCH_BLOCKS';
2+
export const SEARCH_BLOCKS_PENDING = 'SEARCH_BLOCKS_PENDING';
23
export const SEARCH_BLOCKS_SUCCESS = 'SEARCH_BLOCKS_SUCCESS';
34
export const SEARCH_BLOCKS_FAIL = 'SEARCH_BLOCKS_FAIL';

frontend/packages/volto-searchblocks/src/reducers/searchBlocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
SEARCH_BLOCKS,
2+
SEARCH_BLOCKS_PENDING,
33
SEARCH_BLOCKS_SUCCESS,
44
SEARCH_BLOCKS_FAIL,
55
} from '../constants/ActionTypes';
@@ -17,7 +17,7 @@ const initialState = {
1717

1818
export default function searchBlocks(state = initialState, action = {}) {
1919
switch (action.type) {
20-
case SEARCH_BLOCKS:
20+
case SEARCH_BLOCKS_PENDING:
2121
return {
2222
...state,
2323
error: null,

0 commit comments

Comments
 (0)