Skip to content

Commit

Permalink
feat: search loading and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm authored and TwoDCube committed Aug 19, 2020
1 parent 820713a commit 7c74283
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<h1 *ngIf="(type$ | async) === 'term'">Találatok erre a kifejezésre: "{{ term$ | async }}"</h1>
<verseghy-loaders [hidden]="(loaded$ | async) === true || (error$ | async) !== null" [loader]="'pacman'"></verseghy-loaders>
<span *ngIf="(error$ | async) !== null && (error$ | async).status === 404">Nincs találat!</span>
<span *ngIf="(error$ | async) !== null && (error$ | async).status !== 404">Ismeretlen hiba történt!</span>
<div class="results">
<verseghy-card [post]="post" *ngFor="let post of posts$ | async"></verseghy-card>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
h1 {
font-weight: 400;
margin-top: 30px;
font-size: 24px;

@media screen and (max-width: 770px) {
font-size: 20px;
}
}

span {
margin-top: 20px;
display: block;
}

.results {
Expand Down
2 changes: 2 additions & 0 deletions apps/frontend/src/app/modules/search/search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import * as fromSearch from './state/search/search.reducer'
import { SearchEffects } from './state/search/search.effects'
import { SearchFacade } from './state/search/search.facade'
import { SharedModule } from '../shared/shared.module'
import { LoadersModule } from '@verseghy/ui'

@NgModule({
declarations: [SearchComponent],
imports: [
CommonModule,
SearchRoutingModule,
LoadersModule,
StoreModule.forFeature(fromSearch.SEARCH_FEATURE_KEY, fromSearch.reducer),
EffectsModule.forFeature([SearchEffects]),
SharedModule,
Expand Down

0 comments on commit 7c74283

Please sign in to comment.