apply UI changes
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
55b047e02f
commit
6156549754
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.6.11",
|
"version": "0.6.12",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import HubIcon from '@mui/icons-material/Hub';
|
|||||||
import PublicIcon from '@mui/icons-material/Public';
|
import PublicIcon from '@mui/icons-material/Public';
|
||||||
import ForkRightIcon from '@mui/icons-material/ForkRight';
|
import ForkRightIcon from '@mui/icons-material/ForkRight';
|
||||||
import GavelIcon from '@mui/icons-material/Gavel';
|
import GavelIcon from '@mui/icons-material/Gavel';
|
||||||
import ForumIcon from '@mui/icons-material/Forum';
|
import CasinoIcon from '@mui/icons-material/Casino';
|
||||||
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
||||||
import BookIcon from '@mui/icons-material/Book';
|
import BookIcon from '@mui/icons-material/Book';
|
||||||
import CurrencyExchangeIcon from '@mui/icons-material/CurrencyExchange';
|
import CurrencyExchangeIcon from '@mui/icons-material/CurrencyExchange';
|
||||||
@ -129,7 +129,7 @@ const NavContent = ({ chainId, addressChainId }) => {
|
|||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<NavItem icon={StakeIcon} label={`(3, 3) Staking`} to="/stake" />
|
<NavItem icon={StakeIcon} label={`(3, 3) Stake`} to="/stake" />
|
||||||
<NavItem
|
<NavItem
|
||||||
defaultExpanded
|
defaultExpanded
|
||||||
icon={BondIcon}
|
icon={BondIcon}
|
||||||
@ -166,7 +166,7 @@ const NavContent = ({ chainId, addressChainId }) => {
|
|||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<NavItem icon={ForkRightIcon} label={`${bridgeNumbers} Bridge`} to="/bridge" />
|
<NavItem icon={ForkRightIcon} label={`${bridgeNumbers} GHOST Staking`} to="/bridge" />
|
||||||
{isGovernanceAvailable(chainId, addressChainId) && <NavItem icon={GavelIcon} label={`Governance`} to="/governance" />}
|
{isGovernanceAvailable(chainId, addressChainId) && <NavItem icon={GavelIcon} label={`Governance`} to="/governance" />}
|
||||||
<Box className="menu-divider">
|
<Box className="menu-divider">
|
||||||
<Divider />
|
<Divider />
|
||||||
@ -179,9 +179,8 @@ const NavContent = ({ chainId, addressChainId }) => {
|
|||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<NavItem href="http://ecosystem.ghostchain.io" icon={PublicIcon} label={`Ecosystem`} />
|
<NavItem href="http://ecosystem.ghostchain.io" icon={PublicIcon} label={`Ecosystem`} />
|
||||||
<NavItem href="http://ghostchain.io/builders" icon={ForumIcon} label={`Forum`} />
|
<NavItem href="https://ghostchain.io/game-theory-3-3" icon={CasinoIcon} label={`(3, 3) Game Theory`} />
|
||||||
<NavItem href="https://docs.ghostchain.io/" icon={BookIcon} label={`Docs`} />
|
<NavItem href="https://docs.ghostchain.io/" icon={BookIcon} label={`Documentation`} />
|
||||||
<NavItem href="https://git.ghostchain.io/ghostchain/ghost-dao-contracts/issues" icon={ErrorOutlineIcon} label={`Git Issues`} />
|
|
||||||
<StyledBox display="flex" justifyContent="space-around" paddingY="24px">
|
<StyledBox display="flex" justifyContent="space-around" paddingY="24px">
|
||||||
<Link href="https://git.ghostchain.io/ghostchain/ghost-dao-contracts" target="_blank" rel="noopener noreferrer">
|
<Link href="https://git.ghostchain.io/ghostchain/ghost-dao-contracts" target="_blank" rel="noopener noreferrer">
|
||||||
<GhostStyledIcon viewBox="0 0 24 24" component={GitHubIcon} className={classes.gray} />
|
<GhostStyledIcon viewBox="0 0 24 24" component={GitHubIcon} className={classes.gray} />
|
||||||
|
|||||||
@ -235,7 +235,6 @@ export const useWallet = (chainId, userAddress) => {
|
|||||||
balance: nativeBalance,
|
balance: nativeBalance,
|
||||||
price: nativePrice,
|
price: nativePrice,
|
||||||
refetch: nativeBalanceRefetch,
|
refetch: nativeBalanceRefetch,
|
||||||
faucetPath: isNetworkLegacy(chainId) ? "/faucet" : "/wrapper",
|
|
||||||
},
|
},
|
||||||
reserve: {
|
reserve: {
|
||||||
symbol: reserveSymbol,
|
symbol: reserveSymbol,
|
||||||
@ -247,7 +246,6 @@ export const useWallet = (chainId, userAddress) => {
|
|||||||
? "https://ghostchain.io/wp-content/uploads/2025/03/gDAI.svg"
|
? "https://ghostchain.io/wp-content/uploads/2025/03/gDAI.svg"
|
||||||
: "https://ghostchain.io/wp-content/uploads/2025/11/6A-Classic-ETC-Token.svg",
|
: "https://ghostchain.io/wp-content/uploads/2025/11/6A-Classic-ETC-Token.svg",
|
||||||
refetch: reserveRefetch,
|
refetch: reserveRefetch,
|
||||||
faucetPath: isNetworkLegacy(chainId) ? "/faucet" : "/wrapper",
|
|
||||||
},
|
},
|
||||||
ftso: {
|
ftso: {
|
||||||
symbol: ftsoSymbol,
|
symbol: ftsoSymbol,
|
||||||
|
|||||||
@ -18,6 +18,8 @@ import {
|
|||||||
} from "../../../hooks/prices";
|
} from "../../../hooks/prices";
|
||||||
import { tokenNameConverter } from "../../../helpers/tokenConverter";
|
import { tokenNameConverter } from "../../../helpers/tokenConverter";
|
||||||
|
|
||||||
|
import { EMPTY_ADDRESS, WETH_ADDRESSES } from "../../../constants/addresses";
|
||||||
|
|
||||||
const TokenTab = ({ isMobileScreen, theme, tokenName, tokenUrl, tokenUrlParams, balance, price, description }) => {
|
const TokenTab = ({ isMobileScreen, theme, tokenName, tokenUrl, tokenUrlParams, balance, price, description }) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const actualBalance = balance ? balance : new DecimalBigNumber(0, 0);
|
const actualBalance = balance ? balance : new DecimalBigNumber(0, 0);
|
||||||
@ -58,10 +60,13 @@ const TokenTab = ({ isMobileScreen, theme, tokenName, tokenUrl, tokenUrlParams,
|
|||||||
|
|
||||||
<Box display="flex" justifyContent="center" width="100%">
|
<Box display="flex" justifyContent="center" width="100%">
|
||||||
<SecondaryButton
|
<SecondaryButton
|
||||||
onClick={() => navigate({
|
onClick={() => tokenUrlParams
|
||||||
|
? navigate({
|
||||||
pathname: tokenUrl,
|
pathname: tokenUrl,
|
||||||
search: tokenUrlParams.toString()
|
search: tokenUrlParams.toString()
|
||||||
})}
|
})
|
||||||
|
: window.open(tokenUrl, '_blank')
|
||||||
|
}
|
||||||
fullWidth
|
fullWidth
|
||||||
>
|
>
|
||||||
Get {tokenName}
|
Get {tokenName}
|
||||||
@ -142,8 +147,11 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
|||||||
/>
|
/>
|
||||||
<TokenTab
|
<TokenTab
|
||||||
isMobileScreen={isMobileScreen}
|
isMobileScreen={isMobileScreen}
|
||||||
tokenUrl={isNetworkLegacy(chainId) ? "/faucet" : "/wrapper"}
|
tokenUrl="/dex/uniswap"
|
||||||
tokenUrlParams=""
|
tokenUrlParams={createSearchParams({
|
||||||
|
from: `${EMPTY_ADDRESS}`,
|
||||||
|
to: `${WETH_ADDRESSES[chainId]}`,
|
||||||
|
})}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
tokenName={reserveSymbol}
|
tokenName={reserveSymbol}
|
||||||
balance={reserveBalance}
|
balance={reserveBalance}
|
||||||
@ -158,8 +166,7 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
|||||||
<Box width="100%" mt="25px">
|
<Box width="100%" mt="25px">
|
||||||
<TokenTab
|
<TokenTab
|
||||||
isMobileScreen={true}
|
isMobileScreen={true}
|
||||||
tokenUrl={isNetworkLegacy(chainId) ? "/faucet" : "/wrapper"}
|
tokenUrl={"https://ghostchain.io/faucet/"}
|
||||||
tokenUrlParams=""
|
|
||||||
theme={theme}
|
theme={theme}
|
||||||
tokenName={nativeSymbol}
|
tokenName={nativeSymbol}
|
||||||
balance={new DecimalBigNumber(nativeBalance?.value ?? 0n, 18)}
|
balance={new DecimalBigNumber(nativeBalance?.value ?? 0n, 18)}
|
||||||
|
|||||||
@ -4,6 +4,8 @@ export const tokenNameConverter = (chainId, name, address) => {
|
|||||||
case 63:
|
case 63:
|
||||||
name = "wmETC"
|
name = "wmETC"
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
name = "wETH";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { useTokenSymbol, useTokenSymbols } from "../tokens";
|
|||||||
import { getTokenAddress, getTokenIcons, getBondNameDisplayName, getTokenPurchaseLink } from "../helpers";
|
import { getTokenAddress, getTokenIcons, getBondNameDisplayName, getTokenPurchaseLink } from "../helpers";
|
||||||
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
||||||
import { shorten } from "../../helpers";
|
import { shorten } from "../../helpers";
|
||||||
|
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
||||||
|
|
||||||
export const useLiveBonds = (chainId) => {
|
export const useLiveBonds = (chainId) => {
|
||||||
const ftsoPrice = useFtsoPrice(chainId);
|
const ftsoPrice = useFtsoPrice(chainId);
|
||||||
@ -150,7 +151,7 @@ export const useLiveBonds = (chainId) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const zero = new DecimalBigNumber(0n, 0);
|
const zero = new DecimalBigNumber(0n, 0);
|
||||||
const bondName = `${baseTokenSymbol}/${quoteTokenSymbol}`;
|
const bondName = `${baseTokenSymbol}/${tokenNameConverter(chainId, "WETH")}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
@ -163,7 +164,7 @@ export const useLiveBonds = (chainId) => {
|
|||||||
tokenAddress: getTokenAddress(chainId, "FTSO")
|
tokenAddress: getTokenAddress(chainId, "FTSO")
|
||||||
},
|
},
|
||||||
quoteToken: {
|
quoteToken: {
|
||||||
name: quoteTokenSymbol,
|
name: tokenNameConverter(chainId, quoteTokenSymbol),
|
||||||
purchaseUrl: getTokenPurchaseLink(chainId, quoteTokenAddress),
|
purchaseUrl: getTokenPurchaseLink(chainId, quoteTokenAddress),
|
||||||
icons: getTokenIcons(chainId, quoteTokenAddress),
|
icons: getTokenIcons(chainId, quoteTokenAddress),
|
||||||
decimals: quoteTokenDecimals,
|
decimals: quoteTokenDecimals,
|
||||||
@ -172,7 +173,7 @@ export const useLiveBonds = (chainId) => {
|
|||||||
duration: terms?.at(index).result?.at(3) ? terms.at(index).result.at(3) : 0,
|
duration: terms?.at(index).result?.at(3) ? terms.at(index).result.at(3) : 0,
|
||||||
vesting: terms?.at(index).result?.at(2) ? terms.at(index).result.at(2) : 0,
|
vesting: terms?.at(index).result?.at(2) ? terms.at(index).result.at(2) : 0,
|
||||||
isFixedTerm: terms?.at(index).result?.at(0) ? terms.at(index).result.at(0) : true,
|
isFixedTerm: terms?.at(index).result?.at(0) ? terms.at(index).result.at(0) : true,
|
||||||
isSoldOut: capacityInBaseToken.eq(zero) || capacityInBaseToken.eq(zero),
|
isSoldOut: capacityInBaseToken.eq(zero),
|
||||||
price: {
|
price: {
|
||||||
inUsd: priceInUsd,
|
inUsd: priceInUsd,
|
||||||
inBaseToken: quoteTokenPerBaseToken,
|
inBaseToken: quoteTokenPerBaseToken,
|
||||||
@ -250,7 +251,7 @@ export const useNotes = (chainId, address) => {
|
|||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
quoteToken: {
|
quoteToken: {
|
||||||
name: quoteTokenSymbol,
|
name: tokenNameConverter(chainId, quoteTokenSymbol),
|
||||||
icons: getTokenIcons(chainId, quoteTokenAddress),
|
icons: getTokenIcons(chainId, quoteTokenAddress),
|
||||||
},
|
},
|
||||||
vesting: terms?.at(index).result?.at(2) ? terms.at(index).result.at(2) : 0,
|
vesting: terms?.at(index).result?.at(2) ? terms.at(index).result.at(2) : 0,
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import {
|
|||||||
WETH_ADDRESSES,
|
WETH_ADDRESSES,
|
||||||
} from "../constants/addresses";
|
} from "../constants/addresses";
|
||||||
|
|
||||||
|
import { tokenNameConverter } from "../helpers/tokenConverter";
|
||||||
|
|
||||||
import { abi as DaiAbi } from "../abi/Reserve.json";
|
import { abi as DaiAbi } from "../abi/Reserve.json";
|
||||||
import { abi as FatsoAbi } from "../abi/Fatso.json";
|
import { abi as FatsoAbi } from "../abi/Fatso.json";
|
||||||
import { abi as StinkyAbi } from "../abi/Stinky.json";
|
import { abi as StinkyAbi } from "../abi/Stinky.json";
|
||||||
@ -156,7 +158,7 @@ export const getTokenIcons = (chainId, address) => {
|
|||||||
let icons = [""];
|
let icons = [""];
|
||||||
switch (address) {
|
switch (address) {
|
||||||
case RESERVE_ADDRESSES[chainId]:
|
case RESERVE_ADDRESSES[chainId]:
|
||||||
icons = ["WETH"];
|
icons = [tokenNameConverter(chainId, "WETH")];
|
||||||
break;
|
break;
|
||||||
case FTSO_ADDRESSES[chainId]:
|
case FTSO_ADDRESSES[chainId]:
|
||||||
icons = ["FTSO"];
|
icons = ["FTSO"];
|
||||||
@ -178,7 +180,7 @@ export const getTokenIcons = (chainId, address) => {
|
|||||||
|
|
||||||
export const getBondNameDisplayName = (chainId, stringValue, tokenAddress) => {
|
export const getBondNameDisplayName = (chainId, stringValue, tokenAddress) => {
|
||||||
if (tokenAddress.toUpperCase() === FTSO_DAI_LP_ADDRESSES[chainId].toUpperCase()) {
|
if (tokenAddress.toUpperCase() === FTSO_DAI_LP_ADDRESSES[chainId].toUpperCase()) {
|
||||||
stringValue = `LP ${stringValue}`;
|
stringValue = `${stringValue} LP`;
|
||||||
}
|
}
|
||||||
return stringValue;
|
return stringValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user