diff --git a/frontend/src/app/credits/credits.component.html b/frontend/src/app/credits/credits.component.html index 11be4c4..d8e8077 100644 --- a/frontend/src/app/credits/credits.component.html +++ b/frontend/src/app/credits/credits.component.html @@ -1,21 +1,40 @@ -

credits works!

+
+
+ + SharePulse Logo + SharePulse + +
+

+ Upload a file. Share the URL/link. Download the file. Simple as that. +

+
+
+

Developer:

+

Walzen665

+
+
+

Version:

+

1.0.0

+
+
+

API-Status:

+

online

+
+ +
-

- Used media -

- +

+ Privacy Policy | + Terms of Use +

+ +
diff --git a/frontend/src/app/credits/credits.component.ts b/frontend/src/app/credits/credits.component.ts index 38205bc..f23db40 100644 --- a/frontend/src/app/credits/credits.component.ts +++ b/frontend/src/app/credits/credits.component.ts @@ -1,12 +1,26 @@ import { Component } from '@angular/core'; +import {RouterLink} from "@angular/router"; +import {LegalService} from "../../service/legalService"; @Component({ selector: 'app-credits', standalone: true, - imports: [], + imports: [ + RouterLink + ], templateUrl: './credits.component.html', styleUrl: './credits.component.scss' }) export class CreditsComponent { + constructor(private legalService: LegalService) { + } + + openPrivacyPolicyModal() { + this.legalService.openPrivacyPolicy(); + } + + openTermsOfUseModal() { + this.legalService.openTermsOfUse(); + } } diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index 4c30bf4..25d86be 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -25,72 +25,11 @@

We prioritize data security and privacy consequently. Files uploaded by our clients are securely stored on our servers for a maximum duration of one day, after which they are permanently deleted to guarantee the highest level of confidentiality and data protection. Read more in our - Privacy Policy note. - By using SharePulse, you agree to the Terms of Use.

+ Privacy Policy note. + By using SharePulse, you agree to the Terms of Use.

- - - - - - - - - - + + + + + + + + + + + diff --git a/frontend/src/app/navbar/navbar.component.ts b/frontend/src/app/navbar/navbar.component.ts index e995551..11f884a 100644 --- a/frontend/src/app/navbar/navbar.component.ts +++ b/frontend/src/app/navbar/navbar.component.ts @@ -1,21 +1,46 @@ -import { Component } from '@angular/core'; +import {Component, ElementRef, ViewChild} from '@angular/core'; import {RouterLink} from "@angular/router"; import {NgClass} from "@angular/common"; +import {FormsModule} from "@angular/forms"; +import {LegalService} from "../../service/legalService"; @Component({ selector: 'app-navbar', standalone: true, - imports: [ - RouterLink, - NgClass - ], + imports: [ + RouterLink, + NgClass, + FormsModule + ], templateUrl: './navbar.component.html', styleUrl: './navbar.component.scss' }) export class NavbarComponent { + + @ViewChild('privacy_policy_modal') privacy_policy_modal: ElementRef | undefined; + @ViewChild('terms_of_use_modal') terms_of_use_modal: ElementRef | undefined; + isMenuOpen = false; + constructor(private legalService: LegalService) { + this.legalService.openModal$.subscribe((modalId) => { + if (modalId === 'privacyPolicy') { + this.openPrivacyPolicy(); + } else if (modalId === 'termsOfUse') { + this.openTermsOfUse(); + } + }); + } + toggleMenu(): void { this.isMenuOpen = !this.isMenuOpen; } + + openPrivacyPolicy() { + this.privacy_policy_modal?.nativeElement.showModal(); + } + + openTermsOfUse() { + this.terms_of_use_modal?.nativeElement.showModal(); + } } diff --git a/frontend/src/service/legalService.ts b/frontend/src/service/legalService.ts new file mode 100644 index 0000000..21f428f --- /dev/null +++ b/frontend/src/service/legalService.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; +import { Subject } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class LegalService { + private openModalSource = new Subject(); + + openModal$ = this.openModalSource.asObservable(); + + openPrivacyPolicy() { + this.openModalSource.next('privacyPolicy'); + } + + openTermsOfUse() { + this.openModalSource.next('termsOfUse'); + } +}