Skip to content

Commit f76e4dd

Browse files
authored
added google icon (#2912)
### Fixes # <!-- Mention the issues this PR addresses --> ### Checks - [ ] Ran `yarn test-build` - [ ] Updated relevant documentations - [ ] Updated matching config options in altair-static ### Changes proposed in this pull request: <!-- Describe the changes being introduced in this PR --> ## Summary by Sourcery Provide a proper Google logo in the account login dialog by injecting and sanitizing inline SVG and binding it to the app-icon component Enhancements: - Add a googleIcon SafeHtml property in AccountDialogComponent with a sanitized inline Google SVG - Update account-dialog template to use the new googleIcon via the app-icon component for the Google sign-in button <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * The login dialog now shows the official Google "Sign in" icon on the Google button instead of a placeholder. This improves visual clarity, brand recognition, and consistency across the app. The icon is embedded and safely rendered; sign-in behavior remains unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 61c815e commit f76e4dd

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

packages/altair-app/src/app/modules/altair/components/account-dialog/__snapshots__/account-dialog.component.spec.ts.snap

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,31 @@ exports[`AccountDialogComponent should create 1`] = `
8080
class="btn btn--bordered"
8181
type="button"
8282
>
83+
<app-icon>
84+
<span
85+
class="app-icon app-icon__injected"
86+
>
87+
88+
89+
90+
<svg
91+
class="icon"
92+
fill="currentColor"
93+
viewBox="0 0 1024 1024"
94+
xmlns="http://www.w3.org/2000/svg"
95+
>
96+
97+
98+
<path
99+
d="M881 442.4H519.7v148.5h206.4c-8.9 48-35.9 88.6-76.6 115.8-34.4 23-78.3 36.6-129.9 36.6-99.9 0-184.4-67.5-214.6-158.2-7.6-23-12-47.6-12-72.9s4.4-49.9 12-72.9c30.3-90.6 114.8-158.1 214.7-158.1 56.3 0 106.8 19.4 146.6 57.4l110-110.1c-66.5-62-153.2-100-256.6-100-149.9 0-279.6 86-342.7 211.4-26 51.8-40.8 110.4-40.8 172.4S151 632.8 177 684.6C240.1 810 369.8 896 519.7 896c103.6 0 190.4-34.4 253.8-93 72.5-66.8 114.4-165.2 114.4-282.1 0-27.2-2.4-53.3-6.9-78.5z"
100+
/>
101+
102+
103+
</svg>
104+
</span>
105+
106+
107+
</app-icon>
83108
SIGNIN_WITH_GOOGLE
84109
</button>
85110
<button

packages/altair-app/src/app/modules/altair/components/account-dialog/account-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2>Login to get started</h2>
2525
class="btn btn--bordered"
2626
(click)="submitLogin('GOOGLE')"
2727
>
28-
<!-- <app-icon name="google"></app-icon> -->
28+
<app-icon [svg]="googleIcon" />
2929
{{ 'SIGNIN_WITH_GOOGLE' | translate }}
3030
</button>
3131
<button

packages/altair-app/src/app/modules/altair/components/account-dialog/account-dialog.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import {
22
ChangeDetectionStrategy,
33
Component,
44
input,
5-
output
5+
output,
6+
inject,
67
} from '@angular/core';
78
import { AccountState } from 'altair-graphql-core/build/types/state/account.interfaces';
89
import { apiClient } from '../../services/api/api.service';
910
import { externalLink } from '../../utils';
1011
import { IdentityProvider } from '@altairgraphql/db';
12+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
1113

1214
@Component({
1315
selector: 'app-account-dialog',
@@ -23,6 +25,17 @@ export class AccountDialogComponent {
2325
readonly handleLoginChange = output<IdentityProvider>();
2426
readonly logoutChange = output();
2527

28+
googleIcon: SafeHtml;
29+
private sanitizer = inject(DomSanitizer);
30+
31+
constructor() {
32+
const googleSvg = `<?xml version="1.0" standalone="no"?>
33+
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 1024 1024" fill="currentColor">
34+
<path d="M881 442.4H519.7v148.5h206.4c-8.9 48-35.9 88.6-76.6 115.8-34.4 23-78.3 36.6-129.9 36.6-99.9 0-184.4-67.5-214.6-158.2-7.6-23-12-47.6-12-72.9s4.4-49.9 12-72.9c30.3-90.6 114.8-158.1 214.7-158.1 56.3 0 106.8 19.4 146.6 57.4l110-110.1c-66.5-62-153.2-100-256.6-100-149.9 0-279.6 86-342.7 211.4-26 51.8-40.8 110.4-40.8 172.4S151 632.8 177 684.6C240.1 810 369.8 896 519.7 896c103.6 0 190.4-34.4 253.8-93 72.5-66.8 114.4-165.2 114.4-282.1 0-27.2-2.4-53.3-6.9-78.5z"/>
35+
</svg>`;
36+
this.googleIcon = this.sanitizer.bypassSecurityTrustHtml(googleSvg);
37+
}
38+
2639
submitLogin(provider: IdentityProvider = IdentityProvider.GOOGLE) {
2740
this.handleLoginChange.emit(provider);
2841
}

0 commit comments

Comments
 (0)