Skip to content

Commit

Permalink
Replace 'Monthly Contributions' language with 'Monthly Tips'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarolin committed Mar 2, 2022
1 parent 7e88085 commit fb108dc
Show file tree
Hide file tree
Showing 24 changed files with 104 additions and 108 deletions.
8 changes: 4 additions & 4 deletions .storybook/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ let locale: Record<string, string> = {
dndCaptchaText2: 'target',
donation: 'Donation',
donationAmount: 'Donation amount',
donateMonthly: 'Monthly Contribution',
donateMonthly: 'Monthly Tip',
donateNow: 'Send a tip…',
donationFailureMsg: 'Looks like something went wrong. Please try again later.',
donationSent: 'Donation Sent!',
Expand Down Expand Up @@ -126,10 +126,10 @@ let locale: Record<string, string> = {
monthNov: 'November',
monthOct: 'October',
monthSep: 'September',
monthlyContribution: 'Monthly Contribution',
monthlyContributions: 'Monthly Contributions',
monthlyText: 'Monthly',
monthlyTips: 'Monthly Tips!',
monthlyTip: 'Monthly Tip',
monthlyTips: 'Monthly Tips',
monthlyTipsBang: 'Monthly Tips!',
newGrant: 'A free token grant is available.',
nextContribution: 'Next Contribution',
noActivity: 'No activities yet…',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,18 +1373,17 @@ public void OnRecurringDonationUpdated() {

private void updateMonthlyContributionUI() {
String pubId = mBraveRewardsNativeWorker.GetPublisherId(mCurrentTabId);
TextView monthlyContributionText =
mPopupView.findViewById(R.id.monthly_contribution_set_text);
TextView monthlyTipText = mPopupView.findViewById(R.id.monthly_contribution_set_text);
double recurrentAmount =
mBraveRewardsNativeWorker.GetPublisherRecurrentDonationAmount(pubId);
if (mBraveRewardsNativeWorker.IsCurrentPublisherInRecurrentDonations(pubId)) {
monthlyContributionText.setText(String.format(
monthlyTipText.setText(String.format(
mPopupView.getResources().getString(R.string.brave_rewards_bat_value_text),
(int) recurrentAmount));
monthlyContributionText.setCompoundDrawablesWithIntrinsicBounds(
monthlyTipText.setCompoundDrawablesWithIntrinsicBounds(
0, 0, R.drawable.ic_carat_down, 0);
}
monthlyContributionText.setOnClickListener(new View.OnClickListener() {
monthlyTipText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!mBraveRewardsNativeWorker.IsCurrentPublisherInRecurrentDonations(pubId)) {
Expand All @@ -1401,10 +1400,9 @@ public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.change_amount_menu_id) {
openBannerActivity();
} else {
monthlyContributionText.setText(
monthlyTipText.setText(
mPopupView.getResources().getString(R.string.set));
monthlyContributionText.setCompoundDrawablesWithIntrinsicBounds(
0, 0, 0, 0);
monthlyTipText.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
mBraveRewardsNativeWorker.RemoveRecurring(pubId);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion android/java/res/layout/brave_rewards_panel_tip_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:fontFamily="@font/poppins_regular"
android:text="@string/monthly_contribution"
android:text="@string/monthly_tip"
android:textColor="@color/rewards_panel_secondary_text_color"
android:textSize="16sp" />

Expand Down
6 changes: 3 additions & 3 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -2776,8 +2776,8 @@ If you don't accept this request, VPN will not reconnect and your internet conne
<message name="IDS_UNVERIFIED_CREATOR" desc="Brave rewards panel text">
Unverified Creator
</message>
<message name="IDS_MONTHLY_CONTRIBUTION" desc="Title text for `Monthly contribution` section in Brave rewards panel">
Monthly contribution
<message name="IDS_MONTHLY_TIP" desc="Title text for `Monthly tip` section in Brave rewards panel">
Monthly tip
</message>
<message name="IDS_BAT_TEXT" desc="Brave rewards panel text" translateable="false">
BAT
Expand Down Expand Up @@ -2866,7 +2866,7 @@ If you don't accept this request, VPN will not reconnect and your internet conne
<message name="IDS_BRAVE_WALLET_NETWORK_ACTIVITY_TITLE" desc="Network activity toolbar title">
Select Network
</message>
<message name="IDS_CHANGE_AMOUNT" desc="Brave rewards monthly contribution text">
<message name="IDS_CHANGE_AMOUNT" desc="Brave rewards monthly tip text">
Change amount
</message>
<message name="IDS_ACCESSIBILITY_NEW_TAB_PAGE" desc="Accessibility text to read aloud when the user focuses the new tab view.">
Expand Down
24 changes: 12 additions & 12 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,16 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "donationDesc", IDS_BRAVE_REWARDS_LOCAL_DONAT_DESC },
{ "donationDescLearnMore", IDS_BRAVE_REWARDS_LOCAL_DONAT_DESC_LEARN_MORE }, // NOLINT
{ "donationTotalDonations", IDS_BRAVE_REWARDS_LOCAL_DONAT_TOTAL_DONATIONS }, // NOLINT
{ "donationTotalMonthlyContribution", IDS_BRAVE_REWARDS_LOCAL_DONAT_TOTAL_MONTHLY_CONTRIBUTION }, // NOLINT
{ "donationTotalMonthlyTips", IDS_BRAVE_REWARDS_LOCAL_DONAT_TOTAL_MONTHLY_TIPS }, // NOLINT
{ "donationVisitSome", IDS_BRAVE_REWARDS_LOCAL_DONAT_VISIT_SOME },
{ "donationAbility", IDS_BRAVE_REWARDS_LOCAL_DONAT_ABILITY },
{ "donationAbilityReddit", IDS_BRAVE_REWARDS_LOCAL_DONAT_ABILITY_REDT},
{ "donationAbilityTwitter", IDS_BRAVE_REWARDS_LOCAL_DONAT_ABILITY_TW },
{ "donationAbilityGitHub", IDS_BRAVE_REWARDS_LOCAL_DONAT_ABILITY_GH },
{ "donationNextDate", IDS_BRAVE_REWARDS_LOCAL_DONAT_NEXT_DATE },
{ "monthlyContributionTitle", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_CONTRIBUTION_TITLE }, // NOLINT
{ "monthlyContributionDesc", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_CONTRIBUTION_DESC }, // NOLINT
{ "monthlyContributionEmpty", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_CONTRIBUTION_EMPTY }, // NOLINT
{ "monthlyTipsTitle", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_TIPS_TITLE },
{ "monthlyTipsDesc", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_TIPS_DESC },
{ "monthlyTipsEmpty", IDS_BRAVE_REWARDS_LOCAL_MONTHLY_TIPS_EMPTY },
{ "walletRecoveryFail", IDS_BRAVE_REWARDS_LOCAL_WALLET_RECOVERY_FAIL }, // NOLINT
{ "walletRecoveryOutdated", IDS_BRAVE_REWARDS_LOCAL_WALLET_RECOVERY_OUTDATED }, // NOLINT
{ "redirectModalError", IDS_BRAVE_REWARDS_LOCAL_REDIRECT_MODAL_ERROR },
Expand Down Expand Up @@ -591,8 +591,8 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "manageWallet", IDS_BRAVE_UI_MANAGE_WALLET },
{ "markAsInappropriate", IDS_BRAVE_UI_ADS_MARK_AS_INAPPROPRIATE },
{ "markAsInappropriateChecked", IDS_BRAVE_UI_ADS_MARK_AS_INAPPROPRIATE_CHECKED }, // NOLINT
{ "monthlyTipsBang", IDS_BRAVE_UI_MONTHLY_TIPS_BANG },
{ "monthlyTips", IDS_BRAVE_UI_MONTHLY_TIPS },
{ "monthlyContributions", IDS_BRAVE_UI_MONTHLY_CONTRIBUTIONS },
{ "noActivity", IDS_BRAVE_UI_NO_ACTIVITY },
{ "noAdsHistory", IDS_BRAVE_UI_ADS_NO_ADS_HISTORY },
{ "off", IDS_BRAVE_UI_OFF },
Expand Down Expand Up @@ -848,14 +848,14 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "batFunds", IDS_BRAVE_REWARDS_TIP_BAT_FUNDS },
{ "cancel", IDS_BRAVE_REWARDS_TIP_CANCEL },
{ "cancelConfirmationText", IDS_BRAVE_REWARDS_TIP_CANCEL_CONFIRMATION_TEXT }, // NOLINT
{ "cancelMonthlyContribution", IDS_BRAVE_REWARDS_TIP_CANCEL_MONTHLY_CONTRIBUTION }, // NOLINT
{ "cancelMonthlyTip", IDS_BRAVE_REWARDS_TIP_CANCEL_MONTHLY_TIP },
{ "changeAmount", IDS_BRAVE_REWARDS_TIP_CHANGE_AMOUNT },
{ "confirmCancel", IDS_BRAVE_REWARDS_TIP_CONFIRM_CANCEL },
{ "continue", IDS_BRAVE_REWARDS_TIP_CONTINUE },
{ "contributionAmount", IDS_BRAVE_REWARDS_TIP_CONTRIBUTION_AMOUNT }, // NOLINT
{ "contributionCanceled", IDS_BRAVE_REWARDS_TIP_CONTRIBUTION_CANCELED }, // NOLINT
{ "tipAmount", IDS_BRAVE_REWARDS_TIP_TIP_AMOUNT },
{ "tipCanceled", IDS_BRAVE_REWARDS_TIP_TIP_CANCELED },
{ "currentlySupporting", IDS_BRAVE_REWARDS_TIP_CURRENTLY_SUPPORTING },
{ "currentMonthlyContribution", IDS_BRAVE_REWARDS_TIP_CURRENT_MONTHLY_CONTRIBUTION }, // NOLINT
{ "currentMonthlyTip", IDS_BRAVE_REWARDS_TIP_CURRENT_MONTHLY_TIP },
{ "customAmount", IDS_BRAVE_REWARDS_TIP_CUSTOM_AMOUNT },
{ "customMonthlyTipText", IDS_BRAVE_REWARDS_TIP_CUSTOM_MONTHLY_TIP_TEXT }, // NOLINT
{ "customTipAmount", IDS_BRAVE_REWARDS_TIP_CUSTOM_TIP_AMOUNT },
Expand All @@ -867,10 +867,10 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "errorTryAgain", IDS_BRAVE_REWARDS_TIP_ERROR_TRY_AGAIN },
{ "exampleTipAmount", IDS_BRAVE_REWARDS_TIP_EXAMPLE_TIP_AMOUNT },
{ "minimumTipAmount", IDS_BRAVE_REWARDS_TIP_MINIMUM_TIP_AMOUNT },
{ "monthlyContribution", IDS_BRAVE_UI_MONTHLY_CONTRIBUTION },
{ "monthlyContributionSet", IDS_BRAVE_REWARDS_TIP_MONTHLY_CONTRIBUTION_SET }, // NOLINT
{ "monthlyTip", IDS_BRAVE_UI_MONTHLY_TIP },
{ "monthlyTipSet", IDS_BRAVE_REWARDS_TIP_MONTHLY_TIP_SET },
{ "monthlyText", IDS_BRAVE_UI_MONTHLY_TEXT },
{ "nextContributionDate", IDS_BRAVE_REWARDS_TIP_NEXT_CONTRIBUTION_DATE }, // NOLINT
{ "nextTipDate", IDS_BRAVE_REWARDS_TIP_NEXT_TIP_DATE },
{ "notEnoughTokens", IDS_BRAVE_REWARDS_TIP_NOT_ENOUGH_TOKENS },
{ "tippingFeeNote", IDS_BRAVE_REWARDS_TIPPING_FEE_NOTE },
{ "on", IDS_BRAVE_UI_ON },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,7 @@ IN_PROC_BROWSER_TEST_F(
rewards_browsertest_util::TipAction::ChangeMonthly);

rewards_browsertest_util::WaitForElementToContain(
banner.get(), "[data-test-id=form-submit-button]",
"Set monthly contribution");
banner.get(), "[data-test-id=form-submit-button]", "Set monthly tip");

// Verify "Cancel" opens cancel confirmation form
banner = context_helper_->OpenSiteBanner(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface State {
modalShowAll: boolean
}

class MonthlyContributionBox extends React.Component<Props, State> {
class MonthlyTipsBox extends React.Component<Props, State> {
constructor (props: Props) {
super(props)
this.state = {
Expand Down Expand Up @@ -101,19 +101,19 @@ class MonthlyContributionBox extends React.Component<Props, State> {
<BoxMobile
checked={true}
type={'donation'}
title={getLocale('monthlyContributionTitle')}
description={getLocale('monthlyContributionDesc')}
title={getLocale('monthlyTipsTitle')}
description={getLocale('monthlyTipsDesc')}
>
{
this.state.modalShowAll
? <ModalDonation
rows={tipRows}
onClose={this.onModalToggle}
title={getLocale('monthlyContributionTitle')}
title={getLocale('monthlyTipsTitle')}
/>
: null
}
<List title={<StyledListContent>{getLocale('donationTotalMonthlyContribution')}</StyledListContent>}>
<List title={<StyledListContent>{getLocale('donationTotalMonthlyTips')}</StyledListContent>}>
<StyledTotalContent>
<Tokens value={total.toFixed(3)} converted={converted} />
</StyledTotalContent>
Expand All @@ -133,7 +133,7 @@ class MonthlyContributionBox extends React.Component<Props, State> {
headerColor={true}
onShowAll={this.onModalToggle}
>
{getLocale('monthlyContributionEmpty')}
{getLocale('monthlyTipsEmpty')}
</TableDonation>
</StyledListContent>
</BoxMobile>
Expand All @@ -152,4 +152,4 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
export default connect(
mapStateToProps,
mapDispatchToProps
)(MonthlyContributionBox)
)(MonthlyTipsBox)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import PageWallet from './pageWallet'
import AdsBox from './adsBox'
import ContributeBox from './contributeBox'
import TipBox from './tipsBox'
import MonthlyContributionBox from './monthlyContributionBox'
import MonthlyTipsBox from './monthlyTipsBox'

// Utils
import * as rewardsActions from '../actions/rewards_actions'
Expand Down Expand Up @@ -372,8 +372,8 @@ class SettingsPage extends React.Component<Props, State> {
<MainToggleMobile />
<AdsBox />
<ContributeBox />
<MonthlyContributionBox />
<TipBox />
<MonthlyTipsBox />
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"message": "Include in Auto-Contribute",
"description": ""
},
"monthlyContribution": {
"message": "Monthly Contribution",
"monthlyTip": {
"message": "Monthly Tip",
"description": ""
},
"ok": {
Expand Down Expand Up @@ -372,23 +372,23 @@
}
},
"notificationInsufficientFundsText": {
"message": "Your scheduled monthly payment for Auto-Contribute and monthly contributions could not be completed due to insufficient funds. We’ll try again in 30 days.",
"message": "Your scheduled monthly payment for Auto-Contribute and monthly tips could not be completed due to insufficient funds. We’ll try again in 30 days.",
"description": ""
},
"notificationMonthlyContributionFailedText": {
"message": "There was a problem processing your contribution.",
"description": ""
},
"notificationMonthlyContributionFailedTitle": {
"message": "Monthly contribution failed",
"message": "Monthly tip failed",
"description": ""
},
"notificationMonthlyTipCompletedTitle": {
"message": "Contributions and tips",
"description": ""
},
"notificationMonthlyTipCompletedText": {
"message": "Your monthly contributions have been processed.",
"message": "Your monthly tips have been processed.",
"description": ""
},
"notificationPublisherVerifiedTitle": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface State {
modalShowAll: boolean
}

class MonthlyContributionBox extends React.Component<Props, State> {
class MonthlyTipsBox extends React.Component<Props, State> {
constructor (props: Props) {
super(props)
this.state = {
Expand Down Expand Up @@ -96,19 +96,19 @@ class MonthlyContributionBox extends React.Component<Props, State> {
return (
<Box
type={'donation'}
title={getLocale('monthlyContributionTitle')}
description={getLocale('monthlyContributionDesc')}
title={getLocale('monthlyTipsTitle')}
description={getLocale('monthlyTipsDesc')}
>
{
this.state.modalShowAll
? <ModalDonation
rows={tipRows}
onClose={this.onModalToggle}
title={getLocale('monthlyContributionTitle')}
title={getLocale('monthlyTipsTitle')}
/>
: null
}
<List title={getLocale('donationTotalMonthlyContribution')}>
<List title={getLocale('donationTotalMonthlyTips')}>
<Tokens value={total.toFixed(3)} converted={converted} />
</List>
<List title={getLocale('donationNextDate')}>
Expand All @@ -124,7 +124,7 @@ class MonthlyContributionBox extends React.Component<Props, State> {
headerColor={true}
onShowAll={this.onModalToggle}
>
{getLocale('monthlyContributionEmpty')}
{getLocale('monthlyTipsEmpty')}
</TableDonation>
</Box>
)
Expand All @@ -142,4 +142,4 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
export default connect(
mapStateToProps,
mapDispatchToProps
)(MonthlyContributionBox)
)(MonthlyTipsBox)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import PageWallet from './pageWallet'
import AdsBox from './adsBox'
import ContributeBox from './contributeBox'
import TipBox from './tipsBox'
import MonthlyContributionBox from './monthlyContributionBox'
import MonthlyTipsBox from './monthlyTipsBox'
import { SettingsOptInForm, RewardsTourModal, RewardsTourPromo } from '../../shared/components/onboarding'
import { TourPromoWrapper } from './style'

Expand Down Expand Up @@ -477,8 +477,8 @@ class SettingsPage extends React.Component<Props, State> {
/>
<AdsBox />
<ContributeBox />
<MonthlyContributionBox />
<TipBox />
<MonthlyTipsBox />
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export function MonthlyTipView (props: Props) {
const { getString } = React.useContext(LocaleContext)
const [showActions, setShowActions] = React.useState(false)

const { monthlyContribution } = props.publisherInfo
const { monthlyTip } = props.publisherInfo

if (monthlyContribution <= 0) {
if (monthlyTip <= 0) {
return (
<style.root>
<style.setBox>
Expand Down Expand Up @@ -51,7 +51,7 @@ export function MonthlyTipView (props: Props) {
data-test-id='monthly-tip-actions-button'
>
<TokenAmount
amount={monthlyContribution}
amount={monthlyTip}
minimumFractionDigits={0}
/> <CaretIcon direction='down' />
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const autoContribution = styled.div`
}
`

export const monthlyContribution = styled.div`
export const monthlyTip = styled.div`
margin-top: 4px;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ export function PublisherCard () {
</div>
</style.autoContribution>
}
<style.monthlyContribution>
<div>{getString('monthlyContribution')}</div>
<style.monthlyTip>
<div>{getString('monthlyTip')}</div>
<div>
<MonthlyTipView
publisherInfo={publisherInfo}
onUpdateClick={monthlyTipHandler('update')}
onCancelClick={monthlyTipHandler('cancel')}
/>
</div>
</style.monthlyContribution>
</style.monthlyTip>
</style.contribution>
<style.tipAction>
<button data-test-id='tip-button' onClick={host.sendTip}>
Expand Down
Loading

0 comments on commit fb108dc

Please sign in to comment.