Skip to content

Commit

Permalink
Display all Project Contributors on About page using GitHub API (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz committed Mar 8, 2021
1 parent d5cc558 commit e32066a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
32 changes: 28 additions & 4 deletions frontend/src/app/components/about/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,43 @@ <h3 i18n="about.maintainers">Project Maintainers</h3>
<div class="row row-cols-2" dir="ltr">
<div class="col col-md-2 offset-md-4">
<a href="https://twitter.com/softsimon_">
<div class="profile_photo mx-auto" style="background-image: url(/resources/profile/softsimon.jpg)"></div>
@softsimon_
<div class="profile_photo d-inline-block" title="softsimon">
<img class="profile_img" src="resources/profile/softsimon.jpg" />
softsimon
</div>
</a>
</div>
<div class="col col-md-2">
<a href="https://twitter.com/wiz">
<div class="profile_photo mx-auto" style="background-image: url(/resources/profile/wiz.png)"></div>
@wiz
<div class="profile_photo d-inline-block" title="wiz">
<img class="profile_img" src="resources/profile/wiz.png" />
wiz
</div>
</a>
</div>
</div>
</div>

<br><br>

<h3 i18n="about.contributors">Project Contributors</h3>

<div *ngIf="contributors === null">
<br>
<div class="spinner-border text-light"></div>
</div>

<ng-template ngFor let-contributor [ngForOf]="contributors">
<a [href]="'https://github.com/' + contributor.name" target="_blank">
<div class="profile_photo d-inline-block" [title]="contributor.name">
<img class="profile_img" [src]="'/api/v1/contributors/images/' + contributor.id" />
{{ contributor.name }}
</div>
</a>
</ng-template>

<br><br>

</div>

<br><br>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/app/components/about/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export class AboutComponent implements OnInit, OnDestroy {
paymentForm: FormGroup;
donationStatus = 1;
sponsors$: Observable<any>;
contributors$: Observable<any>;
donationObj: any;
sponsorsEnabled = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
sponsors = null;
contributors = null;
requestSubscription: Subscription | undefined;

constructor(
Expand Down Expand Up @@ -51,6 +53,11 @@ export class AboutComponent implements OnInit, OnDestroy {
.subscribe((sponsors) => {
this.sponsors = sponsors;
});

this.apiService.getContributor$()
.subscribe((contributors) => {
this.contributors = contributors;
});
}

ngOnDestroy() {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/app/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export class ApiService {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/donations');
}

getContributor$(): Observable<any[]> {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/contributors');
}

checkDonation$(orderId: string): Observable<any[]> {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/donations/check?order_id=' + orderId);
}
Expand Down
6 changes: 6 additions & 0 deletions nginx-mempool.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
location /api/v1/donations/images {
proxy_pass https://mempool.space;
}
location /api/v1/contributors {
proxy_pass https://mempool.space;
}
location /api/v1/contributors/images {
proxy_pass https://mempool.space;
}
location /api/v1/ws {
proxy_pass http://127.0.0.1:8999/;
proxy_http_version 1.1;
Expand Down

0 comments on commit e32066a

Please sign in to comment.