fixing props function things

This commit is contained in:
ingawei 2022-09-26 13:02:27 -07:00
parent 85ccdfbf59
commit 74bb21180c
3 changed files with 14 additions and 10 deletions

View File

@ -63,16 +63,15 @@ export const PortfolioValueGraph = memo(function PortfolioValueGraph(props: {
},
]
}
const firstPoints = data[0].data
// const numYTickValues = !width || width < 800 ? 2 : 4
let firstPoints = data[0].data
const numYTickValues = 2
const endDate = last(firstPoints)?.x
const endDate = last(data[0].data)?.x
const firstPointsY = firstPoints
.filter((p) => {
return p.y !== null
})
.map((p) => p.y)
.filter((y) => {
return y !== null
})
const yMin =
mode === 'value'

View File

@ -7,7 +7,6 @@ import { Period } from 'web/lib/firebase/users'
import { PillButton } from '../buttons/pill-button'
import { Col } from '../layout/col'
import { Row } from '../layout/row'
import { Spacer } from '../layout/spacer'
import { PortfolioValueGraph } from './portfolio-value-graph'
export const PortfolioValueSection = memo(
@ -18,6 +17,9 @@ export const PortfolioValueSection = memo(
const portfolioHistory = usePortfolioHistory(userId, portfolioPeriod)
const [graphMode, setGraphMode] = useState<'profit' | 'value'>('value')
const [graphDisplayNumber, setGraphDisplayNumber] = useState(null)
const handleGraphDisplayChange = (num) => {
setGraphDisplayNumber(num)
}
// Remember the last defined portfolio history.
const portfolioRef = useRef(portfolioHistory)
@ -94,7 +96,7 @@ export const PortfolioValueSection = memo(
portfolioHistory={currPortfolioHistory}
includeTime={true}
mode={graphMode}
setGraphDisplayNumber={setGraphDisplayNumber}
setGraphDisplayNumber={handleGraphDisplayChange}
/>
<PortfolioPeriodSelection
portfolioPeriod={portfolioPeriod}

View File

@ -122,7 +122,10 @@ export function UserPage(props: { user: User }) {
{!isCurrentUser && <UserFollowButton userId={user.id} />}
</div>
{!isMobile && (
<ProfilePublicStats className="text-md" user={user} />
<ProfilePublicStats
className="sm:text-md text-greyscale-6 text-sm"
user={user}
/>
)}
</Col>
</Row>
@ -132,7 +135,7 @@ export function UserPage(props: { user: User }) {
<Spacer h={1} />
{user.bio && (
<>
<div className="sm:text-md text-greyscale-6 mt-2 text-sm sm:mt-0">
<div className="sm:text-md mt-2 text-sm sm:mt-0">
<Linkify text={user.bio}></Linkify>
</div>
<Spacer h={2} />