diff options
author | Tyler Ferrari <69283684+Sowgro@users.noreply.github.com> | 2025-04-07 21:19:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-07 21:19:30 -0400 |
commit | ef62e670a4af08026581db83410bbc8b98e45d7d (patch) | |
tree | 926d727942996ad5c2eb5729935330a17d2bff78 /ufund-ui/src/app/components/need-page/need-page.component.ts | |
parent | 7617db08a43d873a65abd47b02e23ad8cb4cb5cd (diff) | |
parent | a6fd8cddfb5cf4812d6d974dc552bef44e816a21 (diff) | |
download | JellySolutions-ef62e670a4af08026581db83410bbc8b98e45d7d.tar.gz JellySolutions-ef62e670a4af08026581db83410bbc8b98e45d7d.tar.bz2 JellySolutions-ef62e670a4af08026581db83410bbc8b98e45d7d.zip |
Merge pull request #32 from RIT-SWEN-261-02/call-to-action
Call to action when not signed in on need page
Diffstat (limited to 'ufund-ui/src/app/components/need-page/need-page.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/need-page/need-page.component.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts index 17e330c..67dae83 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.ts +++ b/ufund-ui/src/app/components/need-page/need-page.component.ts @@ -14,18 +14,21 @@ import {ModalService} from '../../services/modal.service'; templateUrl: './need-page.component.html', styleUrl: './need-page.component.css' }) + export class NeedPageComponent implements OnInit { + constructor( private route: ActivatedRoute, private cupboardService: CupboardService, private authService: AuthService, protected usersService: UsersService, private toastService: ToastsService, - private router: Router, + protected router: Router, protected modalService: ModalService ) {} @Input() need!: Need; + warned: boolean = false; ngOnInit(): void { const id = Number(this.route.snapshot.paramMap.get('id')); @@ -44,6 +47,8 @@ export class NeedPageComponent implements OnInit { return of(); })) .subscribe(() => { + let action = {label: "View Basket", onAction: () => this.router.navigate(['/basket'])} + this.toastService.sendToast(ToastType.INFO, `"${need.name}" Added to basket`, action) this.usersService.refreshBasket(); }); } else { |