Skip to content

Commit

Permalink
Merge pull request #1226 from ethereum-push-notification-service/adde…
Browse files Browse the repository at this point in the history
…d-New-Tag-to-YieldFarming-V2

Added New tag to YieldFarming V2
  • Loading branch information
mishramonalisha76 authored Aug 4, 2023
2 parents e5a5e50 + ffd1f08 commit f1f7402
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 29 deletions.
22 changes: 21 additions & 1 deletion src/components/NavigationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import styled, { css, useTheme } from 'styled-components';
// Internal Compoonents
import LoaderSpinner, { LOADER_TYPE } from 'components/reusables/loaders/LoaderSpinner';
import { Anchor, Image, ItemH, RouterLink, Span } from 'primaries/SharedStyling';
import { ItemVV2 } from './reusables/SharedStylingV2';
import { ItemVV2, SpanV2 } from './reusables/SharedStylingV2';

// Internal Configs
import GLOBALS from 'config/Globals';
Expand Down Expand Up @@ -107,6 +107,10 @@ function NavigationButton({ item, data, sectionID, active, bg = 'none' }) {
{data.name}
</Span>

{data?.name === "Yield Farming V2" && (
<NewTag>New</NewTag>
)}

{item.hasItems && !item.opened && <BiChevronDown color={theme.nav.color} />}

{item.hasItems && item.opened && <BiChevronUp color={theme.nav.color} />}
Expand Down Expand Up @@ -184,5 +188,21 @@ const LeftBarSecondarySectionIcon = styled(InheritedSectionGroupIcon)`

const LeftBarSecondaryItemIcon = styled(InheritedSectionItemIcon)``;

const NewTag = styled(SpanV2)`
font-weight: 600;
font-size: 12px;
letter-spacing:0;
line-height: 140%;
display: flex;
align-items: center;
color: #D53A94;
margin-left:10px;
padding: 2px 6px;
background: #F3D7FA;
border-radius: 6px;
height: 17px;
width:fit-content;
`

// Export Default
export default NavigationButton;
52 changes: 28 additions & 24 deletions src/config/NavigationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,33 @@ const NavigationList = {
},
},
third: {

yieldv2: {
src: 'navigation/incentivesOffIcon.svg',
activeSrc: 'navigation/incentivesOnIcon.svg',
iconFactory: null,
name: 'Yield Farming V2',
title: 'Yield Farming V2',
alt: 'Open Yield Farming V2',
href: '/yieldv2',
newTab: false,
isRoute: true,
hasMenuLogic: true,
hidden: false,
headerTag: {
title: 'Yield Farming V2',
light: {
bg: GLOBALS.COLORS.GRADIENT_PRIMARY,
fg: themeLight.headerTagFg,
},
dark: {
bg: themeDark.headerTagBg,
fg: themeDark.headerTagFg,
},
},
},


receiveNotifs: {
src: 'navigation/receiveNotifOffIcon.svg',
activeSrc: 'navigation/receiveNotifOnIcon.svg',
Expand Down Expand Up @@ -234,30 +261,7 @@ const NavigationList = {
},
},

yieldv2: {
src: 'navigation/incentivesOffIcon.svg',
activeSrc: 'navigation/incentivesOffIcon.svg',
iconFactory: null,
name: 'Yield Farming V2',
title: 'Yield Farming V2',
alt: 'Open Yield Farming V2',
href: '/yieldv2',
newTab: false,
isRoute: true,
hasMenuLogic: true,
hidden: false,
headerTag: {
title: 'Yield Farming V2',
light: {
bg: GLOBALS.COLORS.GRADIENT_PRIMARY,
fg: themeLight.headerTagFg,
},
dark: {
bg: themeDark.headerTagBg,
fg: themeDark.headerTagFg,
},
},
},




Expand Down
4 changes: 2 additions & 2 deletions src/singletons/YieldFarmingDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default class YieldFarmingDataStore {
contract
) =>{
let promises = []
for(var i = lastEpochIdHarvested + 1; i<=currentEpochPUSH.sub(1).toNumber(); i++){
for(var i = lastEpochIdHarvested + 1; i<=currentEpochPUSH.toNumber(); i++){
const epochReward = this.calculateUserEpochReward(i, contract);
promises.push(epochReward);
}
Expand All @@ -233,7 +233,7 @@ export default class YieldFarmingDataStore {
contract
)=>{
let promises = []
for(var i=0; i<=currentEpochPUSH.sub(1).toNumber(); i++){
for(var i=0; i<=currentEpochPUSH.toNumber(); i++){
const epochReward = this.calculateUserEpochReward(i, contract)
promises.push(epochReward);
}
Expand Down
2 changes: 0 additions & 2 deletions src/singletons/YieldFarmingDataStoreV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,13 @@ export default class YieldFarmingDataStoreV2 {
return potentialUserReward;
};

//
getTotalAvailableRewards = async(
lastEpochIdHarvested,
currentEpochPUSH,
contract
) =>{
let promises = []
for(var i = lastEpochIdHarvested + 1; i<=currentEpochPUSH.sub(1).toNumber(); i++){
//passing 1 2 3 4 5 6 7 8 9 10 11
const epochReward = this.calculateUserEpochReward(i, contract);
promises.push(epochReward);
}
Expand Down

0 comments on commit f1f7402

Please sign in to comment.