Browse Source

Make the messaging more clear and consistent when buying a domain

master
Matheus Fernandes 8 years ago
parent
commit
769f8c298a
No known key found for this signature in database GPG Key ID: DD07CA4EA7B65C4F
  1. 8
      bin/domains/buy.js
  2. 6
      lib/alias.js

8
bin/domains/buy.js

@ -34,10 +34,12 @@ module.exports = async function({ domains, args, currentTeam, user }) {
`The domain ${nameParam} is ${italic('unavailable')}! ${elapsed()}` `The domain ${nameParam} is ${italic('unavailable')}! ${elapsed()}`
) )
} }
const periodMsg = `${period}yr${period > 1 ? 's' : ''}, ` const periodMsg = `${period}yr${period > 1 ? 's' : ''}`
info(`The domain ${nameParam} is ${italic('available')}! ${elapsed()}`) info(
`The domain ${nameParam} is ${italic('available')} to buy under ${bold((currentTeam && currentTeam.slug) || user.username || user.email)}! ${elapsed()}`
)
const confirmation = await promptBool( const confirmation = await promptBool(
`Buy now for ${bold(`$${price}`)} (${bold(periodMsg + (currentTeam && currentTeam.slug) || user.username || user.email)})?` `Buy now for ${bold(`$${price}`)} (${periodMsg})?`
) )
eraseLines(1) eraseLines(1)

6
lib/alias.js

@ -547,12 +547,12 @@ module.exports = class Alias extends Now {
if (canBePurchased) { if (canBePurchased) {
const { price, period } = await pricePromise const { price, period } = await pricePromise
const periodMsg = `${period}yr${period > 1 ? 's' : ''}, ` const periodMsg = `${period}yr${period > 1 ? 's' : ''}`
info( info(
`The domain ${aliasParam} is ${chalk.bold('available for purchase')}! ${elapsed()}` `The domain ${aliasParam} is ${chalk.italic('available')} to buy under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}! ${elapsed()}`
) )
const confirmation = await promptBool( const confirmation = await promptBool(
`Buy now for ${chalk.bold(`$${price}`)} (${chalk.bold(periodMsg + (currentTeam && currentTeam.slug) || user.username || user.email)})?` `Buy now for ${chalk.bold(`$${price}`)} (${periodMsg})?`
) )
eraseLines(1) eraseLines(1)
if (!confirmation) { if (!confirmation) {

Loading…
Cancel
Save