-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yield farming user deposit UI fix #1495
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
20631a5
Yield Farming User Deposit issue fix
abhishek-01k aab42cc
Fixed some UI issues too
abhishek-01k ac7d117
User Deposit issue fixed for guest mode user
abhishek-01k c40cb58
User Deposit issue fix 2
abhishek-01k c490691
Total staked amount and claimed reward fixed
abhishek-01k 3929467
Fixed all the issues commented
abhishek-01k ca73986
Resolved merge conflicts
abhishek-01k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,15 +81,15 @@ const extendConsole = () => { | |
window.console = {}; | ||
} | ||
if (window.console[level] === 'undefined' || !window.console[level] || window.console[level] === null) { | ||
window.console[level] = function () {}; | ||
window.console[level] = function () { }; | ||
} | ||
if (enabled) { | ||
if (disabledConsoles[level]) { | ||
window.console[level] = disabledConsoles[level]; | ||
} | ||
} else { | ||
disabledConsoles[level] = window.console[level]; | ||
window.console[level] = function () {}; | ||
window.console[level] = function () { }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
} | ||
}; | ||
} catch (e) { | ||
|
@@ -360,6 +360,8 @@ const HeaderContainer = styled.header` | |
|
||
const ParentContainer = styled.div` | ||
flex-wrap: wrap; | ||
position: relative; | ||
z-index:0; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
import { ethers } from "ethers"; | ||
import { PushCoreV2 } from "../types"; | ||
import { CoreV2Reward } from "./CoreV2Reward"; | ||
import { Helpers } from "./helpers"; | ||
import { Constants } from "./constants"; | ||
import { ethers } from 'ethers'; | ||
import { PushCoreV2 } from '../types'; | ||
import { CoreV2Reward } from './CoreV2Reward'; | ||
import { Helpers } from './helpers'; | ||
import { Constants } from './constants'; | ||
|
||
export const getUserPushStakingInfo = async ( | ||
provider: ethers.providers.JsonRpcProvider, | ||
userAddress: string, | ||
contractAddress:string | ||
contractAddress: string | ||
) => { | ||
const coreV2Contract = Helpers.getCoreV2Contract( | ||
provider, | ||
contractAddress | ||
); | ||
const coreV2Contract = Helpers.getCoreV2Contract(provider, contractAddress); | ||
|
||
const avilableRewardHelper = new CoreV2Reward(coreV2Contract, userAddress); | ||
const userRewardInfoHelper = new CoreV2Reward(coreV2Contract, userAddress); | ||
|
||
const [availableRewards, userFeeInfo] = await Promise.all([ | ||
let totalStaked = coreV2Contract.totalStakedAmount(); | ||
let claimedR = coreV2Contract.usersRewardsClaimed(userAddress); | ||
|
||
const [availableRewards, userFeeInfo, totalStakedAmount, claimedReward] = await Promise.all([ | ||
avilableRewardHelper.estimateHarvestAll(), | ||
userRewardInfoHelper.getUserPotentialEpochReward(), | ||
totalStaked, | ||
claimedR, | ||
]); | ||
|
||
return { | ||
availableRewards, | ||
totalStakedAmount, | ||
claimedReward, | ||
...userFeeInfo, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,7 +25,7 @@ import { AppContextType } from 'types/context'; | |||||
|
||||||
// Create Header | ||||||
const Profile = ({ isDarkMode }) => { | ||||||
const { web3NameList,initialisePushSdkReadMode }: AppContextType = useContext(AppContext); | ||||||
const { web3NameList, initialisePushSdkReadMode }: AppContextType = useContext(AppContext); | ||||||
const { setReadOnlyWallet, readOnlyWallet, mode, setMode }: GlobalContextType = useContext(GlobalContext); | ||||||
const { authError } = useContext(ErrorContext); | ||||||
const toggleArrowRef = useRef(null); | ||||||
|
@@ -44,7 +44,7 @@ const Profile = ({ isDarkMode }) => { | |||||
// Get theme | ||||||
const theme = useTheme(); | ||||||
const [showDropdown, setShowDropdown] = React.useState<boolean>(false); | ||||||
useClickAway(modalRef, dropdownRef, () => showDropdown && setShowDropdown(false)); | ||||||
// useClickAway(modalRef, dropdownRef, () => showDropdown && setShowDropdown(false)); | ||||||
|
||||||
const dropdownValues = [ | ||||||
{ | ||||||
|
@@ -88,11 +88,11 @@ const Profile = ({ isDarkMode }) => { | |||||
setShowDropdown(false); | ||||||
}); | ||||||
|
||||||
const ConnectWallet = ()=>{ | ||||||
const ConnectWallet = () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in new commit |
||||||
connect(); | ||||||
} | ||||||
|
||||||
|
||||||
// to create blockies | ||||||
return ( | ||||||
<> | ||||||
|
@@ -105,7 +105,7 @@ const Profile = ({ isDarkMode }) => { | |||||
bg="linear-gradient(87.17deg, #B6A0F5 0%, #F46EF7 57.29%, #FF95D5 100%)" | ||||||
color='#FFF' | ||||||
isDarkMode={isDarkMode} | ||||||
onClick={()=>ConnectWallet()} | ||||||
onClick={() => ConnectWallet()} | ||||||
> | ||||||
Connect Wallet | ||||||
</Wallet> | ||||||
|
@@ -149,7 +149,7 @@ const Profile = ({ isDarkMode }) => { | |||||
align="flex-start" | ||||||
ref={dropdownRef} | ||||||
> | ||||||
<Dropdown dropdownValues={dropdownValues} setShowDropdown={setShowDropdown}/> | ||||||
<Dropdown dropdownValues={dropdownValues} setShowDropdown={setShowDropdown} /> | ||||||
</DropdownItem> | ||||||
<ItemModal ref={modalRef}> | ||||||
<ProfileModal | ||||||
|
@@ -168,7 +168,7 @@ const Profile = ({ isDarkMode }) => { | |||||
bg="linear-gradient(87.17deg, #B6A0F5 0%, #F46EF7 57.29%, #FF95D5 100%)" | ||||||
color='#FFF' | ||||||
isDarkMode={isDarkMode} | ||||||
onClick={()=>ConnectWallet()} | ||||||
onClick={() => ConnectWallet()} | ||||||
abhishek-01k marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
> | ||||||
Connect Wallet | ||||||
</Wallet> | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this in the first place. Can't these be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why this is present here.