import AccordianItem from './accordian-item' import * as Yup from 'yup' import { Input, InputUserSuggest } from './form' import { InputGroup } from 'react-bootstrap' import { BOOST_MIN } from '../lib/constants' import { NAME_QUERY } from '../fragments/users' import Info from './info' export function AdvPostSchema (client) { return { boost: Yup.number().typeError('must be a number') .min(BOOST_MIN, `must be blank or at least ${BOOST_MIN}`).integer('must be whole').test({ name: 'boost', test: async boost => { if (!boost || boost % BOOST_MIN === 0) return true return false }, message: `must be divisble be ${BOOST_MIN}` }), forward: Yup.string() .test({ name: 'name', test: async name => { if (!name || !name.length) return true const { data } = await client.query({ query: NAME_QUERY, variables: { name }, fetchPolicy: 'network-only' }) return !data.nameAvailable }, message: 'user does not exist' }) } } export function AdvPostInitial ({ forward }) { return { boost: '', forward: forward || '' } } export default function AdvPostForm ({ edit }) { return ( options} body={ <> {edit ? 'add boost' : 'boost'}
  1. Boost ranks posts higher temporarily based on the amount
  2. The minimum boost is {BOOST_MIN} sats
  3. Each {BOOST_MIN} sats of boost is equivalent to one trusted upvote
    • e.g. {BOOST_MIN * 2} sats is like 2 votes
  4. The decay of boost "votes" increases at 2x the rate of organic votes
    • i.e. boost votes fall out of ranking faster
  5. 100% of sats from boost are given back to top users as rewards
} name='boost' hint={ranks posts higher temporarily based on the amount} append={sats} /> forward sats to} name='forward' hint={100% of sats will be sent to this user} prepend={@} showValid /> } /> ) }