linting
This commit is contained in:
parent
74bb21180c
commit
33b33c92f9
|
@ -155,8 +155,8 @@ export function BetsList(props: { user: User }) {
|
||||||
(c) => contractsMetrics[c.id].netPayout
|
(c) => contractsMetrics[c.id].netPayout
|
||||||
)
|
)
|
||||||
|
|
||||||
const totalPnl = user.profitCached.allTime
|
// const totalPnl = user.profitCached.allTime
|
||||||
const totalProfitPercent = (totalPnl / user.totalDeposits) * 100
|
// const totalProfitPercent = (totalPnl / user.totalDeposits) * 100
|
||||||
const investedProfitPercent =
|
const investedProfitPercent =
|
||||||
((currentBetsValue - currentInvested) / (currentInvested + 0.1)) * 100
|
((currentBetsValue - currentInvested) / (currentInvested + 0.1)) * 100
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { ResponsiveLine } from '@nivo/line'
|
||||||
import { PortfolioMetrics } from 'common/user'
|
import { PortfolioMetrics } from 'common/user'
|
||||||
import { formatMoney } from 'common/util/format'
|
import { formatMoney } from 'common/util/format'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { last, set } from 'lodash'
|
import { last } from 'lodash'
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { useWindowSize } from 'web/hooks/use-window-size'
|
import { useWindowSize } from 'web/hooks/use-window-size'
|
||||||
import { Col } from '../layout/col'
|
import { Col } from '../layout/col'
|
||||||
|
@ -12,14 +12,12 @@ export const PortfolioValueGraph = memo(function PortfolioValueGraph(props: {
|
||||||
mode: 'value' | 'profit'
|
mode: 'value' | 'profit'
|
||||||
setGraphDisplayNumber: (arg0: number | string | null) => void
|
setGraphDisplayNumber: (arg0: number | string | null) => void
|
||||||
height?: number
|
height?: number
|
||||||
includeTime?: boolean
|
|
||||||
}) {
|
}) {
|
||||||
const { portfolioHistory, height, includeTime, mode, setGraphDisplayNumber } =
|
const { portfolioHistory, height, mode, setGraphDisplayNumber } = props
|
||||||
props
|
|
||||||
const { width } = useWindowSize()
|
const { width } = useWindowSize()
|
||||||
|
|
||||||
function getPoints(line: 'value' | 'posProfit' | 'negProfit') {
|
function getPoints(line: 'value' | 'posProfit' | 'negProfit') {
|
||||||
let points = portfolioHistory.map((p) => {
|
const points = portfolioHistory.map((p) => {
|
||||||
const { timestamp, balance, investmentValue, totalDeposits } = p
|
const { timestamp, balance, investmentValue, totalDeposits } = p
|
||||||
const value = balance + investmentValue
|
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 numYTickValues = 2
|
||||||
const endDate = last(data[0].data)?.x
|
const endDate = last(data[0].data)?.x
|
||||||
|
|
||||||
|
|
|
@ -42,21 +42,12 @@ export function UserPage(props: { user: User }) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const currentUser = useUser()
|
const currentUser = useUser()
|
||||||
const isCurrentUser = user.id === currentUser?.id
|
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 [showConfetti, setShowConfetti] = useState(false)
|
||||||
// const [showBettingStreakModal, setShowBettingStreakModal] = useState(false)
|
|
||||||
// const [showLoansModal, setShowLoansModal] = useState(false)
|
|
||||||
const isMobile = useIsMobile()
|
const isMobile = useIsMobile()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const claimedMana = router.query['claimed-mana'] === 'yes'
|
// 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 query = { ...router.query }
|
const query = { ...router.query }
|
||||||
if (query.claimedMana || query.show) {
|
if (query.claimedMana || query.show) {
|
||||||
delete query['claimed-mana']
|
delete query['claimed-mana']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user