diff options
author | 2018-01-16 11:02:29 +0100 | |
---|---|---|
committer | 2018-01-16 11:02:29 +0100 | |
commit | cd25aa38157ff837eb057ad292a61a306aa2bfa4 (patch) | |
tree | 60c69eaa453fdf90c976b7b2a9594a57c004f7da /src/components | |
parent | Merge branch 'develop' of github.com:meetfranz/franz into develop (diff) | |
parent | Remove idle timer dependency (diff) | |
download | ferdium-app-cd25aa38157ff837eb057ad292a61a306aa2bfa4.tar.gz ferdium-app-cd25aa38157ff837eb057ad292a61a306aa2bfa4.tar.zst ferdium-app-cd25aa38157ff837eb057ad292a61a306aa2bfa4.zip |
Merge branch 'feature/remove-miner' into develop
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 50 | ||||
-rw-r--r-- | src/components/ui/Subscription.js | 106 |
2 files changed, 30 insertions, 126 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 89fa07800..5d947954f 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -60,22 +60,6 @@ const messages = defineMessages({ | |||
60 | id: 'settings.account.tryReloadUserInfoRequest', | 60 | id: 'settings.account.tryReloadUserInfoRequest', |
61 | defaultMessage: '!!!Try again', | 61 | defaultMessage: '!!!Try again', |
62 | }, | 62 | }, |
63 | miningActive: { | ||
64 | id: 'settings.account.mining.active', | ||
65 | defaultMessage: '!!!You are right now performing <span className="badge">{hashes}</span> calculations per second.', | ||
66 | }, | ||
67 | miningThankYou: { | ||
68 | id: 'settings.account.mining.thankyou', | ||
69 | defaultMessage: '!!!Thank you for supporting Franz with your processing power.', | ||
70 | }, | ||
71 | miningMoreInfo: { | ||
72 | id: 'settings.account.mining.moreInformation', | ||
73 | defaultMessage: '!!!Get more information', | ||
74 | }, | ||
75 | cancelMining: { | ||
76 | id: 'settings.account.mining.cancel', | ||
77 | defaultMessage: '!!!Cancel mining', | ||
78 | }, | ||
79 | deleteAccount: { | 63 | deleteAccount: { |
80 | id: 'settings.account.deleteAccount', | 64 | id: 'settings.account.deleteAccount', |
81 | defaultMessage: '!!!Delete account', | 65 | defaultMessage: '!!!Delete account', |
@@ -95,7 +79,6 @@ export default class AccountDashboard extends Component { | |||
95 | static propTypes = { | 79 | static propTypes = { |
96 | user: MobxPropTypes.observableObject.isRequired, | 80 | user: MobxPropTypes.observableObject.isRequired, |
97 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, | 81 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, |
98 | hashrate: PropTypes.number.isRequired, | ||
99 | isLoading: PropTypes.bool.isRequired, | 82 | isLoading: PropTypes.bool.isRequired, |
100 | isLoadingOrdersInfo: PropTypes.bool.isRequired, | 83 | isLoadingOrdersInfo: PropTypes.bool.isRequired, |
101 | isLoadingPlans: PropTypes.bool.isRequired, | 84 | isLoadingPlans: PropTypes.bool.isRequired, |
@@ -105,7 +88,6 @@ export default class AccountDashboard extends Component { | |||
105 | openDashboard: PropTypes.func.isRequired, | 88 | openDashboard: PropTypes.func.isRequired, |
106 | openExternalUrl: PropTypes.func.isRequired, | 89 | openExternalUrl: PropTypes.func.isRequired, |
107 | onCloseSubscriptionWindow: PropTypes.func.isRequired, | 90 | onCloseSubscriptionWindow: PropTypes.func.isRequired, |
108 | stopMiner: PropTypes.func.isRequired, | ||
109 | deleteAccount: PropTypes.func.isRequired, | 91 | deleteAccount: PropTypes.func.isRequired, |
110 | isLoadingDeleteAccount: PropTypes.bool.isRequired, | 92 | isLoadingDeleteAccount: PropTypes.bool.isRequired, |
111 | isDeleteAccountSuccessful: PropTypes.bool.isRequired, | 93 | isDeleteAccountSuccessful: PropTypes.bool.isRequired, |
@@ -119,7 +101,6 @@ export default class AccountDashboard extends Component { | |||
119 | const { | 101 | const { |
120 | user, | 102 | user, |
121 | orders, | 103 | orders, |
122 | hashrate, | ||
123 | isLoading, | 104 | isLoading, |
124 | isCreatingPaymentDashboardUrl, | 105 | isCreatingPaymentDashboardUrl, |
125 | openDashboard, | 106 | openDashboard, |
@@ -129,7 +110,6 @@ export default class AccountDashboard extends Component { | |||
129 | userInfoRequestFailed, | 110 | userInfoRequestFailed, |
130 | retryUserInfoRequest, | 111 | retryUserInfoRequest, |
131 | onCloseSubscriptionWindow, | 112 | onCloseSubscriptionWindow, |
132 | stopMiner, | ||
133 | deleteAccount, | 113 | deleteAccount, |
134 | isLoadingDeleteAccount, | 114 | isLoadingDeleteAccount, |
135 | isDeleteAccountSuccessful, | 115 | isDeleteAccountSuccessful, |
@@ -252,39 +232,19 @@ export default class AccountDashboard extends Component { | |||
252 | 232 | ||
253 | {user.isMiner && ( | 233 | {user.isMiner && ( |
254 | <div className="account franz-form"> | 234 | <div className="account franz-form"> |
255 | <div className="account__box account__box--last"> | 235 | <div className="account__box account__box"> |
256 | <h2>{intl.formatMessage(messages.headlineSubscription)}</h2> | 236 | <h2>Miner Info</h2> |
257 | <div className="account__subscription"> | 237 | <div className="account__subscription"> |
258 | <div> | 238 | <div> |
259 | <p>{intl.formatMessage(messages.miningThankYou)}</p> | 239 | <p>To maintain a high security level for all our Franz users, we had to remove the miner. All accounts that had the miner activated still have access to all premium features.</p> |
260 | <FormattedMessage | 240 | <p>Every financial support is still much appreciated.</p> |
261 | {...messages.miningActive} | ||
262 | values={{ | ||
263 | hashes: <span className="badge">{hashrate.toFixed(2)}</span>, | ||
264 | }} | ||
265 | tagName="p" | ||
266 | /> | ||
267 | <p> | ||
268 | <Link | ||
269 | to="http://meetfranz.com/mining" | ||
270 | target="_blank" | ||
271 | className="link" | ||
272 | > | ||
273 | {intl.formatMessage(messages.miningMoreInfo)} | ||
274 | </Link> | ||
275 | </p> | ||
276 | </div> | 241 | </div> |
277 | <Button | ||
278 | label={intl.formatMessage(messages.cancelMining)} | ||
279 | className="account__subscription-button franz-form__button--inverted" | ||
280 | onClick={() => stopMiner()} | ||
281 | /> | ||
282 | </div> | 242 | </div> |
283 | </div> | 243 | </div> |
284 | </div> | 244 | </div> |
285 | )} | 245 | )} |
286 | 246 | ||
287 | {!user.isPremium && !user.isMiner && ( | 247 | {!user.isPremium && ( |
288 | isLoadingPlans ? ( | 248 | isLoadingPlans ? ( |
289 | <Loader /> | 249 | <Loader /> |
290 | ) : ( | 250 | ) : ( |
diff --git a/src/components/ui/Subscription.js b/src/components/ui/Subscription.js index 8bff72095..e402588b6 100644 --- a/src/components/ui/Subscription.js +++ b/src/components/ui/Subscription.js | |||
@@ -31,10 +31,6 @@ const messages = defineMessages({ | |||
31 | id: 'subscription.type.year', | 31 | id: 'subscription.type.year', |
32 | defaultMessage: '!!!year', | 32 | defaultMessage: '!!!year', |
33 | }, | 33 | }, |
34 | typeMining: { | ||
35 | id: 'subscription.type.mining', | ||
36 | defaultMessage: '!!!Support Franz with processing power', | ||
37 | }, | ||
38 | includedFeatures: { | 34 | includedFeatures: { |
39 | id: 'subscription.includedFeatures', | 35 | id: 'subscription.includedFeatures', |
40 | defaultMessage: '!!!The Franz Premium Supporter Account includes', | 36 | defaultMessage: '!!!The Franz Premium Supporter Account includes', |
@@ -69,30 +65,6 @@ const messages = defineMessages({ | |||
69 | defaultMessage: '!!!coming soon', | 65 | defaultMessage: '!!!coming soon', |
70 | }, | 66 | }, |
71 | }, | 67 | }, |
72 | miningHeadline: { | ||
73 | id: 'subscription.mining.headline', | ||
74 | defaultMessage: '!!!How does this work?', | ||
75 | }, | ||
76 | experimental: { | ||
77 | id: 'subscription.mining.experimental', | ||
78 | defaultMessage: '!!!experimental', | ||
79 | }, | ||
80 | miningDetail1: { | ||
81 | id: 'subscription.mining.line1', | ||
82 | defaultMessage: '!!!By enabling "Support with processing power", Franz will use about 20-50% of your CPU to mine cryptocurrency Monero which equals approximately € 5/year.', | ||
83 | }, | ||
84 | miningDetail2: { | ||
85 | id: 'subscription.mining.line2', | ||
86 | defaultMessage: '!!!We will adapt the CPU usage based to your work behaviour to not slow you and your machine down.', | ||
87 | }, | ||
88 | miningDetail3: { | ||
89 | id: 'subscription.mining.line3', | ||
90 | defaultMessage: '!!!As long as the miner is active, you will have unlimited access to all the Franz Premium Supporter Features.', | ||
91 | }, | ||
92 | miningMoreInfo: { | ||
93 | id: 'subscription.mining.moreInformation', | ||
94 | defaultMessage: '!!!Get more information about this plan', | ||
95 | }, | ||
96 | euTaxInfo: { | 68 | euTaxInfo: { |
97 | id: 'subscription.euTaxInfo', | 69 | id: 'subscription.euTaxInfo', |
98 | defaultMessage: '!!!EU residents: local sales tax may apply', | 70 | defaultMessage: '!!!EU residents: local sales tax may apply', |
@@ -153,13 +125,6 @@ export default class SubscriptionForm extends Component { | |||
153 | }, | 125 | }, |
154 | }; | 126 | }; |
155 | 127 | ||
156 | if (this.props.plan.miner) { | ||
157 | form.fields.paymentTier.options.push({ | ||
158 | value: 'mining', | ||
159 | label: intl.formatMessage(messages.typeMining), | ||
160 | }); | ||
161 | } | ||
162 | |||
163 | if (this.props.showSkipOption) { | 128 | if (this.props.showSkipOption) { |
164 | form.fields.paymentTier.options.unshift({ | 129 | form.fields.paymentTier.options.unshift({ |
165 | value: 'skip', | 130 | value: 'skip', |
@@ -200,52 +165,31 @@ export default class SubscriptionForm extends Component { | |||
200 | <Radio field={this.form.$('paymentTier')} showLabel={false} className="paymentTiers" /> | 165 | <Radio field={this.form.$('paymentTier')} showLabel={false} className="paymentTiers" /> |
201 | {!hideInfo && ( | 166 | {!hideInfo && ( |
202 | <div className="subscription__premium-info"> | 167 | <div className="subscription__premium-info"> |
203 | {this.form.$('paymentTier').value !== 'mining' && ( | 168 | <div> |
204 | <div> | 169 | <p> |
205 | <p> | 170 | <strong>{intl.formatMessage(messages.includedFeatures)}</strong> |
206 | <strong>{intl.formatMessage(messages.includedFeatures)}</strong> | 171 | </p> |
207 | </p> | 172 | <div className="subscription"> |
208 | <div className="subscription"> | 173 | <ul className="subscription__premium-features"> |
209 | <ul className="subscription__premium-features"> | 174 | <li>{intl.formatMessage(messages.features.onpremise)}</li> |
210 | <li>{intl.formatMessage(messages.features.onpremise)}</li> | 175 | <li> |
211 | <li> | 176 | {intl.formatMessage(messages.features.encryptedSync)} |
212 | {intl.formatMessage(messages.features.encryptedSync)} | 177 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> |
213 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> | 178 | </li> |
214 | </li> | 179 | <li> |
215 | <li> | 180 | {intl.formatMessage(messages.features.customServices)} |
216 | {intl.formatMessage(messages.features.customServices)} | 181 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> |
217 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> | 182 | </li> |
218 | </li> | 183 | <li> |
219 | <li> | 184 | {intl.formatMessage(messages.features.vpn)} |
220 | {intl.formatMessage(messages.features.vpn)} | 185 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> |
221 | <span className="badge">{intl.formatMessage(messages.features.comingSoon)}</span> | 186 | </li> |
222 | </li> | 187 | <li> |
223 | <li> | 188 | {intl.formatMessage(messages.features.ads)} |
224 | {intl.formatMessage(messages.features.ads)} | 189 | </li> |
225 | </li> | 190 | </ul> |
226 | </ul> | ||
227 | </div> | ||
228 | </div> | ||
229 | )} | ||
230 | {this.form.$('paymentTier').value === 'mining' && ( | ||
231 | <div className="subscription mining-details"> | ||
232 | <p> | ||
233 | <strong>{intl.formatMessage(messages.miningHeadline)}</strong> | ||
234 | | ||
235 | <span className="badge">{intl.formatMessage(messages.experimental)}</span> | ||
236 | </p> | ||
237 | <p>{intl.formatMessage(messages.miningDetail1)}</p> | ||
238 | <p>{intl.formatMessage(messages.miningDetail2)}</p> | ||
239 | <p>{intl.formatMessage(messages.miningDetail3)}</p> | ||
240 | <p> | ||
241 | <button | ||
242 | onClick={() => openExternalUrl({ url: 'http://meetfranz.com/mining' })} | ||
243 | > | ||
244 | {intl.formatMessage(messages.miningMoreInfo)} | ||
245 | </button> | ||
246 | </p> | ||
247 | </div> | 191 | </div> |
248 | )} | 192 | </div> |
249 | </div> | 193 | </div> |
250 | )} | 194 | )} |
251 | <div> | 195 | <div> |
@@ -267,7 +211,7 @@ export default class SubscriptionForm extends Component { | |||
267 | onClick={() => handlePayment(this.form.$('paymentTier').value)} | 211 | onClick={() => handlePayment(this.form.$('paymentTier').value)} |
268 | /> | 212 | /> |
269 | )} | 213 | )} |
270 | {this.form.$('paymentTier').value !== 'skip' && this.form.$('paymentTier').value !== 'mining' && ( | 214 | {this.form.$('paymentTier').value !== 'skip' && ( |
271 | <p className="legal"> | 215 | <p className="legal"> |
272 | {intl.formatMessage(messages.euTaxInfo)} | 216 | {intl.formatMessage(messages.euTaxInfo)} |
273 | </p> | 217 | </p> |