Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Hide the more info button when the rewards sidenav is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
elias-garcia committed Jun 21, 2021
1 parent b09241e commit 80a4290
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const useRewardsCardStyles = createUseStyles((theme) => ({
justifyContent: 'space-between',
paddingBottom: theme.spacing(1.25),
marginBottom: theme.spacing(1),
color: theme.palette.grey.light
color: theme.palette.grey.light,
minHeight: 44
},
cardHeading: {
[theme.breakpoints.upSm]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CurrencySymbol, getTokenAmountInPreferredCurrency } from '../../../../u
import { getFormattedEarnedReward, getFormattedPercentage } from '../../../../utils/rewards'

function RewardsCard ({
rewardSidenav,
rewardTask,
earnedRewardTask,
rewardPercentageTask,
Expand Down Expand Up @@ -66,9 +67,13 @@ function RewardsCard ({
<div className={classes.root}>
<div className={classes.cardHeader}>
<h3 className={classes.cardHeading}>Your earnings</h3>
<button className={classes.moreInfoButton} onClick={onOpenRewardsSidenav}>
More info
</button>
{
rewardSidenav.status === 'closed' && (
<button className={classes.moreInfoButton} onClick={onOpenRewardsSidenav}>
More info
</button>
)
}
</div>
{
(() => {
Expand Down
1 change: 1 addition & 0 deletions src/views/my-account/my-account.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function MyAccount ({
hasRewardStarted(rewards.rewardTask.data) && (
<div className={classes.rewardsCard}>
<RewardsCard
rewardSidenav={rewards.sidenav}
rewardTask={rewards.rewardTask}
earnedRewardTask={rewards.earnedRewardTask}
rewardPercentageTask={rewards.rewardPercentageTask}
Expand Down

0 comments on commit 80a4290

Please sign in to comment.