Add loading state to filter bar

This commit is contained in:
Lim Chee Aun 2023-10-19 10:13:53 +08:00
parent 7145c20136
commit 106cd16e41
3 changed files with 15 additions and 2 deletions

View file

@ -2116,6 +2116,13 @@ ul.link-list li a .icon {
transparent transparent
); );
align-items: center; align-items: center;
transition: opacity 0.3s ease-out;
&.loading,
.loading > & {
pointer-events: none;
opacity: 0.5;
}
} }
.filter-bar.centered { .filter-bar.centered {
justify-content: center; justify-content: center;

View file

@ -334,7 +334,13 @@ function Timeline({
</button> </button>
)} )}
</header> </header>
{!!timelineStart && <div class="timeline-start">{timelineStart}</div>} {!!timelineStart && (
<div
class={`timeline-start ${uiState === 'loading' ? 'loading' : ''}`}
>
{timelineStart}
</div>
)}
{!!items.length ? ( {!!items.length ? (
<> <>
<ul class="timeline"> <ul class="timeline">

View file

@ -152,7 +152,7 @@ function Search(props) {
</header> </header>
<main> <main>
{!!q && ( {!!q && (
<div class="filter-bar"> <div class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}>
{!!type && ( {!!type && (
<Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}> <Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}>
All All