From bd973289b60f0dc29ca829ddeec1dcbdaab9b15f Mon Sep 17 00:00:00 2001
From: jessopb <36554050+jessopb@users.noreply.github.com>
Date: Tue, 17 Aug 2021 18:34:16 -0400
Subject: [PATCH 1/4] Chore desktop cleanup (#6896)
* some desktop cleanup
* stripe environment
* wallet tabs
* fix
* old copy
* copy
* getClaimTypeText
* appstrings
---
.env.defaults | 2 +-
static/app-strings.json | 3 +
ui/component/commentCreate/view.jsx | 35 ++--
.../walletFiatPaymentHistory/view.jsx | 103 ++++-----
ui/component/walletSendTip/view.jsx | 176 +++++++++-------
ui/component/walletTipAmountSelector/view.jsx | 88 ++++----
ui/constants/stripe.js | 2 +
ui/modal/modalRemoveCard/view.jsx | 43 +---
ui/page/file/view.jsx | 5 -
ui/page/settings/view.jsx | 5 +-
ui/page/settingsStripeAccount/view.jsx | 65 +++---
ui/page/settingsStripeCard/view.jsx | 197 +++++++++---------
ui/page/show/view.jsx | 4 +-
ui/page/wallet/view.jsx | 171 +++++++--------
ui/util/stripe.js | 13 ++
15 files changed, 464 insertions(+), 448 deletions(-)
create mode 100644 ui/constants/stripe.js
create mode 100644 ui/util/stripe.js
diff --git a/.env.defaults b/.env.defaults
index bfeb12fff..5274f8c68 100644
--- a/.env.defaults
+++ b/.env.defaults
@@ -19,7 +19,7 @@ THUMBNAIL_CDN_URL=https://image-processor.vanwanet.com/optimize/
WELCOME_VERSION=1.0
# STRIPE
-STRIPE_PUBLIC_KEY='pk_test_NoL1JWL7i1ipfhVId5KfDZgo'
+# STRIPE_PUBLIC_KEY='pk_test_NoL1JWL7i1ipfhVId5KfDZgo'
# Analytics
MATOMO_URL=https://analytics.lbry.com/
diff --git a/static/app-strings.json b/static/app-strings.json
index e5f45808b..a7e83a936 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -2090,5 +2090,8 @@
"Expand Comments": "Expand Comments",
"Expand": "Expand",
"Load More": "Load More",
+ "Collection": "Collection",
+ "%channelName% isn't live right now, but the chat is! Check back later to watch the stream.": "%channelName% isn't live right now, but the chat is! Check back later to watch the stream.",
+ "Review": "Review",
"--end--": "--end--"
}
diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx
index 008a28aa1..63e77a026 100644
--- a/ui/component/commentCreate/view.jsx
+++ b/ui/component/commentCreate/view.jsx
@@ -1,6 +1,6 @@
// @flow
import type { ElementRef } from 'react';
-import { SIMPLE_SITE, STRIPE_PUBLIC_KEY } from 'config';
+import { SIMPLE_SITE } from 'config';
import * as PAGES from 'constants/pages';
import * as ICONS from 'constants/icons';
import React from 'react';
@@ -21,12 +21,8 @@ import Empty from 'component/common/empty';
import { getChannelIdFromClaim } from 'util/claim';
import { Lbryio } from 'lbryinc';
-let stripeEnvironment = 'test';
-// if the key contains pk_live it's a live key
-// update the environment for the calls to the backend to indicate which environment to hit
-if (STRIPE_PUBLIC_KEY.indexOf('pk_live') > -1) {
- stripeEnvironment = 'live';
-}
+import { getStripeEnvironment } from 'util/stripe';
+let stripeEnvironment = getStripeEnvironment();
const TAB_FIAT = 'TabFiat';
const TAB_LBC = 'TabLBC';
@@ -245,10 +241,13 @@ export function CommentCreate(props: Props) {
}, 1500);
doToast({
- message: __("You sent %tipAmount% LBRY Credits as a tip to %tipChannelName%, I'm sure they appreciate it!", {
- tipAmount: tipAmount, // force show decimal places
- tipChannelName,
- }),
+ message: __(
+ "You sent %tipAmount% LBRY Credits as a tip to %tipChannelName%, I'm sure they appreciate it!",
+ {
+ tipAmount: tipAmount, // force show decimal places
+ tipChannelName,
+ }
+ ),
});
setSuccessTip({ txid, tipAmount });
@@ -265,7 +264,8 @@ export function CommentCreate(props: Props) {
Lbryio.call(
'customer',
'tip',
- { // round to deal with floating point precision
+ {
+ // round to deal with floating point precision
amount: Math.round(100 * roundedAmount), // convert from dollars to cents
creator_channel_name: tipChannelName, // creator_channel_name
creator_channel_claim_id: channelClaimId,
@@ -387,12 +387,7 @@ export function CommentCreate(props: Props) {
}
}}
>
-
+
@@ -534,7 +529,8 @@ export function CommentCreate(props: Props) {
}}
/>
)}
- {!claimIsMine && (
+ {/* @if TARGET='web' */}
+ {!claimIsMine && stripeEnvironment && (
)}
+ {/* @endif */}
{isReply && !minTip && (