Skip to content

Commit

Permalink
Display privacy policy in the burger menu (hobbyfarm#188)
Browse files Browse the repository at this point in the history
* Display privacy policy in the burger menu

* Formatting
  • Loading branch information
jggoebel authored Jan 5, 2024
1 parent d82b942 commit ef79c3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
<a (click)="about()" clrDropdownItem
><cds-icon shape="help-info"></cds-icon> About</a
>
<a
[href]="privacyPolicyLink"
*ngIf="privacyPolicyLink"
clrDropdownItem
target="_blank"
>
<cds-icon shape="pop-out"></cds-icon> {{ privacyPolicyLinkName }}
</a>
<a (click)="logout()" clrDropdownItem
><cds-icon shape="logout"></cds-icon> Logout</a
>
Expand Down
13 changes: 13 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export class AppComponent implements OnInit {
'Hobbyfarm Project': 'https://github.com/hobbyfarm/hobbyfarm',
};

public privacyPolicyLink = '';
public privacyPolicyLinkName = '';

public themes = themes;
public motd = '';

Expand Down Expand Up @@ -202,6 +205,16 @@ export class AppComponent implements OnInit {
.subscribe((typedInput: TypedInput) => {
this.buttons = typedInput?.value ?? this.buttons;
});

this.typedSettingsService
.list('public')
.subscribe((typedInputs: Map<string, TypedInput>) => {
this.privacyPolicyLink =
typedInputs.get('registration-privacy-policy-link')?.value ?? '';
this.privacyPolicyLinkName =
typedInputs.get('registration-privacy-policy-linkname')?.value ??
'Privacy Policy';
});
}

private processToken(token: string) {
Expand Down

0 comments on commit ef79c3b

Please sign in to comment.