-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from supportingami/feat/app-open-target
Add dynamic link and app open prompt
- Loading branch information
Showing
9 changed files
with
270 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { MatBottomSheet } from "@angular/material/bottom-sheet"; | ||
|
||
/** | ||
* Show a link to open the app in native platform version, using dynamic app link | ||
*/ | ||
@Component({ | ||
selector: "app-open-target", | ||
template: ` | ||
<div> | ||
<h2>Open With...</h2> | ||
<a [href]="appDynamicLink" target="_blank" rel="noopener"> | ||
<div class="open-option"> | ||
<img | ||
class="open-icon" | ||
src="assets/icon.png" | ||
style="border-radius:6px" | ||
/> | ||
<h3>Maths Club App</h3> | ||
<button mat-raised-button color="primary">Open</button> | ||
</div> | ||
</a> | ||
<div class="open-option" (click)="dismiss()"> | ||
<mat-icon class="open-icon">language</mat-icon> | ||
<h3>Browser</h3> | ||
<button mat-stroked-button>Continue</button> | ||
</div> | ||
<div class="spacer"></div> | ||
</div> | ||
`, | ||
styles: [ | ||
` | ||
.open-option { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 1rem; | ||
} | ||
h3 { | ||
margin-bottom: 0; | ||
flex: 1; | ||
text-align: left; | ||
margin-left: 1rem; | ||
} | ||
a { | ||
text-decoration: none; | ||
color: unset; | ||
} | ||
button { | ||
width: 90px; | ||
} | ||
.open-icon { | ||
font-size: 32px; | ||
height: 32px; | ||
width: 32px; | ||
} | ||
.spacer { | ||
height: 1rem; | ||
} | ||
`, | ||
], | ||
}) | ||
export class AppOpenTargetComponent implements OnInit { | ||
appDynamicLink = "https://samimathsclub.page.link/home"; | ||
constructor(private _bottomSheet: MatBottomSheet) {} | ||
|
||
dismiss() { | ||
this._bottomSheet.dismiss(); | ||
} | ||
|
||
ngOnInit() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters