From b3e6dce31ef08bd9c51c6c1687d95d9844a6fb8b Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Thu, 15 Sep 2022 09:57:14 -0600 Subject: [PATCH] Capitalize --- common/util/format.ts | 4 ---- web/components/contract/contract-tabs.tsx | 3 ++- web/components/user-page.tsx | 5 +++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/common/util/format.ts b/common/util/format.ts index 9b9ee1df..4f123535 100644 --- a/common/util/format.ts +++ b/common/util/format.ts @@ -16,10 +16,6 @@ export function formatMoneyWithDecimals(amount: number) { return ENV_CONFIG.moneyMoniker + amount.toFixed(2) } -export function capitalFirst(s: string) { - return s.charAt(0).toUpperCase() + s.slice(1) -} - export function formatWithCommas(amount: number) { return formatter.format(Math.floor(amount)).replace('$', '') } diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx index 5b88e005..0796dcb2 100644 --- a/web/components/contract/contract-tabs.tsx +++ b/web/components/contract/contract-tabs.tsx @@ -18,6 +18,7 @@ import { useLiquidity } from 'web/hooks/use-liquidity' import { BetSignUpPrompt } from '../sign-up-prompt' import { PlayMoneyDisclaimer } from '../play-money-disclaimer' import BetButton from '../bet-button' +import { capitalize } from 'lodash' export function ContractTabs(props: { contract: Contract @@ -114,7 +115,7 @@ export function ContractTabs(props: { badge: `${comments.length}`, }, { - title: PAST_BETS, + title: capitalize(PAST_BETS), content: betActivity, badge: `${visibleBets.length}`, }, diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index 9dfd3491..6d7f0b2c 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -25,7 +25,7 @@ import { UserFollowButton } from './follow-button' import { GroupsButton } from 'web/components/groups/groups-button' import { PortfolioValueSection } from './portfolio/portfolio-value-section' import { ReferralsButton } from 'web/components/referrals-button' -import { capitalFirst, formatMoney } from 'common/util/format' +import { formatMoney } from 'common/util/format' import { ShareIconButton } from 'web/components/share-icon-button' import { ENV_CONFIG } from 'common/envs/constants' import { @@ -36,6 +36,7 @@ import { REFERRAL_AMOUNT } from 'common/economy' import { LoansModal } from './profile/loans-modal' import { UserLikesButton } from 'web/components/profile/user-likes-button' import { PAST_BETS } from 'common/user' +import { capitalize } from 'lodash' export function UserPage(props: { user: User }) { const { user } = props @@ -270,7 +271,7 @@ export function UserPage(props: { user: User }) { ), }, { - title: capitalFirst(PAST_BETS), + title: capitalize(PAST_BETS), content: ( <>