Skip to content

Commit

Permalink
rename redeem to cash out
Browse files Browse the repository at this point in the history
  • Loading branch information
wraeth-eth committed Jan 15, 2025
1 parent 6a21f12 commit 949fc2b
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 38 deletions.
42 changes: 42 additions & 0 deletions src/locales/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ msgstr ""
msgid "The portion this recipient will receive out of the {reservedRate}% of the project's reserved token issuance."
msgstr ""

msgid "Cash out your tokens for a portion of this project's treasury"
msgstr ""

msgid "Reserved rate:"
msgstr ""

Expand Down Expand Up @@ -458,6 +461,9 @@ msgstr ""
msgid "Project Details"
msgstr ""

msgid "No ETH can be paid out from the project. The ETH can only be accessed by token holders that cash out their tokens."
msgstr ""

msgid "This account hasn't contributed to any projects yet."
msgstr ""

Expand Down Expand Up @@ -869,6 +875,9 @@ msgstr ""
msgid "How SharkDAO raised over 1,000 ETH to buy 6 Nouns NFTs and become the largest sub-DAO of Nouns DAO"
msgstr ""

msgid "Cash out {tokenTicker}"
msgstr ""

msgid "USD value of ETH received"
msgstr ""

Expand Down Expand Up @@ -1337,6 +1346,9 @@ msgstr ""
msgid "Payments"
msgstr ""

msgid "Cash out your tokens to reclaim some ETH that isn't needed for payouts. This cycle's <0>redemption rate</0> determines the amount of ETH you'll receive."
msgstr ""

msgid "Juicebox Project"
msgstr ""

Expand Down Expand Up @@ -1373,6 +1385,9 @@ msgstr ""
msgid "Transfer ETH to this project"
msgstr ""

msgid "When people pay your project, they receive its tokens. Project tokens can be used for governance or community access, and token holders can cash out their tokens to reclaim some ETH from your project. You can also reserve some tokens for recipients of your choosing."
msgstr ""

msgid "Using a duration is recommended. Without one, you can edit your cycle at any time, which may appear risky."
msgstr ""

Expand Down Expand Up @@ -1634,6 +1649,9 @@ msgstr ""
msgid "Juicebox project"
msgstr ""

msgid "Connect wallet to cash out"
msgstr ""

msgid "No upcoming cycle"
msgstr ""

Expand Down Expand Up @@ -1697,9 +1715,15 @@ msgstr ""
msgid "Edited"
msgstr ""

msgid "Cash out tokens for a portion of this project's treasury"
msgstr ""

msgid "Send {tokensText}"
msgstr ""

msgid "You cash out"
msgstr ""

msgid "Not set"
msgstr ""

Expand Down Expand Up @@ -2204,6 +2228,9 @@ msgstr ""
msgid "Controller migration"
msgstr ""

msgid "You can cash out your {tokenTextLong} for ETH without claiming them. You can transfer your unclaimed {tokenTextLong} to another address from the Tools menu, which can be accessed from the wrench icon in the upper right-hand corner of this project."
msgstr ""

msgid "JBX membership fee ({0}%):"
msgstr ""

Expand Down Expand Up @@ -2966,6 +2993,9 @@ msgstr ""
msgid "Download project activity CSVs"
msgstr ""

msgid "Cash out"
msgstr ""

msgid "Cycle duration"
msgstr ""

Expand Down Expand Up @@ -3233,6 +3263,9 @@ msgstr ""
msgid "Juicebox is built for the people, by the people."
msgstr ""

msgid "Cash out tokens"
msgstr ""

msgid "Sent payouts"
msgstr ""

Expand Down Expand Up @@ -3542,6 +3575,9 @@ msgstr ""
msgid "NFTs, tokens and rewards will be sent to <0/>"
msgstr ""

msgid "Cash out {tokensTextLong} for ETH"
msgstr ""

msgid "See the code"
msgstr ""

Expand Down Expand Up @@ -3935,6 +3971,9 @@ msgstr ""
msgid "payout"
msgstr ""

msgid "Tokens to cash out"
msgstr ""

msgid "Cycle"
msgstr ""

Expand Down Expand Up @@ -4274,6 +4313,9 @@ msgstr ""
msgid "Allow Controller migration"
msgstr ""

msgid "No tokens to cash out."
msgstr ""

msgid "Turn on unlimited payouts, and convert all your payout amounts to percentages."
msgstr ""

Expand Down
21 changes: 9 additions & 12 deletions src/packages/v4/components/Create/Create.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import {
DEADLINE_EXPLANATION,
RULESET_EXPLANATION
} from 'components/strings'
import { Trans, t } from '@lingui/macro'
import { DEADLINE_EXPLANATION, RULESET_EXPLANATION } from 'components/strings'

import { Badge } from 'components/Badge'
import { CreateBadge } from './components/CreateBadge'
import { DeployProjectButtonText } from './DeployProjectButtonText'
import { DeploySuccess } from './components/pages/ReviewDeploy/components/DeploySuccess'
import { FundingCyclesPage } from './components/pages/FundingCycles/FundingCyclesPage'
import Loading from 'components/Loading'
import { readNetwork } from 'constants/networks'
import { NetworkName } from 'models/networkName'
import { useRouter } from 'next/router'
import { CreateBadge } from './components/CreateBadge'
import { FundingCyclesPage } from './components/pages/FundingCycles/FundingCyclesPage'
import { NftRewardsPage } from './components/pages/NftRewards/NftRewardsPage'
import { PayoutsPage } from './components/pages/PayoutsPage/PayoutsPage'
import { ProjectDetailsPage } from './components/pages/ProjectDetails/ProjectDetailsPage'
import { ProjectTokenPage } from './components/pages/ProjectToken/ProjectTokenPage'
import { ReconfigurationRulesPage } from './components/pages/ReconfigurationRules/ReconfigurationRulesPage'
import { DeploySuccess } from './components/pages/ReviewDeploy/components/DeploySuccess'
import { ReviewDeployPage } from './components/pages/ReviewDeploy/ReviewDeployPage'
import { Wizard } from './components/Wizard/Wizard'
import { readNetwork } from 'constants/networks'
import { DeployProjectButtonText } from './DeployProjectButtonText'
import { useLoadingInitialStateFromQuery } from './hooks/useLoadInitialStateFromQuery'
import { useRouter } from 'next/router'

export function Create() {
const router = useRouter()
Expand All @@ -37,7 +34,7 @@ export function Create() {
return (
<div className="mt-12 md:mt-10">
<h1 className="mb-0 text-center font-heading text-base font-medium uppercase text-black dark:text-slate-100">
<span className='inline-flex gap-2'>
<span className="inline-flex gap-2">
<Trans>Create a project</Trans>
<Badge variant="info">Beta</Badge>
</span>
Expand Down Expand Up @@ -80,7 +77,7 @@ export function Create() {
<Trans>
When people pay your project, they receive its tokens. Project
tokens can be used for governance or community access, and token
holders can redeem their tokens to reclaim some ETH from your
holders can cash out their tokens to reclaim some ETH from your
project. You can also reserve some tokens for recipients of your
choosing.
</Trans>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export const RedeemConfiguration: React.FC<RedeemConfigurationProps> = ({
<PayRedeemInput
label={
<Tooltip
title={t`Redeem your tokens for a portion of this project's treasury`}
title={t`Cash out your tokens for a portion of this project's treasury`}
>
{t`You redeem`}
{t`You cash out`}
</Tooltip>
}
token={{
Expand Down Expand Up @@ -196,10 +196,10 @@ export const RedeemConfiguration: React.FC<RedeemConfigurationProps> = ({
insufficientBalance ? (
<Trans>Insufficient balance</Trans>
) : (
<Trans>Redeem {tokenTicker}</Trans>
<Trans>Cash out {tokenTicker}</Trans>
)
) : (
<Trans>Connect wallet to redeem</Trans>
<Trans>Connect wallet to cash out</Trans>
)}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ export const V4PayRedeemCard: React.FC<PayRedeemCardProps> = ({
{redeemDisabled ? null : (
<ChoiceButton
selected={state === 'redeem'}
tooltip={t`Redeem tokens for a portion of this project's treasury`}
tooltip={t`Cash out tokens for a portion of this project's treasury`}
onClick={() => {
dispatch(payRedeemActions.changeToRedeem())
}}
disabled={!redeems.enabled}
>
<Trans>Redeem</Trans>
<Trans>Cash out</Trans>
</ChoiceButton>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function V4BurnOrRedeemModal({
includeTokenWord: true,
})
if (canRedeem) {
return t`Redeem ${tokensTextLong} for ETH`
return t`Cash out ${tokensTextLong} for ETH`
}
return t`Burn ${tokensTextLong}`
}, [canRedeem, token.data?.symbol])
Expand Down Expand Up @@ -247,7 +247,7 @@ export function V4BurnOrRedeemModal({
</Callout.Info>
<div>
<Trans>
Redeem your tokens to reclaim some ETH that isn't needed for
Cash out your tokens to reclaim some ETH that isn't needed for
payouts. This cycle's <strong>redemption rate</strong>{' '}
determines the amount of ETH you'll receive.
</Trans>
Expand Down Expand Up @@ -307,7 +307,7 @@ export function V4BurnOrRedeemModal({
name="redeemAmount"
label={
canRedeem ? (
<Trans>Tokens to redeem</Trans>
<Trans>Tokens to cash out</Trans>
) : (
<Trans>Tokens to burn</Trans>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import TransactionModal from 'components/modals/TransactionModal'
import { TxHistoryContext } from 'contexts/Transaction/TxHistoryContext'
import { useWallet } from 'hooks/Wallet'
import { Ether } from 'juice-sdk-core'
import { useJBContractContext, useJBTokenContext, useReadJbTokensCreditBalanceOf, useWriteJbControllerClaimTokensFor } from 'juice-sdk-react'
import {
useJBContractContext,
useJBTokenContext,
useReadJbTokensCreditBalanceOf,
useWriteJbControllerClaimTokensFor,
} from 'juice-sdk-react'
import { useProjectHasErc20Token } from 'packages/v4/hooks/useProjectHasErc20Token'
import { wagmiConfig } from 'packages/v4/wagmiConfig'
import { useContext, useLayoutEffect, useState } from 'react'
Expand Down Expand Up @@ -68,22 +73,22 @@ export function V4ClaimTokensModal({
userAddress,
projectId,
parseWad(claimAmount).toBigInt(),
userAddress
userAddress,
] as const

try {
// SIMULATE TX:
// const encodedData = encodeFunctionData({
// abi: jbControllerAbi,
// functionName: 'claimTokensFor',
// args,
// abi: jbControllerAbi,
// functionName: 'claimTokensFor',
// args,
// })
// console.log('encodedData:', encodedData)
// console.log('contract:', contracts.controller.data)

const hash = await writeClaimTokens({
address: contracts.controller.data,
args,
args,
})
setTransactionPending(true)

Expand Down Expand Up @@ -152,10 +157,10 @@ export function V4ClaimTokensModal({
</p>
<p>
<Trans>
You can redeem your {tokenTextLong} for ETH without claiming them.
You can transfer your unclaimed {tokenTextLong} to another address
from the Tools menu, which can be accessed from the wrench icon in
the upper right-hand corner of this project.
You can cash out your {tokenTextLong} for ETH without claiming
them. You can transfer your unclaimed {tokenTextLong} to another
address from the Tools menu, which can be accessed from the wrench
icon in the upper right-hand corner of this project.
</Trans>
</p>
</div>
Expand All @@ -164,7 +169,7 @@ export function V4ClaimTokensModal({
<Descriptions.Item
label={<Trans>Your unclaimed {tokenTextLong}</Trans>}
>
{new Ether(unclaimedBalance ?? 0n).format()}{' '}{tokenTextShort}
{new Ether(unclaimedBalance ?? 0n).format()} {tokenTextShort}
</Descriptions.Item>

{hasIssuedTokens && tokenSymbol && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const V4RedeemTokensButton = ({

const redeemDisabledTooltip = useMemo(() => {
if (!userTokenBalance || userTokenBalance === 0n)
return t`No tokens to redeem.`
return t`No tokens to cash out.`
if (!hasSurplus)
return t`This project has no ETH, or is using all of its ETH for payouts.`
if (payoutLimit === 0n) return t`This project has redemptions turned off.`
Expand All @@ -59,7 +59,7 @@ export const V4RedeemTokensButton = ({
disabled={redeemTokensDisabled}
onClick={redeemTokensDisabled ? undefined : openModal}
>
<Trans>Redeem tokens</Trans>
<Trans>Cash out tokens</Trans>
</Button>
<V4BurnOrRedeemModal
open={open}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function PayoutLimitValue({
) : distributionLimitIsZero ? (
<Trans>
No ETH can be paid out from the project. The ETH can only be
accessed by token holders that redeem their tokens.
accessed by token holders that cash out their tokens.
</Trans>
) : (
<Trans>
Expand All @@ -56,9 +56,7 @@ export function PayoutLimitValue({
) : distributionLimitIsZero ? (
<>{shortName ? <Trans>Zero</Trans> : <Trans>Zero (no payouts)</Trans>}</>
) : (
<NativeTokenValue
wei={payoutLimit}
/>
<NativeTokenValue wei={payoutLimit} />
)

return (
Expand Down

0 comments on commit 949fc2b

Please sign in to comment.