Skip to content

Commit

Permalink
Fix Faucet done message (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr authored and ashishb committed Oct 7, 2019
1 parent 40fdf97 commit 5cd3614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/web/src/fauceting/MicroComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function ButtonWithFeedback({
<Button
disabled={isInvalid || !captchaOK || isStarted || isEnded || disabled}
kind={isNotStarted ? BTN.PRIMARY : BTN.SECONDARY}
text={buttonText({ requestState, t })}
text={buttonText({ requestState, t, isFaucet })}
onPress={onSubmit}
iconLeft={icon}
align={'flex-start'}
Expand All @@ -108,18 +108,20 @@ export function ButtonWithFeedback({
interface TextFuncArgs {
t: I18nProps['t']
requestState: RequestState
isFaucet?: boolean
}

function buttonText({ requestState, t }: TextFuncArgs) {
function buttonText({ requestState, t, isFaucet }: TextFuncArgs) {
switch (requestState) {
case RequestState.Working:
return ''
case RequestState.Completed:
return t('done')
return isFaucet ? t('faucetDone') : t('inviteDone')
default:
return t('getStarted')
}
}

function faucetText({ requestState, t }: TextFuncArgs) {
return (
{
Expand Down
3 changes: 2 additions & 1 deletion packages/web/static/locales/en/faucet.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"testnetForum": "Alfajores Testnet Forum",
"testnetAddress": "Testnet Address",
"getStarted": "Get Started",
"done": "Done. SMS arriving \n in 1 – 2 Minutes",
"inviteDone": "Done. SMS arriving\nin 1 – 2 Minutes",
"faucetDone": "Done",
"inviteError": "Unable to complete",
"cUSDsent": "cUSD Sent",
"cGLDsent": "cGLD Sent",
Expand Down

0 comments on commit 5cd3614

Please sign in to comment.