Skip to content
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

Basin UI (1) - QOL Fixes #711

Merged
merged 91 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
3950763
[wip]: update formatting on dex-ui mobile Wells page + add formatNum fn
Space-Bean Nov 6, 2023
3690f08
fix token amounts when balanceMode is toggled
Space-Bean Nov 6, 2023
0f42f34
[wip]: LP token price hook + user positions in USD
Space-Bean Nov 7, 2023
46f72ef
fix components for Liquidity Box
Space-Bean Nov 8, 2023
106d104
BEAN:ETH LP symbol display
Space-Bean Nov 8, 2023
0a563dc
USD price in well table + modify useWellLPTokenPrice
Space-Bean Nov 8, 2023
5d51f47
update displayTokenSymbol fn + update in relevant places
Space-Bean Nov 8, 2023
ce7eadc
add Beanstalk Logo & Links to Footer & Frame
Space-Bean Nov 8, 2023
52009d8
fix USD value
Space-Bean Nov 8, 2023
247ea7c
fix swap button label if tokens are same
Space-Bean Nov 8, 2023
515fc19
fix add liquidity no wallet button label
Space-Bean Nov 8, 2023
23ab24c
fix my lp positions table when no positions
Space-Bean Nov 8, 2023
6d3a004
FIX: well page broken if brand new well
Space-Bean Nov 10, 2023
51754f5
update useWellLPtokenPrice
Space-Bean Nov 12, 2023
5083d5f
implement lp USD price
Space-Bean Nov 12, 2023
19ec5c4
add useTokenBalanceInternal & implement
Space-Bean Nov 12, 2023
461d16e
add tooltip for usd total breakdown
Space-Bean Nov 12, 2023
3268ee8
remove logs + fix divide by 0
Space-Bean Nov 12, 2023
3a30f04
update hooks
Space-Bean Nov 15, 2023
452bc2b
create new hooks for LP summary + silo whitelist
Space-Bean Nov 15, 2023
eaf6ca6
update components to show Liquidity
Space-Bean Nov 15, 2023
2345424
clean up
Space-Bean Nov 15, 2023
c1a1181
add breakdown tooltips to wells.tsx
Space-Bean Nov 15, 2023
55d3c2e
implement tooltips + refactor Wells.tsx
Space-Bean Nov 15, 2023
14aaab8
change links from app.bean.money to bean.money
Space-Bean Nov 15, 2023
7a38d3f
update Home Page to spec except animated contract info carousel
Space-Bean Nov 16, 2023
3d1ce09
Add ContractInfoMarquee to Home + tweak homepage
Space-Bean Nov 16, 2023
1bcfb1f
fix Footer responsive
Space-Bean Nov 16, 2023
2b174e7
clean up home
Space-Bean Nov 16, 2023
3a14dba
fix well row ui
Space-Bean Nov 16, 2023
7554940
Well page tweaks + WETH icon
Space-Bean Nov 16, 2023
45051c7
update contract info marquee speed
Space-Bean Nov 16, 2023
f7140dc
create skeleton component
Space-Bean Nov 16, 2023
cf60fbb
separate components + add loading skeletons
Space-Bean Nov 16, 2023
12bc75a
update loading state for swap
Space-Bean Nov 16, 2023
161cb05
fix liquidity page responsive
Space-Bean Nov 17, 2023
b132574
clean up
Space-Bean Nov 17, 2023
57cd995
make well page responsive
Space-Bean Nov 19, 2023
a65c180
fix internal whitelist broken in prod + clean up
Space-Bean Nov 19, 2023
97f8a04
fix font sizes
Space-Bean Nov 19, 2023
9eab953
add loading skeletons to AddLiquidity + fix LiquidityBox + fix SwapLo…
Space-Bean Nov 19, 2023
930c567
clean up
Space-Bean Nov 19, 2023
9af596c
add Remove Liquidity Loading state + clean up
Space-Bean Nov 19, 2023
d3d6f04
create & modify loading components
Space-Bean Nov 20, 2023
ffbf725
clean up liquidity + swap components w/ loading
Space-Bean Nov 20, 2023
d48e74c
well page loading minus chart & table
Space-Bean Nov 20, 2023
decb1b8
add table loading state
Space-Bean Nov 20, 2023
5bd1cd3
implement table loading state
Space-Bean Nov 20, 2023
4e3725a
refactor wellHistory
Space-Bean Nov 20, 2023
c35f95a
well page loading
Space-Bean Nov 20, 2023
afff7f0
small updates + fixesxz
Space-Bean Nov 20, 2023
4183888
fix responsive on Loading Template + fix Well Page Responsive
Space-Bean Nov 21, 2023
afa9f20
remove perma loading on Well page
Space-Bean Nov 21, 2023
6b586f3
fix alignment on wells header + skeleton token logo size on mobile
Space-Bean Nov 21, 2023
8aef034
housekeeping
Space-Bean Nov 21, 2023
f9ac082
WellYieldWithTooltip - create UI component
Space-Bean Nov 21, 2023
99927fc
add silo apy query
Space-Bean Nov 22, 2023
577a63f
add fetch hooks
Space-Bean Nov 22, 2023
f9f6cf1
add APY to Well.tsx
Space-Bean Nov 22, 2023
4824622
add tooltips to liquidityBox. Fixing positions later
Space-Bean Nov 22, 2023
7de44cf
create useMultiFlowPumpTWAReserves hook + update whitelist hook
Space-Bean Nov 27, 2023
48a82b4
clean up
Space-Bean Nov 27, 2023
c0edb79
implement hooks + components
Space-Bean Nov 27, 2023
d9f1259
adjust twareserves tooltip props
Space-Bean Nov 27, 2023
68486e6
fix links on tooltips
Space-Bean Nov 27, 2023
95dab4f
update tooltip props
Space-Bean Nov 27, 2023
31296c8
cosmetic changes
hellofromguy Nov 30, 2023
992f9b7
add deployNewWell example script
Space-Bean Dec 1, 2023
d1de2eb
update links + housekeeping
Space-Bean Dec 1, 2023
c72ee9b
fix home Get Started Button styling + update comments
Space-Bean Dec 1, 2023
9e0e975
fix: disallow input gt than balance in remove liquidity input
Space-Bean Dec 2, 2023
eb62ef3
fix: fix overlapping breakpoints
Space-Bean Dec 2, 2023
09ea705
remove unused vars
Space-Bean Dec 2, 2023
c220e5c
housekeeping + update URLs
Space-Bean Dec 2, 2023
4908f00
fix chart not working due to duplicate keys
Space-Bean Dec 2, 2023
19f227f
fix: fix formatting on wells page
Space-Bean Dec 2, 2023
75af384
fix: update chart + Contract Info Marquee
Space-Bean Dec 7, 2023
1abb8bb
fix: remove console logs
Space-Bean Dec 7, 2023
c84f498
fix lag loading + remoe console logs + update useBeanstalkSiloWhiteli…
Space-Bean Dec 10, 2023
3e3c808
fix: update swap inputs to exclude couter selectd token
Space-Bean Dec 11, 2023
208d54e
update: create addresses file
Space-Bean Dec 11, 2023
c718b73
fix: refactor useBeanstalkSiloWhitelist.tsx & apy hook
Space-Bean Dec 13, 2023
8ac8ad8
Update useBeanstalkSiloWhitelist.ts - remove unused types
Space-Bean Dec 13, 2023
35d414f
fix: fix function typings
Space-Bean Dec 13, 2023
a7cad1f
update: make loading components for liquidity
Space-Bean Dec 13, 2023
8c3f424
Merge branch 'spacebean/dex-ui/design-fixes' into spacebean/dex-ui/yi…
Space-Bean Dec 13, 2023
a49fb92
Basin UI (3) - Yield info + misc fixes (#713)
Space-Bean Dec 13, 2023
e523ffd
Merge branch 'spacebean/dex-ui/qol' into spacebean/dex-ui/design-fixes
Space-Bean Dec 13, 2023
aa98873
Basin UI (2) - Design fixes (#712)
Space-Bean Dec 13, 2023
0dd9b9b
Merge branch 'master' into spacebean/dex-ui/qol
Space-Bean Dec 13, 2023
fd106a1
fix: fix from merge
Space-Bean Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion projects/dex-ui/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
overwrite: true,
schema: "graphql.schema.json",
schema: [
"graphql.schema.json",
// beanstalk subgraph
"https://graph.node.bean.money/subgraphs/name/beanstalk"
],
documents: "src/**/*.graphql",
ignoreNoDocuments: true,
generates: {
Expand Down
115 changes: 115 additions & 0 deletions projects/dex-ui/src/abi/MULTI_PUMP_ABI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[
{
"inputs": [
{ "internalType": "bytes16", "name": "_maxPercentIncrease", "type": "bytes16" },
{ "internalType": "bytes16", "name": "_maxPercentDecrease", "type": "bytes16" },
{ "internalType": "uint256", "name": "_capInterval", "type": "uint256" },
{ "internalType": "bytes16", "name": "_alpha", "type": "bytes16" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ "inputs": [], "name": "NoTimePassed", "type": "error" },
{ "inputs": [], "name": "NotInitialized", "type": "error" },
{
"inputs": [],
"name": "ALPHA",
"outputs": [{ "internalType": "bytes16", "name": "", "type": "bytes16" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "CAP_INTERVAL",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LOG_MAX_DECREASE",
"outputs": [{ "internalType": "bytes16", "name": "", "type": "bytes16" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LOG_MAX_INCREASE",
"outputs": [{ "internalType": "bytes16", "name": "", "type": "bytes16" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "well", "type": "address" }],
"name": "readCappedReserves",
"outputs": [{ "internalType": "uint256[]", "name": "cappedReserves", "type": "uint256[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "well", "type": "address" },
{ "internalType": "bytes", "name": "", "type": "bytes" }
],
"name": "readCumulativeReserves",
"outputs": [{ "internalType": "bytes", "name": "cumulativeReserves", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "well", "type": "address" },
{ "internalType": "bytes", "name": "", "type": "bytes" }
],
"name": "readInstantaneousReserves",
"outputs": [{ "internalType": "uint256[]", "name": "emaReserves", "type": "uint256[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "well", "type": "address" }],
"name": "readLastCappedReserves",
"outputs": [{ "internalType": "uint256[]", "name": "lastCappedReserves", "type": "uint256[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "well", "type": "address" }],
"name": "readLastCumulativeReserves",
"outputs": [{ "internalType": "bytes16[]", "name": "cumulativeReserves", "type": "bytes16[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "well", "type": "address" }],
"name": "readLastInstantaneousReserves",
"outputs": [{ "internalType": "uint256[]", "name": "emaReserves", "type": "uint256[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "well", "type": "address" },
{ "internalType": "bytes", "name": "startCumulativeReserves", "type": "bytes" },
{ "internalType": "uint256", "name": "startTimestamp", "type": "uint256" },
{ "internalType": "bytes", "name": "", "type": "bytes" }
],
"name": "readTwaReserves",
"outputs": [
{ "internalType": "uint256[]", "name": "twaReserves", "type": "uint256[]" },
{ "internalType": "bytes", "name": "cumulativeReserves", "type": "bytes" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256[]", "name": "reserves", "type": "uint256[]" },
{ "internalType": "bytes", "name": "", "type": "bytes" }
],
"name": "update",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
5 changes: 5 additions & 0 deletions projects/dex-ui/src/assets/images/home-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions projects/dex-ui/src/assets/images/start-sparkle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/dex-ui/src/assets/images/tokens/WETH.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 39 additions & 2 deletions projects/dex-ui/src/breakpoints.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
export const size = {
mobile: '769px',
}
mobile: "769px",
tablet: "1024px"
};

const mediaSizes = {
mobile: 769,
tablet: 1024,
desktop: 1200
};

const BP_GAP = 0.05;

/// we subtract 0.05px to some queries to prevent overlapping
export const mediaQuery = {
sm: {
// 769px & above
up: `@media (min-width: ${mediaSizes.mobile}px)`,
// 768.95px & below
only: `@media (max-width: ${mediaSizes.mobile - BP_GAP}px)`
},
md: {
// 1024px & above
up: `@media (min-width: ${mediaSizes.tablet}px)`,
// between 769px & 1023.95px
only: `@media (min-width: ${mediaSizes.mobile}px) and (max-width: ${mediaSizes.tablet - BP_GAP}px)`,
// 1024px & below
down: `@media (max-width: ${mediaSizes.tablet - BP_GAP}px)`
},
lg: {
// 1200px & below
down: `@media (max-width: ${mediaSizes.desktop - BP_GAP}px)`,
// 1200px & above
only: `@media (min-width: ${mediaSizes.desktop}px)`
},
between: {
// between 769px & 1199.95px
smAndLg: `@media (min-width: ${mediaSizes.mobile}px) and (max-width: ${mediaSizes.desktop - BP_GAP}px)`
}
};
125 changes: 125 additions & 0 deletions projects/dex-ui/src/components/Frame/ContractInfoMarquee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import React from "react";

import styled, { keyframes } from "styled-components";

type ContractMarqueeInfo = Record<string, { display: string; to?: string; url?: string }[]>;

const CarouselData: ContractMarqueeInfo = {
ADDRESS: [
{
display: "0xBA51AAAA95aeEFc1292515b36D86C51dC7877773",
url: "https://etherscan.io/address/0xBA51AAAA95aeEFc1292515b36D86C51dC7877773"
}
],
AUDIT: [
{ display: "HALBORN", url: "/halborn-basin-audit.pdf" },
{ display: "CYFRIN", url: "/cyfrin-basin-audit.pdf" },
{ display: "CODE4RENA", url: "https://code4rena.com/reports/2023-07-basin" }
],
V1: [{ display: "WHITEPAPER", url: "/basin.pdf" }]
};

const speedPerItem = 16; // approx same speed as TokenMarque
const itemGap = 24;
const numItems = 4;
const singleItemWidth = 1112.06;

export const ContractInfoMarquee = () => {
const data = Object.entries(CarouselData);

const totalItemWidth = numItems * singleItemWidth;
const totalGapWidth = numItems * itemGap;

const totalWidth = totalItemWidth + totalGapWidth;

const repeatableWidth = totalWidth / numItems;
const animationDuration = numItems * speedPerItem;

return (
<Scroller x={repeatableWidth} duration={animationDuration}>
<CarouselRow style={{ justifyContent: "flex-start" }}>
<>
{Array(numItems)
.fill(null)
.map((_, idx) => (
<Container key={`single-item-${idx}`}>
{data.map(([key, data], idx) => (
<RowContainer key={`${key}-${idx}`}>
<InfoRow>
<InfoText>{key.toUpperCase()}:</InfoText>
{data.map(({ display, url }, i) => (
<TextLink href={url} target="_blank" rel="noopener noreferrer" key={`${display}-${i}`}>
{display}
<span>{data.length > 1 && i + 1 < data.length ? <>{","}</> : ""}</span>
</TextLink>
))}
</InfoRow>
<InfoText>/</InfoText>
</RowContainer>
))}
</Container>
))}
</>
</CarouselRow>
</Scroller>
);
};

const Scroller = styled.div<{ x: number; duration: number }>`
background: #fff;
padding: 16px 48px;
box-sizing: border-box;
border-top: 1px solid #000;

animation-name: ${(props) => marquee(props.x)};
animation-duration: ${(props) => props.duration}s;
animation-iteration-count: infinite;
animation-timing-function: linear;
`;

const marquee = (x: number) => keyframes`
0% { transform: translateX(0px); }
100% { transform: translateX(-${x}px);}
`;

const CarouselRow = styled.div`
display: flex;
flex-direction: row;
justify-content: flex-start;
gap: 24px;
`;

const Container = styled.div`
display: flex;
flex-direction: row;
gap: 24px;
`;

const RowContainer = styled.div`
display: flex;
flex-direction: row;
gap: 24px;
`;

const InfoRow = styled.div`
display: flex;
flex-direction: row;
gap: 8px;
white-space: nowrap;
`;

const InfoText = styled.div`
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 24px;
`;

const TextLink = styled.a`
color: #46b955;
font-size: 16px;
font-weight: 600;
line-height: 24px;
letter-spacing: 0.32px;
text-decoration-line: underline;
`;
Loading