aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/supportFerdi/SupportFerdiDashboard.tsx
blob: 505c49812f9a490a8b987642c26614bd1478eb39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import { defineMessages, useIntl } from 'react-intl';
import { BrowserWindow } from '@electron/remote';
import InfoBar from '../../ui/InfoBar';

const messages = defineMessages({
  headline: {
    id: 'settings.supportFerdi.headline',
    defaultMessage: 'About Ferdi',
  },
  title: {
    id: 'settings.supportFerdi.title',
    defaultMessage: 'Do you like Ferdi?',
  },
  aboutIntro: {
    id: 'settings.supportFerdi.aboutIntro',
    defaultMessage:
      '<p>Ferdi is an open-source and a community-lead application.</p><p>Thanks to the people who make this possbile:</p>',
  },
  textListContributors: {
    id: 'settings.supportFerdi.textListContributors',
    defaultMessage: 'Full list of contributors',
  },
  textListContributorsHere: {
    id: 'settings.supportFerdi.textListContributorsHere',
    defaultMessage: 'here',
  },
  textVolunteers: {
    id: 'settings.supportFerdi.textVolunteers',
    defaultMessage:
      'The development of Ferdi is done by volunteers. People who use Ferdi like you. They maintain, fix, and improve Ferdi in their spare time.',
  },
  textSupportWelcome: {
    id: 'settings.supportFerdi.textSupportWelcome',
    defaultMessage:
      'Support is always welcome. You can find a list of the help we need',
  },
  textSupportWelcomeHere: {
    id: 'settings.supportFerdi.textSupportWelcomeHere',
    defaultMessage: 'here',
  },
  textExpenses: {
    id: 'settings.supportFerdi.textExpenses',
    defaultMessage:
      'While volunteers do most of the work, we still need to pay for servers and certificates. As a community, we are fully transparent on funds we collect and spend - see our',
  },
  textOpenCollective: {
    id: 'settings.supportFerdi.textOpenCollective',
    defaultMessage: 'Open Collective',
  },
  textDonation: {
    id: 'settings.supportFerdi.textDonation',
    defaultMessage:
      'If you feel like supporting Ferdi development with a donation, you can do so on both,',
  },
  textDonationAnd: {
    id: 'settings.supportFerdi.textDonationAnd',
    defaultMessage: 'and',
  },
  textGitHubSponsors: {
    id: 'settings.supportFerdi.textGitHubSponsors',
    defaultMessage: 'GitHub Sponsors',
  },
  openSurvey: {
    id: 'settings.supportFerdi.openSurvey',
    defaultMessage: 'Open survey',
  },
  bannerText: {
    id: 'settings.supportFerdi.bannerText',
    defaultMessage: 'Do you want to help us improve Ferdi?',
  },
});

const openSurveyWindow = () => {
  let win = new BrowserWindow({ width: 670, height: 400 });
  win.on('closed', () => {
    // @ts-expect-error Type 'null' is not assignable to type 'BrowserWindow'.
    win = null;
  });

  win.loadURL('https://rp28.typeform.com/to/E3phJT');
};

const SupportFerdiDashboard = () => {
  const intl = useIntl();

  const aboutIntro = intl.formatMessage(messages.aboutIntro);

  return (
    <div className="settings__main">
      <div className="settings__header">
        <span className="settings__header-item">
          {intl.formatMessage(messages.headline)}
        </span>
      </div>
      <div className="settings__body">
        <h1>{intl.formatMessage(messages.title)}</h1>
        <div>
          <p className="settings__support-badges">
            <a
              href="https://github.com/getferdi/ferdi"
              target="_blank"
              rel="noreferrer"
            >
              <img
                alt="GitHub Stars"
                src="https://img.shields.io/github/stars/getferdi/ferdi?style=social"
              />
            </a>
            <a
              href="https://twitter.com/getferdi/"
              target="_blank"
              rel="noreferrer"
            >
              <img
                alt="Twitter Follow"
                src="https://img.shields.io/twitter/follow/getferdi?label=Follow&style=social"
              />
            </a>
            <a
              href="https://opencollective.com/getferdi#section-contributors"
              target="_blank"
              rel="noreferrer"
            >
              <img
                alt="Open Collective backers"
                src="https://img.shields.io/opencollective/backers/getferdi?logo=open-collective"
              />
            </a>
            <a
              href="https://opencollective.com/getferdi#section-contributors"
              target="_blank"
              rel="noreferrer"
            >
              <img
                alt="Open Collective sponsors"
                src="https://img.shields.io/opencollective/sponsors/getferdi?logo=open-collective"
              />
            </a>
          </p>
          <span dangerouslySetInnerHTML={{ __html: aboutIntro }} />
          <br />
          <br />
          <p>
            <a href="#contributors-via-opencollective">
              <img
                alt="GitHub contributors (non-exhaustive)"
                width="100%"
                src="https://opencollective.com/getferdi/contributors.svg?width=642&button=false"
              />
            </a>
          </p>
          <p>
            {intl.formatMessage(messages.textListContributors)}
            <a
              href="https://github.com/getferdi/ferdi#contributors-"
              target="_blank"
              className="link"
              rel="noreferrer"
            >
              {' '}
              {intl.formatMessage(messages.textListContributorsHere)}
              <i className="mdi mdi-open-in-new" />
            </a>
            <br />
            <br />
          </p>
          <p>{intl.formatMessage(messages.textVolunteers)}</p>
          <p>
            {intl.formatMessage(messages.textSupportWelcome)}
            <a
              href="https://help.getferdi.com/general/support"
              target="_blank"
              className="link"
              rel="noreferrer"
            >
              {' '}
              {intl.formatMessage(messages.textSupportWelcomeHere)}
              <i className="mdi mdi-open-in-new" />
            </a>
          </p>
          <p>
            {intl.formatMessage(messages.textExpenses)}
            <a
              href="https://opencollective.com/getferdi#section-budget"
              target="_blank"
              className="link"
              rel="noreferrer"
            >
              {' '}
              {intl.formatMessage(messages.textOpenCollective)}
              <i className="mdi mdi-open-in-new" />
            </a>
          </p>
          <p>
            {intl.formatMessage(messages.textDonation)}
            <a
              href="https://opencollective.com/getferdi#section-contribute"
              target="_blank"
              className="link"
              rel="noreferrer"
            >
              {' '}
              {intl.formatMessage(messages.textOpenCollective)}
              <i className="mdi mdi-open-in-new" />
            </a>{' '}
            {intl.formatMessage(messages.textDonationAnd)}
            <a
              href="https://github.com/sponsors/getferdi"
              target="_blank"
              className="link"
              rel="noreferrer"
            >
              {' '}
              {intl.formatMessage(messages.textGitHubSponsors)}
              <i className="mdi mdi-open-in-new" />
            </a>
          </p>
        </div>
      </div>
      <InfoBar
        sticky
        type="primary"
        ctaLabel={intl.formatMessage(messages.openSurvey)}
        onClick={openSurveyWindow}
      >
        {intl.formatMessage(messages.bannerText)}
      </InfoBar>
    </div>
  );
};

export default SupportFerdiDashboard;