From 305fa47ee9956d67812c739dcda569c023d1dd9e Mon Sep 17 00:00:00 2001 From: nikhil arora Date: Thu, 9 Feb 2023 23:50:00 +0530 Subject: [PATCH] style: nav bars style improvement --- packages/frontend/package.json | 1 - .../LandingPage/DesktopLandingPage.tsx | 41 ++-- .../LandingPage/MobileLandingPage.tsx | 64 ++++-- packages/frontend/src/components/Nav.tsx | 188 ++++++++++-------- yarn.lock | 7 - 5 files changed, 170 insertions(+), 131 deletions(-) diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 4b450390e..d4244ce5f 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -57,7 +57,6 @@ "fzero": "^0.2.4", "graphql": "^16.1.0", "gray-matter": "^4.0.3", - "hamburger-react": "^2.5.0", "highcharts": "^10.2.1", "highcharts-react-official": "^3.1.0", "javascript-time-ago": "^2.5.7", diff --git a/packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx b/packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx index 3f592322b..c911ca9c0 100644 --- a/packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx +++ b/packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react' import { makeStyles, createStyles } from '@material-ui/core/styles' -import logo from 'public/images/OpynLogo.svg' +import logo from 'public/images/logo.png' import LandingPageBackground from 'public/images/landing/athena1-desktop.png' import LandingPageBackgroundDown from 'public/images/landing-page-background-down.svg' import LandingTitle from 'public/images/landing/landing-title.png' @@ -31,7 +31,8 @@ const useStyles = makeStyles((theme) => overflow: 'hidden', }, logo: { - cursor: 'pointer', + display: 'flex', + alignItems: 'center', }, gradientText: { background: `linear-gradient(180deg, #FFFFFF 0%, #C2C2C2 100%)`, @@ -281,9 +282,6 @@ const useStyles = makeStyles((theme) => alignItems: 'center', gap: `${vwCalculator(9)}`, }, - socialIcon: { - cursor: 'pointer', - }, }), ) @@ -320,11 +318,12 @@ function DesktopLandingPage() { return (
-
- - logo - -
+ + + logo + + +
{navLinks.map((link) => (
- logo + logo
SQUEETH @@ -436,7 +435,7 @@ function DesktopLandingPage() {
- logo + logo
STRATEGIES @@ -480,7 +479,7 @@ function DesktopLandingPage() {
- logo + logo
AUCTION @@ -526,22 +525,30 @@ function DesktopLandingPage() {
track(LANDING_EVENTS.NAV_SOCIAL_TWITTER)}> - Opyn Twitter + + Opyn Twitter +
track(LANDING_EVENTS.NAV_SOCIAL_DISCORD)}> - Opyn Discord + + Opyn Discord +
track(LANDING_EVENTS.NAV_SOCIAL_GITHUB)}> - Opyn Github + + Opyn Github +
track(LANDING_EVENTS.NAV_SOCIAL_MEDIUM)}> - Opyn Medium + + Opyn Medium +
diff --git a/packages/frontend/src/components/LandingPage/MobileLandingPage.tsx b/packages/frontend/src/components/LandingPage/MobileLandingPage.tsx index 9a27f2882..ec10e2ab8 100644 --- a/packages/frontend/src/components/LandingPage/MobileLandingPage.tsx +++ b/packages/frontend/src/components/LandingPage/MobileLandingPage.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react' import { makeStyles, createStyles } from '@material-ui/core/styles' -import { Paper } from '@material-ui/core' -import Hamburger from 'hamburger-react' +import { Paper, IconButton } from '@material-ui/core' +import MenuIcon from '@material-ui/icons/Menu' import Collapse from '@material-ui/core/Collapse' -import logo from 'public/images/OpynLogo.svg' +import logo from 'public/images/logo.png' import LandingPageBackgroundOne from 'public/images/landing/athena1.png' import LandingPageBackgroundTwo from 'public/images/landing/athena2.png' import LandingPageBackgroundThree from 'public/images/landing/athena3.png' @@ -45,7 +45,7 @@ const useStyles = makeStyles((theme) => overflow: 'hidden', }, nav: { - padding: `0px ${vwCalculator(10)}`, + padding: `8px ${vwCalculator(10)}`, display: 'flex', alignItems: 'center', boxShadow: '0px 3px 4px rgba(0, 0, 0, 0.2)', @@ -55,7 +55,12 @@ const useStyles = makeStyles((theme) => margin: `0 ${vwCalculator(10)}`, position: 'absolute', }, - navLogo: { flex: 1, alignItems: 'center', justifyContent: 'center', display: 'flex' }, + navLogo: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + display: 'flex', + }, navDrawer: {}, navDrawerBackground: { backgroundColor: '#191B1C', @@ -284,8 +289,11 @@ const useStyles = makeStyles((theme) => alignItems: 'center', gap: `${vwCalculator(9)}`, }, - socialIcon: { - cursor: 'pointer', + menuButton: { + padding: 0, + '&:hover': { + backgroundColor: 'transparent', + }, }, }), ) @@ -321,17 +329,25 @@ function MobileLandingPage() { track(LANDING_EVENTS.LANDING_VISIT_MOBILE) }, [track]) + const handleNavOpen = () => { + setNavOpen(!navOpen) + } + return (
- -
-
- - logo - + + +
+ + + + logo + + +
- {toTokenAmount(balance ?? BIG_ZERO, 18).toFixed(4)} ETH - setNavOpen(true)}> - - - setNavOpen(false)}> -
-
- - -
- - - - - track(SITE_EVENTS.NAV_AUCTION)} - > - - Auction - + - + +
+ +
+ {toTokenAmount(balance ?? BIG_ZERO, 18).toFixed(4)} ETH + setNavOpen(true)} className={classes.menuButton}> + + + setNavOpen(false)}> +
+
+ + +
+ + + + + track(SITE_EVENTS.NAV_AUCTION)} + > + + Auction + + + + track(SITE_EVENTS.NAV_FAQ)} + > + + FAQ + + +
+
+
diff --git a/yarn.lock b/yarn.lock index ba7ba7737..5faa15bb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14784,11 +14784,6 @@ growl@1.10.5: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -hamburger-react@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hamburger-react/-/hamburger-react-2.5.0.tgz#7c0148af8f02f3b693564d69e590d02db8ffc221" - integrity sha512-5GSXe+ucxTPJ0SkhIsPQ/PRDweZPIKya1lfahAuExx31SdheeUA4uOPfQIAirbKona8hvo79VDr5LJQzPXsdpw== - handlebars@^4.0.1, handlebars@^4.7.6: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -22317,8 +22312,6 @@ set-interval-async@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/set-interval-async/-/set-interval-async-2.0.3.tgz#8d9e4904deaf8406fd98219c67fd9ef469f5fae2" integrity sha512-8jJgvnhQYQc+XHzyKuJ2g4/0h4jPcT/q3x9VURk+AZohRKpcggcueNhPbS7wOXnamgpAn/enbGl4OnWXurVafg== - dependencies: - "@babel/runtime" "7.5.0" set-value@^2.0.0, set-value@^2.0.1: version "2.0.1"