mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
Show catalog names while loading
This commit is contained in:
parent
8fb09b0026
commit
7220635d79
1 changed files with 10 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ const React = require('react');
|
|||
const PropTypes = require('prop-types');
|
||||
const classnames = require('classnames');
|
||||
const debounce = require('lodash.debounce');
|
||||
const { useTranslation } = require('react-i18next');
|
||||
const useTranslate = require('stremio/common/useTranslate');
|
||||
const { default: Icon } = require('@stremio/stremio-icons/react');
|
||||
const { withCoreSuspender, getVisibleChildrenRange } = require('stremio/common');
|
||||
const { Image, MainNavBars, MetaItem, MetaRow } = require('stremio/components');
|
||||
|
|
@ -14,7 +14,7 @@ const styles = require('./styles');
|
|||
const THRESHOLD = 100;
|
||||
|
||||
const Search = ({ queryParams }) => {
|
||||
const { t } = useTranslation();
|
||||
const t = useTranslate();
|
||||
const [search, loadSearchRows] = useSearch(queryParams);
|
||||
const query = React.useMemo(() => {
|
||||
return search.selected !== null ?
|
||||
|
|
@ -52,24 +52,24 @@ const Search = ({ queryParams }) => {
|
|||
query === null ?
|
||||
<div className={classnames(styles['search-hints-wrapper'])}>
|
||||
<div className={classnames(styles['search-hints-title-container'], 'animation-fade-in')}>
|
||||
<div className={styles['search-hints-title']}>{t('SEARCH_ANYTHING')}</div>
|
||||
<div className={styles['search-hints-title']}>{t.string('SEARCH_ANYTHING')}</div>
|
||||
</div>
|
||||
<div className={classnames(styles['search-hints-container'], 'animation-fade-in')}>
|
||||
<div className={styles['search-hint-container']}>
|
||||
<Icon className={styles['icon']} name={'trailer'} />
|
||||
<div className={styles['label']}>{t('SEARCH_CATEGORIES')}</div>
|
||||
<div className={styles['label']}>{t.string('SEARCH_CATEGORIES')}</div>
|
||||
</div>
|
||||
<div className={styles['search-hint-container']}>
|
||||
<Icon className={styles['icon']} name={'actors'} />
|
||||
<div className={styles['label']}>{t('SEARCH_PERSONS')}</div>
|
||||
<div className={styles['label']}>{t.string('SEARCH_PERSONS')}</div>
|
||||
</div>
|
||||
<div className={styles['search-hint-container']}>
|
||||
<Icon className={styles['icon']} name={'link'} />
|
||||
<div className={styles['label']}>{t('SEARCH_PROTOCOLS')}</div>
|
||||
<div className={styles['label']}>{t.string('SEARCH_PROTOCOLS')}</div>
|
||||
</div>
|
||||
<div className={styles['search-hint-container']}>
|
||||
<Icon className={styles['icon']} name={'imdb-outline'} />
|
||||
<div className={styles['label']}>{t('SEARCH_TYPES')}</div>
|
||||
<div className={styles['label']}>{t.string('SEARCH_TYPES')}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -81,7 +81,7 @@ const Search = ({ queryParams }) => {
|
|||
src={require('/images/empty.png')}
|
||||
alt={' '}
|
||||
/>
|
||||
<div className={styles['message-label']}>{ t('STREMIO_TV_SEARCH_NO_ADDONS') }</div>
|
||||
<div className={styles['message-label']}>{ t.string('STREMIO_TV_SEARCH_NO_ADDONS') }</div>
|
||||
</div>
|
||||
:
|
||||
search.catalogs.map((catalog, index) => {
|
||||
|
|
@ -110,11 +110,13 @@ const Search = ({ queryParams }) => {
|
|||
return null;
|
||||
}
|
||||
default: {
|
||||
const loadingTitle = `${catalog.addon.manifest.name}: ${t.catalogTitle(catalog)}`;
|
||||
return (
|
||||
<MetaRow.Placeholder
|
||||
key={index}
|
||||
className={classnames(styles['search-row'], styles['search-row-poster'], 'animation-fade-in')}
|
||||
catalog={catalog}
|
||||
title={loadingTitle}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue