stacker.news/lib/constants.js

48 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-12-19 22:27:52 +00:00
export const NOFOLLOW_LIMIT = 100
2022-07-24 00:00:57 +00:00
export const BOOST_MIN = 5000
2022-05-12 18:44:21 +00:00
export const UPLOAD_SIZE_MAX = 2 * 1024 * 1024
export const IMAGE_PIXELS_MAX = 35000000
export const UPLOAD_TYPES_ALLOW = [
'image/gif',
'image/heic',
'image/png',
'image/jpeg',
'image/webp'
]
2022-05-17 22:09:15 +00:00
export const COMMENT_DEPTH_LIMIT = 10
2022-07-13 15:49:55 +00:00
export const MAX_TITLE_LENGTH = 80
2022-07-30 13:25:46 +00:00
export const MAX_POLL_CHOICE_LENGTH = 30
2022-08-10 15:06:31 +00:00
export const ITEM_SPAM_INTERVAL = '10m'
2022-08-18 18:15:24 +00:00
export const MAX_POLL_NUM_CHOICES = 10
2023-02-08 19:38:04 +00:00
export const MIN_POLL_NUM_CHOICES = 2
2022-09-21 19:57:36 +00:00
export const ITEM_FILTER_THRESHOLD = 1.2
export const DONT_LIKE_THIS_COST = 1
export const COMMENT_TYPE_QUERY = ['comments', 'freebies', 'outlawed', 'borderland', 'all', 'bookmarks']
2023-06-20 16:26:23 +00:00
// XXX this is temporary until we have so many subs they have
// to be loaded from the server
export const SUBS = ['bitcoin', 'nostr', 'tech', 'meta', 'jobs']
export const SUBS_NO_JOBS = SUBS.filter(s => s !== 'jobs')
export const USER_SORTS = ['stacked', 'spent', 'comments', 'posts', 'referrals']
export const ITEM_SORTS = ['votes', 'comments', 'sats']
export const WHENS = ['day', 'week', 'month', 'year', 'forever']
export const ITEM_TYPES = context => {
2023-07-27 00:18:42 +00:00
if (context === 'jobs') {
return ['posts', 'comments', 'all', 'freebies']
}
const items = ['all', 'posts', 'comments', 'bounties', 'links', 'discussions', 'polls']
if (!context) {
items.push('bios', 'jobs')
}
items.push('freebies')
if (context === 'user') {
items.push('jobs', 'bookmarks')
}
return items
}
export const OLD_ITEM_DAYS = 3
export const SSR = typeof window === 'undefined'