diff --git a/src/bundle/Resources/public/scss/ui/modules/_common.scss b/src/bundle/Resources/public/scss/ui/modules/_common.scss index 34f5c67534..d916cc360d 100644 --- a/src/bundle/Resources/public/scss/ui/modules/_common.scss +++ b/src/bundle/Resources/public/scss/ui/modules/_common.scss @@ -4,3 +4,4 @@ @import 'common/simple.dropdown'; @import 'common/user.name'; @import 'common/taggify'; +@import 'common/spinner'; diff --git a/src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss b/src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss new file mode 100644 index 0000000000..bc8a361a38 --- /dev/null +++ b/src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss @@ -0,0 +1,11 @@ +.c-spinner { + @include spinner(calculateRem(26px), calculateRem(3px), $ibexa-color-primary); + + &--small { + @include spinner(calculateRem(16px), calculateRem(2px), $ibexa-color-primary); + } + + &--large { + @include spinner(calculateRem(86px), calculateRem(6px), $ibexa-color-primary); + } +} diff --git a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_content.meta.preview.scss b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_content.meta.preview.scss index ba6976364e..10090b55d6 100644 --- a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_content.meta.preview.scss +++ b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_content.meta.preview.scss @@ -94,7 +94,7 @@ } } - &__loading-spinner { + &__loading-spinner-wrapper { display: flex; justify-content: center; align-items: center; diff --git a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss index 697a374346..2c7b568216 100644 --- a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss +++ b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss @@ -65,7 +65,7 @@ right: 0; } - &__loading-spinner { + &__loading-spinner-wrapper { display: flex; align-items: center; justify-content: center; diff --git a/src/bundle/ui-dev/src/modules/common/spinner/spinner.js b/src/bundle/ui-dev/src/modules/common/spinner/spinner.js new file mode 100644 index 0000000000..e38bd39cec --- /dev/null +++ b/src/bundle/ui-dev/src/modules/common/spinner/spinner.js @@ -0,0 +1,29 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +import { createCssClassNames } from '@ibexa-admin-ui/src/bundle/ui-dev/src/modules/common/helpers/css.class.names'; + +export const SIZES = { + SMALL: 'small', + MEDIUM: 'medium', + SIZES: 'large', +}; + +const Spinner = ({ size }) => { + const className = createCssClassNames({ + 'c-spinner': true, + [`c-spinner--${size}`]: true, + }); + + return
; +}; + +Spinner.propTypes = { + size: PropTypes.oneOf(Object.values(SIZES)), +}; + +Spinner.defaultProps = { + size: SIZES.MEDIUM, +}; + +export default Spinner; diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/bookmarks-list/bookmarks.list.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/bookmarks-list/bookmarks.list.js index 09458dc23f..59c8daf348 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/bookmarks-list/bookmarks.list.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/bookmarks-list/bookmarks.list.js @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import { parse as parseTooltip } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/tooltips.helper'; import Icon from '../../../common/icon/icon'; +import Spinner from '../../../common/spinner/spinner'; import { createCssClassNames } from '../../../common/helpers/css.class.names'; import { findMarkedLocation } from '../../helpers/locations.helper'; @@ -53,7 +54,7 @@ const BookmarksList = ({ setBookmarkedLocationMarked, itemsPerPage }) => { return (