Skip to content

Commit f7c0b0f

Browse files
authored
Merge pull request #269 from ampleforth/wallet-connect
Wallet connect
2 parents d8275b8 + dfd119f commit f7c0b0f

31 files changed

+7388
-5790
lines changed

frontend/.yarn/install-state.gz

219 KB
Binary file not shown.

frontend/craco.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22

33
module.exports = {
44
style: {
5-
postcss: {
5+
postcssOptions: {
66
plugins: [require('tailwindcss'), require('autoprefixer')],
77
},
88
},

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"react": "^17.0.2",
3333
"react-dom": "^17.0.2",
3434
"react-router-dom": "^6.6.0",
35-
"react-scripts": "4.0.3",
35+
"react-scripts": "5.0.1",
3636
"react-spring": "^9.2.3",
3737
"string_decoder": "^1.3.0",
3838
"styled-components": "^5.3.0",

frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function App() {
3737
path="/vault"
3838
element={
3939
<div>
40-
<DropdownsContainer showVaults />
40+
<DropdownsContainer showVaults showGeysers={false} />
4141
<VaultFirstContainer />
4242
</div>
4343
}

frontend/src/components/GeyserFirst/DepositInfoGraphic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, { useEffect, useRef } from 'react'
55
import * as THREE from 'assets/three.module'
66

77
const DepositInfoGraphic = () => {
8-
const containerRef = useRef(null)
8+
const containerRef = useRef<HTMLDivElement>(null)
99
useEffect(() => {
1010
let camera
1111
let scene

frontend/src/components/GeyserFirst/GeyserStakeView.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ export const GeyserStakeView = () => {
151151
const tx = await withdrawUnlockedFromVault(rewardTokenAddress)
152152
if (tx) {
153153
const { response, amount } = tx
154-
setActualRewardsFromUnstake(amount)
154+
// setActualRewardsFromUnstake(amount)
155155
return response
156156
}
157157
}
158158
}
159159
if (receipt && rewardAmountClaimedOnUnstake) {
160-
setActualRewardsFromUnstake(await rewardAmountClaimedOnUnstake(receipt))
160+
// setActualRewardsFromUnstake(await rewardAmountClaimedOnUnstake(receipt))
161161
}
162162
return undefined
163163
}
@@ -187,7 +187,7 @@ export const GeyserStakeView = () => {
187187
decimals={stakingTokenDecimals}
188188
symbol={stakingTokenSymbol}
189189
isStakingAction
190-
poolAddress={poolAddress}
190+
poolAddress={poolAddress ?? ''}
191191
/>
192192
<PositiveInput
193193
placeholder="Enter amount"
@@ -202,7 +202,7 @@ export const GeyserStakeView = () => {
202202
{!ready && <ConnectWalletWarning onClick={() => connectWallet()} />}
203203
{ready && parsedUserInput.gt(0) && (
204204
<StakeWarning
205-
poolAddress={poolAddress}
205+
poolAddress={poolAddress ?? ''}
206206
balance={stakableAmount.sub(parsedUserInput)}
207207
staked={currentStakeAmount}
208208
otherActiveLock={otherActiveLock}
@@ -238,7 +238,7 @@ export const GeyserStakeView = () => {
238238
decimals={stakingTokenDecimals}
239239
symbol={stakingTokenSymbol}
240240
isStakingAction={false}
241-
poolAddress={poolAddress}
241+
poolAddress={poolAddress ?? ''}
242242
/>
243243
<PositiveInput
244244
placeholder="Enter amount"

frontend/src/components/GeyserFirst/GeyserStats.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DAY_IN_SEC, TOTAL_REWARDS_MSG } from '../../constants'
1010

1111
export const GeyserStats = () => {
1212
const {
13-
geyserStats: { duration, totalDepositVal, totalRewards, totalRewardsVal },
13+
geyserStats: { duration, totalDepositVal, totalRewards, totalRewardVal },
1414
} = useContext(StatsContext)
1515
const {
1616
selectedGeyserInfo: {
@@ -41,7 +41,7 @@ export const GeyserStats = () => {
4141
<GeyserStatsBox
4242
containerClassName="w-full"
4343
name="Total Rewards"
44-
value={totalRewardsVal}
44+
value={totalRewardVal}
4545
units="USD"
4646
interpolate={(val) => safeNumeral(val, '0,0')}
4747
tooltipMessage={{
@@ -53,12 +53,12 @@ export const GeyserStats = () => {
5353
rows={[
5454
{
5555
label: `${rewardTokenSymbol} (${safeNumeral(totalRewards, '0,0')})`,
56-
value: `${safeNumeral(totalRewardsVal, '0,0.00')} USD`,
56+
value: `${safeNumeral(totalRewardVal, '0,0.00')} USD`,
5757
},
5858
{ label: 'bonus (0)', value: `${safeNumeral(0, '0,0.00')} USD` },
5959
]}
6060
totalLabel="Total"
61-
totalValue={`${safeNumeral(totalRewardsVal, '0,0.00')} USD`}
61+
totalValue={`${safeNumeral(totalRewardVal, '0,0.00')} USD`}
6262
/>
6363
</div>
6464
),

frontend/src/components/GeyserFirst/MyStats.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ export const MyStats = () => {
2929
const [lpAPY, setLPAPY] = useState<number>(0)
3030
const [geyserAPY, setGeyserAPY] = useState<number>(0)
3131
const [finalAPY, setFinalAPY] = useState<number>(0)
32-
useEffect(async () => {
32+
useEffect(() => {
33+
(async () => {
3334
if (!selectedGeyser) {
3435
return
3536
}
3637
const config = getGeyserConfig(selectedGeyser.id)
37-
const lpAPYNew = (stakeAPYs.lp && stakeAPYs.lp[config.lpRef]) || 0
38-
const geyserAPYGlobal = stakeAPYs.geysers && stakeAPYs.geysers[config.slug]
38+
const lpAPYNew = (stakeAPYs.lp && config && config.lpRef && stakeAPYs.lp[config.lpRef]) || 0
39+
const geyserAPYGlobal = stakeAPYs.geysers && config && stakeAPYs.geysers[config.slug]
3940
// const geyserAPYNew = ready ? apy : geyserAPYGlobal || apy
4041
// NOTE: just showing the global APY as a guideline for most users.
4142
let geyserAPYNew = geyserAPYGlobal || apy
@@ -45,7 +46,7 @@ export const MyStats = () => {
4546
setLPAPY(lpAPYNew)
4647
setGeyserAPY(geyserAPYNew)
4748
setFinalAPY(Math.min(geyserAPYNew + lpAPYNew, 100000))
48-
}, [selectedGeyser, apy, duration])
49+
})()}, [selectedGeyser, apy, duration])
4950

5051
// TODO: handle bonus tokens
5152
const baseRewards = currentReward * rewardTokenPrice

frontend/src/components/GeyserFirst/StakeWarning.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props {
1111
}
1212

1313
export const StakeWarning: React.FC<Props> = ({ poolAddress, balance, staked, otherActiveLock }) => {
14-
const renderStakeWarning = (message: string, buttonLabel: string, url: string, newTab: bool) => (
14+
const renderStakeWarning = (message: string, buttonLabel: string, url: string, newTab: boolean) => (
1515
<StakeWarningContainer>
1616
<ColoredDiv />
1717
<Content>

frontend/src/components/GeyserFirst/UnstakeSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const UnstakeSummary: React.FC<Props> = ({ userInput, parsedUserInput })
3737
const computedRewardsShare = await computeRewardsShareFromUnstake(parsedUserInput)
3838
if (isMounted) {
3939
setRewardAmount(computedRewardAmount)
40-
setRewardsShare(computedRewardsShare)
40+
// setRewardsShare(computedRewardsShare)
4141
}
4242
} catch (e) {
4343
if (isMounted) {

0 commit comments

Comments
 (0)