52ecd79736
* Bot linking button functional. * Implemented initial prototype of new Twitch signup page. * Removed old Twitch signup page. * Moved new Twitch page to correct URL. * Twitch account linking functional. * Fixed charity link. * Changed to point to live bot server. * Slightly improve spacing and alignment on Twitch page * Tidy up, handle some errors when talking to bot * Seriously do the thing where Twitch link is hidden by default * Fixed secondary Get Started button. Copy overlay and dock link now functional. * Add/remove bot from channel working. * Removed legacy Twitch controls from user profile. * Links provided by dock/overlay buttons are now correct. * Minor profile cleanup post merge. * Fixed unnecessary relinking Twitch account when logging in on Twitch page. * Added confirmation popup to refresh API key. Refreshing API key now requires a user to relink their Twitch account. * Removed legacy twitch-panel.tsx Co-authored-by: Marshall Polaris <marshall@pol.rs>
95 lines
2.3 KiB
TypeScript
95 lines
2.3 KiB
TypeScript
import { notification_preferences } from './user-notification-preferences'
|
|
import { ENV_CONFIG } from 'common/envs/constants'
|
|
|
|
export type User = {
|
|
id: string
|
|
createdTime: number
|
|
|
|
name: string
|
|
username: string
|
|
avatarUrl?: string
|
|
|
|
// For their user page
|
|
bio?: string
|
|
bannerUrl?: string
|
|
website?: string
|
|
twitterHandle?: string
|
|
discordHandle?: string
|
|
|
|
balance: number
|
|
totalDeposits: number
|
|
|
|
profitCached: {
|
|
daily: number
|
|
weekly: number
|
|
monthly: number
|
|
allTime: number
|
|
}
|
|
|
|
creatorVolumeCached: {
|
|
daily: number
|
|
weekly: number
|
|
monthly: number
|
|
allTime: number
|
|
}
|
|
|
|
nextLoanCached: number
|
|
followerCountCached: number
|
|
|
|
followedCategories?: string[]
|
|
homeSections?: string[]
|
|
|
|
referredByUserId?: string
|
|
referredByContractId?: string
|
|
referredByGroupId?: string
|
|
lastPingTime?: number
|
|
shouldShowWelcome?: boolean
|
|
lastBetTime?: number
|
|
currentBettingStreak?: number
|
|
hasSeenContractFollowModal?: boolean
|
|
freeMarketsCreated?: number
|
|
isBannedFromPosting?: boolean
|
|
}
|
|
|
|
export type PrivateUser = {
|
|
id: string // same as User.id
|
|
username: string // denormalized from User
|
|
|
|
email?: string
|
|
unsubscribedFromResolutionEmails?: boolean
|
|
unsubscribedFromCommentEmails?: boolean
|
|
unsubscribedFromAnswerEmails?: boolean
|
|
unsubscribedFromGenericEmails?: boolean
|
|
unsubscribedFromWeeklyTrendingEmails?: boolean
|
|
weeklyTrendingEmailSent?: boolean
|
|
manaBonusEmailSent?: boolean
|
|
initialDeviceToken?: string
|
|
initialIpAddress?: string
|
|
apiKey?: string
|
|
notificationPreferences: notification_preferences
|
|
twitchInfo?: {
|
|
twitchName: string
|
|
controlToken: string
|
|
botEnabled?: boolean
|
|
needsRelinking?: boolean
|
|
}
|
|
}
|
|
|
|
export type PortfolioMetrics = {
|
|
investmentValue: number
|
|
balance: number
|
|
totalDeposits: number
|
|
timestamp: number
|
|
userId: string
|
|
}
|
|
|
|
export const MANIFOLD_USERNAME = 'ManifoldMarkets'
|
|
export const MANIFOLD_AVATAR_URL = 'https://manifold.markets/logo-bg-white.png'
|
|
|
|
export const BETTOR = ENV_CONFIG.bettor ?? 'bettor' // aka predictor
|
|
export const BETTORS = ENV_CONFIG.bettor + 's' ?? 'bettors'
|
|
export const PRESENT_BET = ENV_CONFIG.presentBet ?? 'bet' // aka predict
|
|
export const PRESENT_BETS = ENV_CONFIG.presentBet + 's' ?? 'bets'
|
|
export const PAST_BET = ENV_CONFIG.pastBet ?? 'bet' // aka prediction
|
|
export const PAST_BETS = ENV_CONFIG.pastBet + 's' ?? 'bets' // aka predictions
|