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",
|
||||
"private": true,
|
||||
"version": "0.6.11",
|
||||
"version": "0.6.12",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -26,7 +26,7 @@ import HubIcon from '@mui/icons-material/Hub';
|
||||
import PublicIcon from '@mui/icons-material/Public';
|
||||
import ForkRightIcon from '@mui/icons-material/ForkRight';
|
||||
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 BookIcon from '@mui/icons-material/Book';
|
||||
import CurrencyExchangeIcon from '@mui/icons-material/CurrencyExchange';
|
||||
@ -129,7 +129,7 @@ const NavContent = ({ chainId, addressChainId }) => {
|
||||
</AccordionDetails>
|
||||
}
|
||||
/>
|
||||
<NavItem icon={StakeIcon} label={`(3, 3) Staking`} to="/stake" />
|
||||
<NavItem icon={StakeIcon} label={`(3, 3) Stake`} to="/stake" />
|
||||
<NavItem
|
||||
defaultExpanded
|
||||
icon={BondIcon}
|
||||
@ -166,7 +166,7 @@ const NavContent = ({ chainId, addressChainId }) => {
|
||||
</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" />}
|
||||
<Box className="menu-divider">
|
||||
<Divider />
|
||||
@ -179,9 +179,8 @@ const NavContent = ({ chainId, addressChainId }) => {
|
||||
|
||||
<Box>
|
||||
<NavItem href="http://ecosystem.ghostchain.io" icon={PublicIcon} label={`Ecosystem`} />
|
||||
<NavItem href="http://ghostchain.io/builders" icon={ForumIcon} label={`Forum`} />
|
||||
<NavItem href="https://docs.ghostchain.io/" icon={BookIcon} label={`Docs`} />
|
||||
<NavItem href="https://git.ghostchain.io/ghostchain/ghost-dao-contracts/issues" icon={ErrorOutlineIcon} label={`Git Issues`} />
|
||||
<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={`Documentation`} />
|
||||
<StyledBox display="flex" justifyContent="space-around" paddingY="24px">
|
||||
<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} />
|
||||
|
||||
@ -235,7 +235,6 @@ export const useWallet = (chainId, userAddress) => {
|
||||
balance: nativeBalance,
|
||||
price: nativePrice,
|
||||
refetch: nativeBalanceRefetch,
|
||||
faucetPath: isNetworkLegacy(chainId) ? "/faucet" : "/wrapper",
|
||||
},
|
||||
reserve: {
|
||||
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/11/6A-Classic-ETC-Token.svg",
|
||||
refetch: reserveRefetch,
|
||||
faucetPath: isNetworkLegacy(chainId) ? "/faucet" : "/wrapper",
|
||||
},
|
||||
ftso: {
|
||||
symbol: ftsoSymbol,
|
||||
|
||||
@ -18,6 +18,8 @@ import {
|
||||
} from "../../../hooks/prices";
|
||||
import { tokenNameConverter } from "../../../helpers/tokenConverter";
|
||||
|
||||
import { EMPTY_ADDRESS, WETH_ADDRESSES } from "../../../constants/addresses";
|
||||
|
||||
const TokenTab = ({ isMobileScreen, theme, tokenName, tokenUrl, tokenUrlParams, balance, price, description }) => {
|
||||
const navigate = useNavigate();
|
||||
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%">
|
||||
<SecondaryButton
|
||||
onClick={() => navigate({
|
||||
pathname: tokenUrl,
|
||||
search: tokenUrlParams.toString()
|
||||
})}
|
||||
onClick={() => tokenUrlParams
|
||||
? navigate({
|
||||
pathname: tokenUrl,
|
||||
search: tokenUrlParams.toString()
|
||||
})
|
||||
: window.open(tokenUrl, '_blank')
|
||||
}
|
||||
fullWidth
|
||||
>
|
||||
Get {tokenName}
|
||||
@ -142,8 +147,11 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
/>
|
||||
<TokenTab
|
||||
isMobileScreen={isMobileScreen}
|
||||
tokenUrl={isNetworkLegacy(chainId) ? "/faucet" : "/wrapper"}
|
||||
tokenUrlParams=""
|
||||
tokenUrl="/dex/uniswap"
|
||||
tokenUrlParams={createSearchParams({
|
||||
from: `${EMPTY_ADDRESS}`,
|
||||
to: `${WETH_ADDRESSES[chainId]}`,
|
||||
})}
|
||||
theme={theme}
|
||||
tokenName={reserveSymbol}
|
||||
balance={reserveBalance}
|
||||
@ -158,8 +166,7 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
<Box width="100%" mt="25px">
|
||||
<TokenTab
|
||||
isMobileScreen={true}
|
||||
tokenUrl={isNetworkLegacy(chainId) ? "/faucet" : "/wrapper"}
|
||||
tokenUrlParams=""
|
||||
tokenUrl={"https://ghostchain.io/faucet/"}
|
||||
theme={theme}
|
||||
tokenName={nativeSymbol}
|
||||
balance={new DecimalBigNumber(nativeBalance?.value ?? 0n, 18)}
|
||||
|
||||
@ -4,6 +4,8 @@ export const tokenNameConverter = (chainId, name, address) => {
|
||||
case 63:
|
||||
name = "wmETC"
|
||||
break;
|
||||
default:
|
||||
name = "wETH";
|
||||
}
|
||||
}
|
||||
return name;
|
||||
|
||||
@ -20,6 +20,7 @@ import { useTokenSymbol, useTokenSymbols } from "../tokens";
|
||||
import { getTokenAddress, getTokenIcons, getBondNameDisplayName, getTokenPurchaseLink } from "../helpers";
|
||||
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
||||
import { shorten } from "../../helpers";
|
||||
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
||||
|
||||
export const useLiveBonds = (chainId) => {
|
||||
const ftsoPrice = useFtsoPrice(chainId);
|
||||
@ -150,7 +151,7 @@ export const useLiveBonds = (chainId) => {
|
||||
);
|
||||
|
||||
const zero = new DecimalBigNumber(0n, 0);
|
||||
const bondName = `${baseTokenSymbol}/${quoteTokenSymbol}`;
|
||||
const bondName = `${baseTokenSymbol}/${tokenNameConverter(chainId, "WETH")}`;
|
||||
|
||||
return {
|
||||
id,
|
||||
@ -163,7 +164,7 @@ export const useLiveBonds = (chainId) => {
|
||||
tokenAddress: getTokenAddress(chainId, "FTSO")
|
||||
},
|
||||
quoteToken: {
|
||||
name: quoteTokenSymbol,
|
||||
name: tokenNameConverter(chainId, quoteTokenSymbol),
|
||||
purchaseUrl: getTokenPurchaseLink(chainId, quoteTokenAddress),
|
||||
icons: getTokenIcons(chainId, quoteTokenAddress),
|
||||
decimals: quoteTokenDecimals,
|
||||
@ -172,7 +173,7 @@ export const useLiveBonds = (chainId) => {
|
||||
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,
|
||||
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: {
|
||||
inUsd: priceInUsd,
|
||||
inBaseToken: quoteTokenPerBaseToken,
|
||||
@ -250,7 +251,7 @@ export const useNotes = (chainId, address) => {
|
||||
return {
|
||||
id,
|
||||
quoteToken: {
|
||||
name: quoteTokenSymbol,
|
||||
name: tokenNameConverter(chainId, quoteTokenSymbol),
|
||||
icons: getTokenIcons(chainId, quoteTokenAddress),
|
||||
},
|
||||
vesting: terms?.at(index).result?.at(2) ? terms.at(index).result.at(2) : 0,
|
||||
|
||||
@ -7,6 +7,8 @@ import {
|
||||
WETH_ADDRESSES,
|
||||
} from "../constants/addresses";
|
||||
|
||||
import { tokenNameConverter } from "../helpers/tokenConverter";
|
||||
|
||||
import { abi as DaiAbi } from "../abi/Reserve.json";
|
||||
import { abi as FatsoAbi } from "../abi/Fatso.json";
|
||||
import { abi as StinkyAbi } from "../abi/Stinky.json";
|
||||
@ -156,7 +158,7 @@ export const getTokenIcons = (chainId, address) => {
|
||||
let icons = [""];
|
||||
switch (address) {
|
||||
case RESERVE_ADDRESSES[chainId]:
|
||||
icons = ["WETH"];
|
||||
icons = [tokenNameConverter(chainId, "WETH")];
|
||||
break;
|
||||
case FTSO_ADDRESSES[chainId]:
|
||||
icons = ["FTSO"];
|
||||
@ -178,7 +180,7 @@ export const getTokenIcons = (chainId, address) => {
|
||||
|
||||
export const getBondNameDisplayName = (chainId, stringValue, tokenAddress) => {
|
||||
if (tokenAddress.toUpperCase() === FTSO_DAI_LP_ADDRESSES[chainId].toUpperCase()) {
|
||||
stringValue = `LP ${stringValue}`;
|
||||
stringValue = `${stringValue} LP`;
|
||||
}
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user