Referral bonus => constant

This commit is contained in:
Ian Philips 2022-06-29 08:37:38 -05:00
parent 72e1836637
commit b02c85649e
3 changed files with 5 additions and 4 deletions

View File

@ -40,7 +40,7 @@ export type User = {
export const STARTING_BALANCE = 1000
export const SUS_STARTING_BALANCE = 10 // for sus users, i.e. multiple sign ups for same person
export const REFERRAL_AMOUNT = 500
export type PrivateUser = {
id: string // same as User.id
username: string // denormalized from User

View File

@ -1,6 +1,6 @@
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { User } from '../../common/user'
import { REFERRAL_AMOUNT, User } from '../../common/user'
import { HOUSE_LIQUIDITY_PROVIDER_ID } from '../../common/antes'
import { getValues, getContract } from './utils'
import { createNotification } from './create-notification'
@ -58,7 +58,7 @@ export const onUpdateUser = functions.firestore
}
console.log('creating referral txns')
const fromId = HOUSE_LIQUIDITY_PROVIDER_ID
const referralAmount = 500
const referralAmount = REFERRAL_AMOUNT
await firestore.runTransaction(async (transaction) => {
// if they're updating their referredId, create a txn for both

View File

@ -46,6 +46,7 @@ import { toast } from 'react-hot-toast'
import { useCommentsOnGroup } from 'web/hooks/use-comments'
import ShortToggle from 'web/components/widgets/short-toggle'
import { ShareIconButton } from 'web/components/share-icon-button'
import { REFERRAL_AMOUNT } from 'common/user'
export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz(props: { params: { slugs: string[] } }) {
@ -369,7 +370,7 @@ function GroupOverview(props: {
buttonClassName={'hover:bg-gray-300 !text-gray-700'}
>
<span className={' mx-2'}>
Invite a friend to join and earn M$500
Invite a friend to join and earn M${REFERRAL_AMOUNT}
</span>
</ShareIconButton>
)}