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 {
32 let highlighted = ['DiscountFuneral', 'Oskenso Kashi', 'Alex Benishek'];
33 let silver: Array<SilverUser> = [
36 link: 'https://iww.org',
42 export class Sponsors extends Component<any, any> {
43 private subscription: Subscription;
44 constructor(props: any, context: any) {
45 super(props, context);
46 this.subscription = WebSocketService.Instance.subject
47 .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
49 msg => this.parseMessage(msg),
50 err => console.error(err),
51 () => console.log('complete')
54 WebSocketService.Instance.getSite();
58 window.scrollTo(0, 0);
61 componentWillUnmount() {
62 this.subscription.unsubscribe();
67 <div class="container text-center">
80 <h5>{i18n.t('donate_to_lemmy')}</h5>
82 <T i18nKey="sponsor_message">
83 #<a href={repoUrl}>#</a>
86 <a class="btn btn-secondary" href="https://liberapay.com/Lemmy/">
87 {i18n.t('support_on_liberapay')}
90 class="btn btn-secondary ml-2"
91 href="https://www.patreon.com/dessalines"
93 {i18n.t('support_on_patreon')}
96 class="btn btn-secondary ml-2"
97 href="https://opencollective.com/lemmy"
99 {i18n.t('support_on_open_collective')}
106 <div class="container">
107 <h5>{i18n.t('sponsors')}</h5>
108 <p>{i18n.t('silver_sponsors')}</p>
109 <div class="row card-columns">
111 <div class="card col-12 col-md-2">
114 <a href={s.link} target="_blank" rel="noopener">
118 <div>💎 {s.name}</div>
124 <p>{i18n.t('general_sponsors')}</p>
125 <div class="row card-columns">
126 {highlighted.map(s => (
127 <div class="card bg-primary col-12 col-md-2 font-weight-bold">
132 <div class="card col-12 col-md-2">
144 <h5>{i18n.t('crypto')}</h5>
145 <div class="table-responsive">
146 <table class="table table-hover text-center">
149 <td>{i18n.t('bitcoin')}</td>
151 <code>1Hefs7miXS5ff5Ck5xvmjKjXf5242KzRtK</code>
155 <td>{i18n.t('ethereum')}</td>
157 <code>0x400c96c96acbC6E7B3B43B1dc1BB446540a88A01</code>
161 <td>{i18n.t('monero')}</td>
164 41taVyY6e1xApqKyMVDRVxJ76sPkfZhALLTjRvVKpaAh2pBd4wv9RgYj1tSPrx8wc6iE1uWUfjtQdTmTy2FGMeChGVKPQuV
175 parseMessage(msg: WebSocketJsonResponse) {
177 let res = wsJsonToRes(msg);
179 toast(i18n.t(msg.error), 'danger');
181 } else if (res.op == UserOperation.GetSite) {
182 let data = res.data as GetSiteResponse;
183 document.title = `${i18n.t('sponsors')} - ${data.site.name}`;