From b16fba03f4c21ec0969ac444c654d27e957b6cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Diego=20Garc=C3=ADa?= Date: Fri, 9 Apr 2021 16:36:14 -0500 Subject: [PATCH] Mobile design fixes (#58) * fixed navbar and overall mobile css for home page * fixed menu witdh * fixed mobile css on transfer page * fix: padding on settings button --- packages/bridge/src/App.less | 4 - .../bridge/src/components/AppBar/index.less | 74 ++++- .../bridge/src/components/AppBar/index.tsx | 79 +++++- .../bridge/src/components/Layout/index.tsx | 27 +- .../RecentTransactionsTable/index.tsx | 1 + .../bridge/src/components/Transfer/index.tsx | 265 +++++++++--------- .../bridge/src/components/Transfer/style.less | 49 +++- packages/bridge/src/index.css | 7 - packages/bridge/src/views/home/index.less | 57 +++- packages/bridge/src/views/home/index.tsx | 3 +- 10 files changed, 362 insertions(+), 204 deletions(-) diff --git a/packages/bridge/src/App.less b/packages/bridge/src/App.less index ee32476..86561c5 100644 --- a/packages/bridge/src/App.less +++ b/packages/bridge/src/App.less @@ -140,10 +140,6 @@ em { padding: 6px 16px !important; } -.ant-table { - margin: 0px 30px; -} - .ant-menu-inline-collapsed > .ant-menu-item { padding-left: 16px !important; } diff --git a/packages/bridge/src/components/AppBar/index.less b/packages/bridge/src/components/AppBar/index.less index 7888594..0d8ac1c 100644 --- a/packages/bridge/src/components/AppBar/index.less +++ b/packages/bridge/src/components/AppBar/index.less @@ -1,5 +1,22 @@ @import "_colors"; -.app-left { + + +header.ant-layout-header.App-Bar { + position: absolute; + width: 100%; + background: transparent; + display: flex; + justify-content: center; + height: 80px; + + .nav-burger { + cursor: pointer; + display: none; + } + +} + +.app-bar-item.logo { position: absolute; left: 10%; } @@ -12,6 +29,7 @@ min-width: 50%; justify-content: center; height: auto; + align-items: center; .app-bar-item { cursor: pointer; padding: 0 30px; @@ -25,3 +43,57 @@ } } } + +@media screen and (min-width: 901px) { + header.ant-layout-header.App-Bar { + width: 100% !important; + } +} +@media screen and (max-width: 1200px) { + + .app-bar-item.logo { + position: relative; + left: 0; + } + .app-bar-item.app-right{ + position: relative; + left: 0; + padding: 0; + } +} +@media screen and (max-width: 900px) { + header.ant-layout-header.App-Bar { + position: fixed; + transition: ease-in-out 0.5s; + width: 0; + max-width: 240px; + height: 100%; + flex-direction: column; + justify-content: flex-start; + padding: 0; + .nav-burger { + display: inline-block; + left: 30px; + position: relative; + transition: ease-in-out 0.5s; + z-index: 10; + } + .app-bar-inner { + //opacity: 0; + left: -100px; + position: relative; + transition: ease-in-out 0.5s; + flex-direction: column; + } + background: #06101a; + & > .nav-burger.mobile-active { + width: 30px; + position: relative; + left: 0; + } + + .app-bar-inner.mobile-active { + left: 0px; + } + } +} diff --git a/packages/bridge/src/components/AppBar/index.tsx b/packages/bridge/src/components/AppBar/index.tsx index f34ff3c..51174b9 100644 --- a/packages/bridge/src/components/AppBar/index.tsx +++ b/packages/bridge/src/components/AppBar/index.tsx @@ -1,8 +1,17 @@ -import React, { useCallback } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import './index.less'; import { Link, useLocation } from 'react-router-dom'; +import { + MenuFoldOutlined, + MenuUnfoldOutlined, + SettingOutlined, +} from '@ant-design/icons'; +import { Button, Popover } from 'antd'; +import { LABELS } from '../../constants'; +import { Settings } from '@oyster/common'; -export const AppBar = () => { +export const AppBar = (props: { isRoot?: boolean }) => { + const [showMobileMenu, setShowMobileMenu] = useState(false); const location = useLocation(); const isActiveClass = useCallback( @@ -12,20 +21,60 @@ export const AppBar = () => { [location], ); + useEffect(() => { + const header = document.getElementById('app-header'); + if (header) { + header.style.width = showMobileMenu ? '100%' : '0'; + } + }, [showMobileMenu, document.body.offsetWidth]); + return ( -
-
- Bridge + <> + setShowMobileMenu(!showMobileMenu)} + > + {showMobileMenu ? ( + + ) : ( + + )} + +
+ {!props.isRoot && ( +
+ logo-bar +
+ )} +
+ Bridge +
+
+ FAQ +
+
+ Proof-of-Assets +
+
+ Help +
+ {!props.isRoot && ( + } + trigger="click" + > +
-
- FAQ -
-
- Proof-of-Assets -
-
- Help -
-
+ ); }; diff --git a/packages/bridge/src/components/Layout/index.tsx b/packages/bridge/src/components/Layout/index.tsx index df0e19f..4745cf9 100644 --- a/packages/bridge/src/components/Layout/index.tsx +++ b/packages/bridge/src/components/Layout/index.tsx @@ -33,31 +33,8 @@ export const AppLayout = React.memo((props: any) => { <>
-
- {!isRoot && ( -
- - logo-bar - -
- )} - - {!isRoot && ( - } - trigger="click" - > -