Skip to content

Commit

Permalink
Add review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KMKoushik committed Jan 27, 2023
1 parent a526b38 commit 35d0425
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const useStyles = makeStyles(() =>
textAlign: 'right',
},
value: {
fontSize: '20px',
fontSize: '15px',
color: 'rgba(255, 255, 255, 1)',
fontWeight: 500,
fontFamily: 'DM Mono',
Expand Down Expand Up @@ -49,7 +49,7 @@ const NextRebalanceTimer: React.FC = () => {
}, [])

return (
<div>
<div style={{ marginTop: '16px' }}>
<Typography className={classes.label}>Next hedge in</Typography>
<Typography className={classes.value} variant="subtitle2">
{timeLeft}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const useAboutStyles = makeStyles((theme) =>
position: 'absolute',
top: '10px',
right: '0',
zIndex: 200,

[theme.breakpoints.down('sm')]: {
position: 'relative',
Expand Down Expand Up @@ -100,12 +101,12 @@ const DepositTimePicker: React.FC = () => {

const onDepositDateChange = async (date: Date | null) => {
if (date) {
setDate(date)
setDepositTime(date.getTime() / 1000)
const resp = await fetch(`/api/getBlockNumber?timestamp=${date.getTime() / 1000}`)
const data = await resp.json()
console.log(data)
setDepositBlock(data.blockNumber)
setDate(date)
}
}

Expand Down Expand Up @@ -156,10 +157,9 @@ const About: React.FC = () => {
</Typography>
</Box>

<Box className={aboutClasses.dateContainer}>{!address ? <DepositTimePicker /> : null}</Box>

<Box position="relative" marginTop="32px">
<div className={aboutClasses.timerContainer}>
<DepositTimePicker />
<NextRebalanceTimer />
</div>
<ProfitabilityChart />
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/state/crab/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ export const useCrabProfitData = () => {
if (firstDepositTime && firstDepositBlock && data.strategy.lastHedgeBlockNumber < firstDepositBlock) {
setData(firstDepositBlock , firstDepositTime)
}
else if ( crabPosition.isGreaterThan(0)) {
else if ( crabPosition.isGreaterThan(0) || (data.strategy.lastHedgeBlockNumber > firstDepositBlock && firstDepositBlock != 0)) {
setData(data.strategy.lastHedgeBlockNumber , data.strategy.lastHedgeTimestamp)
} else {
setData()
Expand Down

0 comments on commit 35d0425

Please sign in to comment.