Skip to content

Commit

Permalink
docs: fix crisis-center / crisis-list route parameter (#48853)
Browse files Browse the repository at this point in the history
The params is in the child component, let's reflect that in the code.

fixes #36970

PR Close #48853
  • Loading branch information
JeanMeche authored and thePunderWoman committed Jan 26, 2023
1 parent 74603b9 commit 6443086
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,39 @@
}

.crises li:hover {
left: .1em;
left: 0.1em;
}

.crises a {
color: black;
text-decoration: none;
display: block;
background-color: #EEE;
margin: .5em 0;
background-color: #eee;
margin: 0.5em 0;
border-radius: 4px;
line-height: 2rem;
}

@media (min-width: 600px) {
.crises a {
font-size: 1.2rem;
padding: .5em 0;
padding: 0.5em 0;
line-height: 1.4rem;
}
}

.crises a:hover {
color: #2c3a41;
background-color: #e6e6e6;
left: .1em;
left: 0.1em;
}

.crises .selected a {
background: #d6e6f7;
}

.crises .selected a:hover {
background-color: #bdd7f5;
}

.heroes .selected a {
Expand All @@ -47,10 +55,10 @@
}

.crises .badge {
padding: .5em .6em;
padding: 0.5em 0.6em;
color: white;
background-color: #435B60;
background-color: #435b60;
min-width: 16px;
margin-right: .8em;
margin-right: 0.8em;
border-radius: 4px 0 0 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { switchMap } from 'rxjs/operators';
styleUrls: ['./crisis-list.component.css']
})
export class CrisisListComponent implements OnInit {
crises$!: Observable<Crisis[]>;
crises$?: Observable<Crisis[]>;
selectedId = 0;

constructor(
Expand All @@ -21,7 +21,7 @@ export class CrisisListComponent implements OnInit {
) {}

ngOnInit() {
this.crises$ = this.route.paramMap.pipe(
this.crises$ = this.route.firstChild?.paramMap.pipe(
switchMap(params => {
this.selectedId = parseInt(params.get('id')!, 10);
return this.service.getCrises();
Expand Down

0 comments on commit 6443086

Please sign in to comment.