1 import { Component } from 'inferno';
2 import { Subscription } from 'rxjs';
3 import { retryWhen, delay, take } from 'rxjs/operators';
4 import { WebSocketService } from '../services';
9 } from '../interfaces';
10 import { i18n } from '../i18next';
11 import { T } from 'inferno-i18next';
12 import { repoUrl, wsJsonToRes, toast } from '../utils';
14 interface SilverUser {
34 let highlighted = ['DiscountFuneral', 'Oskenso Kashi', 'Alex Benishek'];
35 let silver: Array<SilverUser> = [
38 link: 'https://iww.org',
44 export class Sponsors extends Component<any, any> {
45 private subscription: Subscription;
46 constructor(props: any, context: any) {
47 super(props, context);
48 this.subscription = WebSocketService.Instance.subject
49 .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
51 msg => this.parseMessage(msg),
52 err => console.error(err),
53 () => console.log('complete')
56 WebSocketService.Instance.getSite();
60 window.scrollTo(0, 0);
63 componentWillUnmount() {
64 this.subscription.unsubscribe();
69 <div class="container text-center">
82 <h5>{i18n.t('donate_to_lemmy')}</h5>
84 <T i18nKey="sponsor_message">
85 #<a href={repoUrl}>#</a>
88 <a class="btn btn-secondary" href="https://liberapay.com/Lemmy/">
89 {i18n.t('support_on_liberapay')}
92 class="btn btn-secondary ml-2"
93 href="https://www.patreon.com/dessalines"
95 {i18n.t('support_on_patreon')}
98 class="btn btn-secondary ml-2"
99 href="https://opencollective.com/lemmy"
101 {i18n.t('support_on_open_collective')}
108 <div class="container">
109 <h5>{i18n.t('sponsors')}</h5>
110 <p>{i18n.t('silver_sponsors')}</p>
111 <div class="row card-columns">
113 <div class="card col-12 col-md-2">
116 <a href={s.link} target="_blank" rel="noopener">
120 <div>💎 {s.name}</div>
126 <p>{i18n.t('general_sponsors')}</p>
127 <div class="row card-columns">
128 {highlighted.map(s => (
129 <div class="card bg-primary col-12 col-md-2 font-weight-bold">
134 <div class="card col-12 col-md-2">
146 <h5>{i18n.t('crypto')}</h5>
147 <div class="table-responsive">
148 <table class="table table-hover text-center">
151 <td>{i18n.t('bitcoin')}</td>
153 <code>1Hefs7miXS5ff5Ck5xvmjKjXf5242KzRtK</code>
157 <td>{i18n.t('ethereum')}</td>
159 <code>0x400c96c96acbC6E7B3B43B1dc1BB446540a88A01</code>
163 <td>{i18n.t('monero')}</td>
166 41taVyY6e1xApqKyMVDRVxJ76sPkfZhALLTjRvVKpaAh2pBd4wv9RgYj1tSPrx8wc6iE1uWUfjtQdTmTy2FGMeChGVKPQuV
177 parseMessage(msg: WebSocketJsonResponse) {
179 let res = wsJsonToRes(msg);
181 toast(i18n.t(msg.error), 'danger');
183 } else if (res.op == UserOperation.GetSite) {
184 let data = res.data as GetSiteResponse;
185 document.title = `${i18n.t('sponsors')} - ${data.site.name}`;