Skip to content

Commit

Permalink
Merge pull request #155 from lidofinance/feature/ui-782-fix-wcv2-warn…
Browse files Browse the repository at this point in the history
…ing-overflowing-header-on-easy-track

WCv2 warning header overflow
  • Loading branch information
itaven authored Jun 28, 2023
2 parents b47f360 + bef8248 commit da99491
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 43 deletions.
70 changes: 36 additions & 34 deletions modules/shared/ui/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,42 @@ export function Header() {
</BurgerWrap>

{isBurgerOpened && (
<MobileMenu>
<MobileMenuScroll>
<MobileNavItems>
<NavItem
link={urls.home}
icon={<ActiveMotionsSVG />}
children="Active motions"
onClick={handleCloseMobileMenu}
/>
<NavItem
link={urls.archive}
icon={<ArchiveSVG />}
children="Archive"
onClick={handleCloseMobileMenu}
/>
<NavItem
link={urls.startMotion}
icon={<StartSVG />}
children="Start motion"
onClick={handleCloseMobileMenu}
/>
{/* <NavItem link={urls.about} icon={<InfoSVG />} children="About" /> */}
</MobileNavItems>
<MobileNetworkWrap>
<Network>
<NetworkBulb color={getChainColor(chainId)} />
<Text size={14} weight={500}>
{getChainName(chainId)}
</Text>
</Network>
<HeaderWallet />
</MobileNetworkWrap>
</MobileMenuScroll>
</MobileMenu>
<>
<MobileNavItems>
<NavItem
link={urls.home}
icon={<ActiveMotionsSVG />}
children="Active motions"
onClick={handleCloseMobileMenu}
/>
<NavItem
link={urls.archive}
icon={<ArchiveSVG />}
children="Archive"
onClick={handleCloseMobileMenu}
/>
<NavItem
link={urls.startMotion}
icon={<StartSVG />}
children="Start motion"
onClick={handleCloseMobileMenu}
/>
</MobileNavItems>

<MobileMenu>
<MobileMenuScroll>
<MobileNetworkWrap>
<Network>
<NetworkBulb color={getChainColor(chainId)} />
<Text size={14} weight={500}>
{getChainName(chainId)}
</Text>
</Network>
<HeaderWallet />
</MobileNetworkWrap>
</MobileMenuScroll>
</MobileMenu>
</>
)}
</Wrap>
<MobileSpacer />
Expand Down
12 changes: 7 additions & 5 deletions modules/shared/ui/Layout/Header/HeaderStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ import styled, { css, keyframes } from 'styled-components'
import { BREAKPOINT_MOBILE } from 'modules/globalStyles'

export const Wrap = styled.div`
position: relative;
margin-bottom: 30px;
padding: 20px 0;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 99;
margin-bottom: ${({ theme }) => theme.spaceMap.xxl}px;
@media (max-width: ${BREAKPOINT_MOBILE}) {
position: fixed;
left: 20px;
top: 0;
right: 20px;
${({ theme }) => theme.mediaQueries.lg} {
margin-bottom: ${({ theme }) => theme.spaceMap.lg}px;
}
`

Expand Down Expand Up @@ -183,6 +182,9 @@ export const MobileMenuScroll = styled.div`
`

export const MobileNavItems = styled.div`
position: absolute;
top: 100%;
z-index: 100;
display: flex;
flex-direction: column;
margin-bottom: 20px;
Expand Down
8 changes: 7 additions & 1 deletion modules/shared/utils/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ export const contentSecurityPolicy = {
directives: {
styleSrc: ["'self'", 'https://fonts.googleapis.com', "'unsafe-inline'"],
fontSrc: ["'self'", 'https://fonts.gstatic.com', ...trustedHosts],
imgSrc: ["'self'", 'data:', 'https://*.walletconnect.org', ...trustedHosts],
imgSrc: [
"'self'",
'data:',
'https://*.walletconnect.org',
'https://*.walletconnect.com',
...trustedHosts,
],
scriptSrc: ["'self'", "'unsafe-eval'", "'unsafe-inline'", ...trustedHosts],
connectSrc: [
"'self'",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:dockerfile": "dockerfilelint Dockerfile",
"lint": "eslint --ext ts,tsx,js,jsx .",
"lint:fix": "yarn lint --fix",
"lint:dockerfile": "dockerfilelint Dockerfile",
"typechain": "typechain --target=ethers-v5 --out-dir ./generated './abi/**/*.json'",
"postinstall": "husky install && yarn typechain || true",
"test": "jest"
},
"type": "module",
"lint-staged": {
"./**/*.{ts,tsx}": [
"./**/*.{ts,tsx,js,jsx}": [
"eslint --ignore-path .gitignore --max-warnings=0"
],
"./**/*.{ts,tsx,css,md,json}": [
Expand Down

0 comments on commit da99491

Please sign in to comment.