diff --git a/src/app/shared/layout/header.component.css b/src/app/shared/layout/header.component.css index ec8c0591..e0e4e37a 100644 --- a/src/app/shared/layout/header.component.css +++ b/src/app/shared/layout/header.component.css @@ -53,3 +53,29 @@ align-items: center; } } + +.repo-button-text { + margin-right: 32px; +} + +.remove-btn { + position: absolute; + right: 2px; + inset-block: 0; + margin-block: auto; + border: none; + color: lightgray; + width: 28px; + height: 28px; + font-size: 28px; + line-height: 28px; + display: none; +} + +.remove-btn:hover { + color: red; +} + +button.mat-menu-item:hover .remove-btn { + display: inline-block; +} diff --git a/src/app/shared/layout/header.component.html b/src/app/shared/layout/header.component.html index 5811a4a0..950f31eb 100644 --- a/src/app/shared/layout/header.component.html +++ b/src/app/shared/layout/header.component.html @@ -45,7 +45,8 @@
diff --git a/src/app/shared/layout/header.component.ts b/src/app/shared/layout/header.component.ts index d8a60e07..5c37b342 100644 --- a/src/app/shared/layout/header.component.ts +++ b/src/app/shared/layout/header.component.ts @@ -302,4 +302,14 @@ export class HeaderComponent implements OnInit { } }); } + + /** + * Removes the repo from the list of suggestions. + * This method will update the local storage as well. + */ + removeRepo(repo: string, event: MouseEvent) { + event.stopPropagation(); + event.preventDefault(); + this.repoUrlCacheService.removeFromSuggestions(repo); + } }