From 1fbd5f4b043c0b0956d926f5b03a441fc4e0d6b9 Mon Sep 17 00:00:00 2001 From: Pavel Drankov Date: Sat, 22 Jul 2023 20:32:17 +0300 Subject: [PATCH] improve header --- frontend/src/components/Header/index.jsx | 36 +++++++++-------- frontend/src/components/SearchBar/index.jsx | 44 +++++++-------------- 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/frontend/src/components/Header/index.jsx b/frontend/src/components/Header/index.jsx index 6c7c4a6e..879c8033 100644 --- a/frontend/src/components/Header/index.jsx +++ b/frontend/src/components/Header/index.jsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import {useEffect, useState} from 'react'; import {useNavigate, useParams} from 'react-router-dom'; import {generatePath} from 'react-router'; @@ -11,7 +12,10 @@ import { Drawer, Grid, IconButton, - List, ListItem, ListItemButton, ListItemText, + List, + ListItem, + ListItemButton, + ListItemText, Toolbar, Typography } from '@mui/material'; @@ -20,15 +24,13 @@ import MenuIcon from '@mui/icons-material/Menu'; import {borderColor, containerBg, headerButtonColor} from '../../theme'; import {EuIcon, UsIcon} from '../icons'; -import HeaderMenu from '../HeaderMenu'; import {metaUrls, publicUrls} from '../../config'; -import {TABS, TABS_MENU} from '../../constants/header'; +import {TABS} from '../../constants/header'; import {REGIONS} from '../../constants/region'; import {getRegion} from '../../utils/urlparts'; import {BRACKETS} from '../../constants/pvp-activity'; import SearchBar from "../SearchBar"; -import {useEffect, useState} from "react"; const pages = Object.values(TABS); const drawerWidth = 240; @@ -143,13 +145,12 @@ const Header = () => { component="a" href="/" sx={{ - mr: 2, display: {xs: 'none', md: 'flex'}, fontWeight: 700, letterSpacing: '.05rem', color: 'inherit', textDecoration: 'none', - marginRight: '40px', + paddingRight: '20px', }} > {host} @@ -174,19 +175,22 @@ const Header = () => { direction="row" justifyContent="space-between" alignItems="center"> - - - {webSiteTypo} - {activityBtn} - {ladderBtn} - {metaBtn} + + + + {webSiteTypo} + {activityBtn} + {ladderBtn} + {metaBtn} + + + + - - - - + {euBtn} {naBtn} diff --git a/frontend/src/components/SearchBar/index.jsx b/frontend/src/components/SearchBar/index.jsx index 14995825..fbbc68d6 100644 --- a/frontend/src/components/SearchBar/index.jsx +++ b/frontend/src/components/SearchBar/index.jsx @@ -48,7 +48,7 @@ const SearchBar = () => { width: '100%', }} disablePortal - noOptionsText="No results" + freeSolo options={searchResults} filterOptions={(x) => x} getOptionLabel={(option) => { @@ -108,36 +108,20 @@ const SearchBar = () => { disableClearable renderInput={(params) => { return ( - - - - ), - }} - />); + + + + ), + }} + />); }} />); - - // renderInput={(params) => ( - // - // {loading ? 'Loading...' : null} - // {params.InputProps.endAdornment} - // - // ), - // }} - // />) - }; export default SearchBar;