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

Improve header 3 #605

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion src/custom/components/AffiliateStatusCheck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function AffiliateStatusCheck() {
setAffiliateState('OWN_LINK')

if (referralAddressQueryParam) {
history.push('/profile' + location.search)
history.push('/account' + location.search)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a note here to update the path with @nenadV91 's changes where affiliate has it's own subpath now

}
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/custom/components/CowBalanceButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { transparentize } from 'polished'
export const Wrapper = styled.div<{ isLoading: boolean }>`
background-color: ${({ theme }) => theme.bg4};
color: ${({ theme }) => theme.text1};
padding: 6px 12px;
padding: 7px 12px;
border: 1px solid transparent;
font-weight: 500;
display: flex;
Expand Down
12 changes: 9 additions & 3 deletions src/custom/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const StyledNavLink = styled(StyledNavLinkUni)`

const BalanceText = styled(BalanceTextUni)`
font-weight: 500;
padding: 0 12px;
padding: 0 0 0 12px;

${({ theme }) => theme.mediaWidth.upToMedium`
overflow: hidden;
Expand Down Expand Up @@ -228,6 +228,10 @@ const AccountElement = styled(AccountElementUni)<{ active: boolean }>`
&:focus {
border: 1px solid ${({ theme }) => transparentize(0.4, theme.text1)};
}

${BalanceText} {
min-width: initial;
}
`

export default function Header() {
Expand All @@ -249,7 +253,7 @@ export default function Header() {
const isMenuOpen = useModalOpen(ApplicationModal.MENU)

const history = useHistory()
const handleBalanceButtonClick = () => history.push('/profile')
const handleBalanceButtonClick = () => history.push('/account')

// Toggle the 'noScroll' class on body, whenever the orders panel or flyout menu is open.
// This removes the inner scrollbar on the page body, to prevent showing double scrollbars.
Expand All @@ -273,7 +277,9 @@ export default function Header() {
</Title>
<HeaderLinks>
<StyledNavLink to="/swap">Swap</StyledNavLink>
<StyledNavLink to="/profile">Profile</StyledNavLink>
<StyledNavLink to="/account">Account</StyledNavLink>
<StyledNavLink to="/faq">FAQ</StyledNavLink>
<StyledNavLink to="/swap">More</StyledNavLink>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More goes to swap?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in the last PR (#596)

</HeaderLinks>
</HeaderRow>

Expand Down
6 changes: 3 additions & 3 deletions src/custom/components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function Menu({ darkMode, toggleDarkMode }: MenuProps) {
const history = useHistory()
const handleBalanceButtonClick = () => {
close()
history.push('/profile')
history.push('/account')
}

return (
Expand All @@ -292,8 +292,8 @@ export function Menu({ darkMode, toggleDarkMode }: MenuProps) {
<ResponsiveInternalMenuItem to="/" onClick={close}>
<Repeat size={14} /> Swap
</ResponsiveInternalMenuItem>
<ResponsiveInternalMenuItem to="/profile" onClick={close}>
<User size={14} /> Profile
<ResponsiveInternalMenuItem to="/account" onClick={close}>
<User size={14} /> Account
</ResponsiveInternalMenuItem>
<InternalMenuItem to="/about" onClick={close}>
<Star size={14} />
Expand Down
2 changes: 1 addition & 1 deletion src/custom/constants/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const ADDRESS_IMAGE_OVERRIDE = {

/**
* Addresses related to COW vesting for Locked GNO
* These are used in src/custom/pages/Profile/LockedGnoVesting hooks and index files
* These are used in src/custom/pages/Account/LockedGnoVesting hooks and index files
*/
export const MERKLE_DROP_CONTRACT_ADDRESSES: Record<number, string> = {
[SupportedChainId.MAINNET]: '0x64646f112FfD6F1B7533359CFaAF7998F23C8c40',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Trans } from '@lingui/macro'
import { useCallback, useState, useEffect } from 'react'
import SVG from 'react-inlinesvg'
import { Card, BalanceDisplay, ConvertWrapper, VestingBreakdown, CardActions, ExtLink } from 'pages/Profile/styled'
import { Card, BalanceDisplay, ConvertWrapper, VestingBreakdown, CardActions, ExtLink } from 'pages/Account/styled'
import { ButtonPrimary } from 'custom/components/Button'
import { HelpCircle } from 'components/Page'
import { MouseoverTooltipContent } from 'components/Tooltip'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
BannerCardSvg,
CardsLoader,
CardsSpinner,
} from 'pages/Profile/styled'
} from '@src/custom/pages/Account/styled'
import { useActiveWeb3React } from 'hooks/web3'
import Copy from 'components/Copy/CopyMod'
import { RefreshCcw } from 'react-feather'
Expand Down Expand Up @@ -63,7 +63,7 @@ import { SwapVCowStatus } from 'state/cowToken/actions'
import LockedGnoVesting from './LockedGnoVesting'
import useBlockNumber from 'lib/hooks/useBlockNumber'
import usePrevious from 'hooks/usePrevious'
import { useCowFromLockedGnoBalances } from 'pages/Profile/LockedGnoVesting/hooks'
import { useCowFromLockedGnoBalances } from '@src/custom/pages/Account/LockedGnoVesting/hooks'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the imports here (line 27 and 66) be from @srcpages/custom/pages/Account rather than pages/Account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right. I believe this has been fixed in improve-header-12 (last branch).


const COW_DECIMALS = COW[ChainId.MAINNET].decimals

Expand Down Expand Up @@ -250,7 +250,7 @@ export default function Profile() {
<ErrorModal />

{chainId && chainId === ChainId.MAINNET && <AffiliateStatusCheck />}
<Title>Profile</Title>
<Title>Account</Title>

<CardsWrapper>
{isCardsLoading ? (
Expand Down
7 changes: 4 additions & 3 deletions src/custom/pages/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PrivacyPolicy = lazy(() => import(/* webpackChunkName: "privacy_policy" */
const CookiePolicy = lazy(() => import(/* webpackChunkName: "cookie_policy" */ 'pages/CookiePolicy'))
const TermsAndConditions = lazy(() => import(/* webpackChunkName: "terms" */ 'pages/TermsAndConditions'))
const About = lazy(() => import(/* webpackChunkName: "about" */ 'pages/About'))
const Profile = lazy(() => import(/* webpackChunkName: "profile" */ 'pages/Profile'))
const Account = lazy(() => import(/* webpackChunkName: "profile" */ '@src/custom/pages/Account'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Account = lazy(() => import(/* webpackChunkName: "profile" */ '@src/custom/pages/Account'))
const Account = lazy(() => import(/* webpackChunkName: "profile" */ 'pages/Account'))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it looks like in the last branch (improve-header-12)

const Account = lazy(() => import(/* webpackChunkName: "profile" */ '@src/custom/pages/Account'))

Let me know if that should be changed to your suggestion:

const Account = lazy(() => import(/* webpackChunkName: "profile" */ 'pages/Account'))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see.
I'd that, unless it doesn't work without @src/custom, prefer the relative path

const NotFound = lazy(() => import(/* webpackChunkName: "not_found" */ 'pages/error/NotFound'))
const CowRunner = lazy(() => import(/* webpackChunkName: "cow_runner" */ 'pages/games/CowRunner'))
const MevSlicer = lazy(() => import(/* webpackChunkName: "mev_slicer" */ 'pages/games/MevSlicer'))
Expand Down Expand Up @@ -94,12 +94,13 @@ export default function App() {
<Wrapper>
<Suspense fallback={Loading}>
<Switch>
<Redirect from="/claim" to="/profile" />
<Redirect from="/claim" to="/account" />
<Redirect from="/profile" to="/account" />
<Route exact strict path="/swap" component={Swap} />
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
<Route exact strict path="/about" component={About} />
<Route exact strict path="/profile" component={Profile} />
<Route exact strict path="/account" component={Account} />

<Route exact path="/faq" component={Faq} />
<Route exact strict path="/faq/protocol" component={ProtocolFaq} />
Expand Down
2 changes: 1 addition & 1 deletion src/custom/pages/Claim/ClaimingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default function ClaimingStatus({ handleChangeAccount }: ClaimNavProps) {
</SuccessBanner>
</ExternalLink>
{isSelfClaiming && (
<Link to="/profile">
<Link to="/account">
<SuccessBanner type={'Profile'}>
<span>
<Trans>View vCOW balance</Trans>
Expand Down