Skip to content

Commit 215f73b

Browse files
authored
Adds Copy Link and Copy QR code buttons (#2196)
1 parent e21d1b0 commit 215f73b

15 files changed

+535
-35
lines changed

package-lock.json

Lines changed: 169 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@iplab/ngx-file-upload": "^17",
4747
"@ngx-translate/core": "^16.0.4",
4848
"@ngx-translate/http-loader": "^16.0.1",
49+
"angularx-qrcode": "^17.0.1",
4950
"firebase": "^10.7.2",
5051
"firebaseui": "^6.1.0",
5152
"firebaseui-angular": "^6.2.0",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
Copyright 2025 The Ground Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<div class="share-buttons">
18+
<button mat-stroked-button (click)="copyLinkToClipboard()">
19+
<mat-icon fontSet="material-symbols-outlined">link_24px</mat-icon>
20+
21+
<span>Copy link</span>
22+
</button>
23+
24+
<button mat-stroked-button (click)="copyQrCodeToClipboard()">
25+
<mat-icon fontSet="material-symbols-outlined">qr_code_2_24px</mat-icon>
26+
27+
<span>Copy QR code</span>
28+
</button>
29+
</div>
30+
31+
<div style="display: none;">
32+
<qrcode
33+
#qrCodeElement
34+
[qrdata]="surveyAppLink"
35+
[colorDark]="'#000000ff'"
36+
[colorLight]="'#ffffffff'"
37+
[elementType]="'canvas'"
38+
[errorCorrectionLevel]="'M'"
39+
[imageSrc]="'./assets/img/logo.svg'"
40+
[imageHeight]="75"
41+
[imageWidth]="75"
42+
[margin]="2"
43+
[scale]="1"
44+
[width]="300"
45+
></qrcode>
46+
</div>
47+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright 2025 The Ground Authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the 'License');
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an 'AS IS' BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
.share-buttons {
18+
display: flex;
19+
gap: 8px;
20+
}

0 commit comments

Comments
 (0)