Skip to content

Commit

Permalink
add btc connect (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivganes authored Nov 11, 2023
1 parent d9c5187 commit 2d87ea8
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 43 deletions.
197 changes: 194 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@clr/angular": "^15.12.4",
"@clr/ui": "^15.12.4",
"@fractalsoftware/random-avatar-generator": "^1.0.11",
"@getalby/bitcoin-connect": "^2.3.1",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@noble/curves": "^1.1.0",
Expand Down
10 changes: 6 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ComponentRef, OnInit, OnDestroy } from '@angular/core';
import { Component, OnInit, OnDestroy} from '@angular/core';
import {TranslateService} from "@ngx-translate/core";

import '@cds/core/icon/register.js';
Expand Down Expand Up @@ -36,6 +36,7 @@ import {
flagIcon,
arrowIcon,
bubbleExclamationIcon,
bitcoinIcon
} from '@cds/core/icon';
import { NdkproviderService } from './service/ndkprovider.service';
import { Router } from '@angular/router';
Expand All @@ -51,12 +52,13 @@ import {
BreakpointObserver,
BreakpointState
} from '@angular/cdk/layout';
import { BtcConnectService } from './service/btc-connect.service';

ClarityIcons.addIcons(flagIcon, bubbleExclamationIcon,starIcon,internetOfThingsIcon,thumbsUpIcon,heartIcon, thumbsDownIcon, floppyIcon, noteIcon, userIcon, boltIcon, plusCircleIcon, logoutIcon, hashtagIcon, homeIcon, cogIcon, usersIcon, sunIcon, moonIcon, searchIcon, keyIcon, copyIcon,imageIcon, trashIcon, shareIcon, chatBubbleIcon, paperclipIcon, wandIcon, downloadCloudIcon, uploadCloudIcon);
ClarityIcons.addIcons(bitcoinIcon,flagIcon, bubbleExclamationIcon,starIcon,internetOfThingsIcon,thumbsUpIcon,heartIcon, thumbsDownIcon, floppyIcon, noteIcon, userIcon, boltIcon, plusCircleIcon, logoutIcon, hashtagIcon, homeIcon, cogIcon, usersIcon, sunIcon, moonIcon, searchIcon, keyIcon, copyIcon,imageIcon, trashIcon, shareIcon, chatBubbleIcon, paperclipIcon, wandIcon, downloadCloudIcon, uploadCloudIcon);
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit, OnDestroy{
title = 'zapddit';
Expand All @@ -73,7 +75,7 @@ export class AppComponent implements OnInit, OnDestroy{
currentLanguage:string;

constructor(private translate: TranslateService, public ndkProvider: NdkproviderService, router: Router,
private breakpointObserver: BreakpointObserver, private communityService:CommunityService, private topicService:TopicService) {
private breakpointObserver: BreakpointObserver, private communityService:CommunityService, private topicService:TopicService, private btcConnectService:BtcConnectService) {
translate.setDefaultLang('en');

var language = localStorage.getItem(Constants.LANGUAGE);
Expand Down
5 changes: 3 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ClipboardModule } from '@angular/cdk/clipboard';
import { NgModule, isDevMode } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule, isDevMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LayoutModule } from '@angular/cdk/layout';

import "@getalby/bitcoin-connect";
// import ngx-translate and the http loader
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
Expand Down Expand Up @@ -101,6 +101,7 @@ const componentParsers: Array<HookParserEntry> = [
})],
providers: [],
bootstrap: [AppComponent],
schemas:[CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}

Expand Down
2 changes: 0 additions & 2 deletions src/app/component/event-card/event-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ export class EventCardComponent implements OnInit, OnDestroy{
}
}



ngOnInit():void {
this.hexEventId = this.event?.id;
this.originalKind = this.event?.kind;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ <h3 align="center">
</clr-accordion-content>
</clr-accordion-panel>

<clr-accordion-panel *ngIf="!ndkProvider.isTryingZapddit">
<clr-accordion-title>{{'Bitcoin Connect'|translate}} <cds-icon shape="bitcoin" solid="true" class="btc-icon" size="md"></cds-icon></clr-accordion-title>
<clr-accordion-content *clrIfExpanded>
<form onsubmit="return false;">
<bc-button app-name="zapddit"/>
<label>{{'Connect to upzap/downzap with minimal effort using'|translate}} <a href="https://bitcoin-connect.com/" target="_blank" translate>Bitcoin Connect</a></label>
</form>
</clr-accordion-content>
</clr-accordion-panel>

<clr-accordion-panel *ngIf="!ndkProvider.isTryingZapddit">
<clr-accordion-title>{{'Zaps'|translate}} ⚡</clr-accordion-title>
<clr-accordion-content *clrIfExpanded>
Expand Down Expand Up @@ -79,7 +89,7 @@ <h3 align="center">
</div>
<button type="submit" [disabled]="isLoggedInUsingPubKey"
class="btn btn-primary" (click)="saveDownzapRecipients()">Save</button>
</form>
</form>
<form clrForm onsubmit="return false;">
<clr-checkbox-container clrInline>
<clr-checkbox-wrapper>
Expand All @@ -106,6 +116,8 @@ <h3 align="center">
</clr-accordion-content>
</clr-accordion-panel>



<clr-accordion-panel>
<clr-accordion-title translate>Communities</clr-accordion-title>
<clr-accordion-content *clrIfExpanded>
Expand Down
Loading

0 comments on commit 2d87ea8

Please sign in to comment.