Merge branch 'production' into main
This commit is contained in:
commit
856e54df8a
|
@ -136,12 +136,12 @@ export const ConnectWalletButton: React.FC = () => {
|
||||||
{!loadProfileDetails && !isMobile ? (
|
{!loadProfileDetails && !isMobile ? (
|
||||||
<div className="ml-2 w-32 text-left">
|
<div className="ml-2 w-32 text-left">
|
||||||
<p className="mb-0.5 truncate text-xs font-bold capitalize text-th-fgd-1">
|
<p className="mb-0.5 truncate text-xs font-bold capitalize text-th-fgd-1">
|
||||||
{profileDetails.profile_name}
|
{profileDetails?.profile_name}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-0 text-xs text-th-fgd-4">
|
<p className="mb-0 text-xs text-th-fgd-4">
|
||||||
{profileDetails.wallet_pk
|
{profileDetails?.wallet_pk
|
||||||
? abbreviateAddress(
|
? abbreviateAddress(
|
||||||
new PublicKey(profileDetails.wallet_pk)
|
new PublicKey(profileDetails?.wallet_pk)
|
||||||
)
|
)
|
||||||
: ''}
|
: ''}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -115,7 +115,7 @@ const MarketDetails = () => {
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-th-fgd-1 md:text-xs">
|
<div className="text-th-fgd-1 md:text-xs">
|
||||||
{`${market?.funding1h.toFixed(4)}% (${(
|
{`${market?.funding1h?.toFixed(4)}% (${(
|
||||||
market?.funding1h *
|
market?.funding1h *
|
||||||
24 *
|
24 *
|
||||||
365
|
365
|
||||||
|
@ -129,7 +129,7 @@ const MarketDetails = () => {
|
||||||
<div className="flex items-center text-th-fgd-1 md:text-xs">
|
<div className="flex items-center text-th-fgd-1 md:text-xs">
|
||||||
{usdFormatter(market?.openInterestUsd, 0)}
|
{usdFormatter(market?.openInterestUsd, 0)}
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={`${market?.openInterest.toLocaleString(
|
content={`${market?.openInterest?.toLocaleString(
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
maximumFractionDigits:
|
maximumFractionDigits:
|
||||||
|
|
|
@ -14,6 +14,8 @@ const ProfileImage = ({
|
||||||
}) => {
|
}) => {
|
||||||
const profile = useMangoStore((s) => s.profile.details)
|
const profile = useMangoStore((s) => s.profile.details)
|
||||||
|
|
||||||
|
if (!profile) return null
|
||||||
|
|
||||||
return imageUrl || (isOwnerProfile && profile.profile_image_url) ? (
|
return imageUrl || (isOwnerProfile && profile.profile_image_url) ? (
|
||||||
<img
|
<img
|
||||||
alt=""
|
alt=""
|
||||||
|
|
|
@ -149,6 +149,7 @@ const AccountOverviewStats = ({ hourlyPerformanceStats, accountValue }) => {
|
||||||
if (performanceRange === '3m') {
|
if (performanceRange === '3m') {
|
||||||
setChartData(hourlyPerformanceStats.slice().reverse())
|
setChartData(hourlyPerformanceStats.slice().reverse())
|
||||||
}
|
}
|
||||||
|
if (!chartData?.length) return
|
||||||
if (performanceRange === '30d') {
|
if (performanceRange === '30d') {
|
||||||
const start = new Date(
|
const start = new Date(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -157,7 +158,8 @@ const AccountOverviewStats = ({ hourlyPerformanceStats, accountValue }) => {
|
||||||
const chartData = cloneDeep(hourlyPerformanceStats).filter(
|
const chartData = cloneDeep(hourlyPerformanceStats).filter(
|
||||||
(d) => new Date(d.time).getTime() > start
|
(d) => new Date(d.time).getTime() > start
|
||||||
)
|
)
|
||||||
const pnlStart = chartData[chartData.length - 1].pnl
|
|
||||||
|
const pnlStart = chartData[chartData.length - 1]?.pnl
|
||||||
const perpPnlStart = chartData[chartData.length - 1].perp_pnl
|
const perpPnlStart = chartData[chartData.length - 1].perp_pnl
|
||||||
for (let i = 0; i < chartData.length; i++) {
|
for (let i = 0; i < chartData.length; i++) {
|
||||||
if (i === chartData.length - 1) {
|
if (i === chartData.length - 1) {
|
||||||
|
|
|
@ -333,7 +333,7 @@ export default function Account() {
|
||||||
{pubkey && mangoAccount ? (
|
{pubkey && mangoAccount ? (
|
||||||
profileData && !loadProfileDetails ? (
|
profileData && !loadProfileDetails ? (
|
||||||
<Link
|
<Link
|
||||||
href={`/profile?name=${profileData?.profile_name.replace(
|
href={`/profile?name=${profileData?.profile_name?.replace(
|
||||||
/\s/g,
|
/\s/g,
|
||||||
'-'
|
'-'
|
||||||
)}`}
|
)}`}
|
||||||
|
|
Loading…
Reference in New Issue