stacker.news/components/adv-post-form.js

31 lines
855 B
JavaScript
Raw Normal View History

2021-09-11 16:52:19 -05:00
import AccordianItem from './accordian-item'
import * as Yup from 'yup'
import { Input } from './form'
import { InputGroup } from 'react-bootstrap'
2022-03-09 13:44:50 -06:00
import { BOOST_MIN } from '../lib/constants'
2021-09-11 16:52:19 -05:00
export const AdvPostSchema = {
boost: Yup.number().typeError('must be a number')
2022-03-09 13:44:50 -06:00
.min(BOOST_MIN, `must be at least ${BOOST_MIN}`).integer('must be whole')
2021-09-11 16:52:19 -05:00
}
export const AdvPostInitial = {
2022-03-09 13:44:50 -06:00
boost: ''
2021-09-11 16:52:19 -05:00
}
export default function AdvPostForm () {
return (
<AccordianItem
2021-09-12 11:55:38 -05:00
header={<div style={{ fontWeight: 'bold', fontSize: '92%' }}>options</div>}
2021-09-11 16:52:19 -05:00
body={
<Input
label='boost'
name='boost'
2021-09-15 17:57:55 -05:00
hint={<span className='text-muted'>ranks posts higher temporarily based on the amount</span>}
2021-09-11 16:52:19 -05:00
append={<InputGroup.Text className='text-monospace'>sats</InputGroup.Text>}
/>
}
/>
)
}