From 95c1649fb673392ce28beac78236c695559c8588 Mon Sep 17 00:00:00 2001 From: Jadessu Date: Thu, 7 Nov 2024 17:03:44 -0600 Subject: [PATCH 1/3] refactor page header --- .../NetworkSelector/NetworkSelector.tsx | 14 +++++++++++++- .../components/PageHeader/PageHeader.module.css | 17 +++++++++++++++++ src/App/components/PageHeader/PageHeader.tsx | 17 ++++++++++++----- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx b/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx index 27265ddc1c..f49a2dfde6 100644 --- a/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx +++ b/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx @@ -257,6 +257,18 @@ export default function NetworkSelector(props: propsIF) { ) : null, ); + function truncate(str: string, maxLength: number): string { + if (str.length <= maxLength) { + return str; + } else { + const suffix = '...'; + return maxLength > suffix.length + ? str.slice(0, maxLength - suffix.length) + suffix + : str.slice(0, maxLength); + } + } + + return (
1} logo={ lookupChain(chainId) diff --git a/src/App/components/PageHeader/PageHeader.module.css b/src/App/components/PageHeader/PageHeader.module.css index 09803c27a0..a715703e5f 100644 --- a/src/App/components/PageHeader/PageHeader.module.css +++ b/src/App/components/PageHeader/PageHeader.module.css @@ -133,6 +133,23 @@ .logoContainer img:nth-of-type(1) { margin: 0 4px; } + + .primaryHeader{ + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + + } + + .left_side{ + display: flex; + flex-direction: row; + align-items: center; + gap: 1rem; + } + + } @media (max-width: 1200px) { diff --git a/src/App/components/PageHeader/PageHeader.tsx b/src/App/components/PageHeader/PageHeader.tsx index 7f300d6953..66d9412e5f 100644 --- a/src/App/components/PageHeader/PageHeader.tsx +++ b/src/App/components/PageHeader/PageHeader.tsx @@ -36,7 +36,7 @@ import { GraphDataContext } from '../../../contexts/GraphDataContext'; import { TokenBalanceContext } from '../../../contexts/TokenBalanceContext'; import { TradeDataContext } from '../../../contexts/TradeDataContext'; import { ReceiptContext } from '../../../contexts/ReceiptContext'; -import { BrandContext, BrandContextIF } from '../../../contexts/BrandContext'; +// import { BrandContext, BrandContextIF } from '../../../contexts/BrandContext'; import styles from './PageHeader.module.css'; import { useBottomSheet } from '../../../contexts/BottomSheetContext'; @@ -46,7 +46,7 @@ const PageHeader = function () { setCrocEnv, chainData: { chainId, poolIndex: poolId }, } = useContext(CrocEnvContext); - const { headerImage } = useContext(BrandContext); + // const { headerImage } = useContext(BrandContext); const { walletModal: { open: openWalletModal }, @@ -424,13 +424,14 @@ const PageHeader = function () { appHeaderDropdown.setIsActive(false); } }} + className={styles.left_side} > - {desktopScreen ? ( + {/* {desktopScreen ? ( ambient ) : ( ambient - )} + )} */} + ambient -
{routeDisplay} +
{show ? (
From ffa03424f01da92d9598d803a04854f2e991a933 Mon Sep 17 00:00:00 2001 From: Ben Wolski <570819+benwolski@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:59:31 -0500 Subject: [PATCH 2/3] remove commented code --- src/App/components/PageHeader/PageHeader.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/App/components/PageHeader/PageHeader.tsx b/src/App/components/PageHeader/PageHeader.tsx index 0c29a44911..e792e1ba00 100644 --- a/src/App/components/PageHeader/PageHeader.tsx +++ b/src/App/components/PageHeader/PageHeader.tsx @@ -452,16 +452,6 @@ const PageHeader = function () { className={styles.logoContainer} aria-label='Home' > - {/* {desktopScreen ? ( - ambient - ) : ( - ambient - )} */} Date: Mon, 11 Nov 2024 16:07:57 -0500 Subject: [PATCH 3/3] fix link to Canto.io --- README.md | 3 +-- .../components/PageHeader/NetworkSelector/NetworkSelector.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c6c02bab15..d27cd7a968 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Note: Node v18+ is required Configure your build environment by adding a dotfile (e.g. `.env.local`) with variable definitions to the top level directory before starting the server. Please reference `.gitignore` in the root directory for dotfile naming conventions. - #### Infura This is a key for the Infura API which is used to pull metadata from on-chain. @@ -68,7 +67,7 @@ Code changes are viewable on GitHub [Link](https://github.com/CrocSwap/ambient-t Summary: - Added the ability to switch to the Scroll network and a test network (Görli) using the network selector in the page header -- Added an external link to [Canto](https://beta.canto.io/lp) in the network selector +- Added an external link to [Canto](https://www.canto.io/lp) in the network selector - Updated the pool initialization form to enable additionally minting of an initial liquidity position - Fixed a bug preventing approvals of certain tokens (thanks [busimus](https://github.com/busimus)!) - Added the ability to annotate the price charts with trend lines and horizontal rays diff --git a/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx b/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx index 84405c3aef..2ddcbf851b 100644 --- a/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx +++ b/src/App/components/PageHeader/NetworkSelector/NetworkSelector.tsx @@ -167,7 +167,7 @@ export default function NetworkSelector(props: propsIF) { custom: 1, isExternal: true, testnet: false, - link: 'https://app.canto.io/lp', + link: 'https://www.canto.io/lp', condition: includeCanto && platformName === 'ambient', }, {