This commit is contained in:
ingawei 2022-09-26 13:11:20 -07:00
parent 74bb21180c
commit 33b33c92f9
3 changed files with 8 additions and 19 deletions

View File

@ -155,8 +155,8 @@ export function BetsList(props: { user: User }) {
(c) => contractsMetrics[c.id].netPayout
)
const totalPnl = user.profitCached.allTime
const totalProfitPercent = (totalPnl / user.totalDeposits) * 100
// const totalPnl = user.profitCached.allTime
// const totalProfitPercent = (totalPnl / user.totalDeposits) * 100
const investedProfitPercent =
((currentBetsValue - currentInvested) / (currentInvested + 0.1)) * 100

View File

@ -2,7 +2,7 @@ import { ResponsiveLine } from '@nivo/line'
import { PortfolioMetrics } from 'common/user'
import { formatMoney } from 'common/util/format'
import dayjs from 'dayjs'
import { last, set } from 'lodash'
import { last } from 'lodash'
import { memo } from 'react'
import { useWindowSize } from 'web/hooks/use-window-size'
import { Col } from '../layout/col'
@ -12,14 +12,12 @@ export const PortfolioValueGraph = memo(function PortfolioValueGraph(props: {
mode: 'value' | 'profit'
setGraphDisplayNumber: (arg0: number | string | null) => void
height?: number
includeTime?: boolean
}) {
const { portfolioHistory, height, includeTime, mode, setGraphDisplayNumber } =
props
const { portfolioHistory, height, mode, setGraphDisplayNumber } = props
const { width } = useWindowSize()
function getPoints(line: 'value' | 'posProfit' | 'negProfit') {
let points = portfolioHistory.map((p) => {
const points = portfolioHistory.map((p) => {
const { timestamp, balance, investmentValue, totalDeposits } = p
const value = balance + investmentValue
@ -63,7 +61,7 @@ export const PortfolioValueGraph = memo(function PortfolioValueGraph(props: {
},
]
}
let firstPoints = data[0].data
const firstPoints = data[0].data
const numYTickValues = 2
const endDate = last(data[0].data)?.x

View File

@ -42,21 +42,12 @@ export function UserPage(props: { user: User }) {
const router = useRouter()
const currentUser = useUser()
const isCurrentUser = user.id === currentUser?.id
const bannerUrl = user.bannerUrl ?? defaultBannerUrl(user.id)
// const bannerUrl = user.bannerUrl ?? defaultBannerUrl(user.id)
const [showConfetti, setShowConfetti] = useState(false)
// const [showBettingStreakModal, setShowBettingStreakModal] = useState(false)
// const [showLoansModal, setShowLoansModal] = useState(false)
const isMobile = useIsMobile()
useEffect(() => {
const claimedMana = router.query['claimed-mana'] === 'yes'
// const showBettingStreak = router.query['show'] === 'betting-streak'
// setShowBettingStreakModal(showBettingStreak)
// setShowConfetti(claimedMana || showBettingStreak)
// const showLoansModel = router.query['show'] === 'loans'
// setShowLoansModal(showLoansModel)
// const claimedMana = router.query['claimed-mana'] === 'yes'
const query = { ...router.query }
if (query.claimedMana || query.show) {
delete query['claimed-mana']