diff options
| author | Loek Le Blansch <32883851+lonkaars@users.noreply.github.com> | 2021-04-21 10:40:52 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-21 10:40:52 +0200 | 
| commit | dadc722875b2095bd3d6c4ab628a644197b85f7b (patch) | |
| tree | 9e061708fad5bfdcc40f4c40662d77fbc42cfe64 /components/navbar.tsx | |
| parent | c603cb79e7ba7fdbb101a506e36f6d8d70b3a8f4 (diff) | |
| parent | 5cb39d822716c650e520c3855ef049ff308a348c (diff) | |
Merge pull request #12 from lonkaars/css-files
big redesign css move thing
Diffstat (limited to 'components/navbar.tsx')
| -rw-r--r-- | components/navbar.tsx | 78 | 
1 files changed, 15 insertions, 63 deletions
| diff --git a/components/navbar.tsx b/components/navbar.tsx index 70de574..5ce43bb 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -1,8 +1,8 @@  import axios from 'axios'; -import { CSSProperties, useContext, useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react';  import { userInfo } from '../api/api'; -import { LogoDark } from '../components/logo'; +import Logo from '../components/logo';  import { AccountAvatar } from './account';  import { NotificationsArea } from './notificationsArea';  import { SocketContext } from './socketContext'; @@ -15,12 +15,6 @@ import SearchIcon from '@material-ui/icons/Search';  import SettingsIcon from '@material-ui/icons/Settings';  import VideogameAssetIcon from '@material-ui/icons/VideogameAsset'; -var NavBarItemStyle: CSSProperties = { -	margin: 12, -	marginBottom: 16, -	display: 'block', -}; -  export function NavBar() {  	var [loggedIn, setLoggedIn] = useState(false);  	var [gotData, setGotData] = useState(false); @@ -60,73 +54,31 @@ export function NavBar() {  		})();  	}, []); -	return <div -		className='navbar' -		style={{ -			width: 48, -			height: '100%', - -			lineHeight: 0, - -			backgroundColor: 'var(--background)', -			display: 'inline-block', - -			position: 'fixed', -			top: 0, -			left: 0, - -			overflow: 'visible', -			whiteSpace: 'nowrap', -			zIndex: 2, -		}} -	> -		<div style={NavBarItemStyle}> -			<LogoDark /> +	return <div className='navbar bg-800 h100vh dispinbl t0 l0 posfix'> +		<div className='item'> +			<Logo />  		</div> -		<a href='/' style={NavBarItemStyle}> +		<a href='/' className='item'>  			<Home />  		</a> -		<a href='/game' style={NavBarItemStyle}> +		<a href='/game' className='item'>  			<VideogameAssetIcon />  		</a> -		{false && <a href='/' style={NavBarItemStyle}> +		{false && <a href='/' className='item'>  			<ExtensionIcon />  		</a>} -		<a href='/search' style={NavBarItemStyle}> +		<a href='/search' className='item'>  			<SearchIcon />  		</a> -		<div -			style={{ -				position: 'absolute', -				bottom: -4, -				left: 0, -				backgroundColor: 'var(--background)', -			}} -		> -			{loggedIn && <a -				style={{ -					overflow: 'visible', -					position: 'relative', -					...NavBarItemStyle, -				}} -			> +		<div className='bg-800 bottomArea'> +			{loggedIn && <a className='notifications item posrel'>  				<div -					style={{ cursor: 'pointer' }} +					className='iconWrapper'  					onClick={() => setNotificationsAreaVisible(!notificationsAreaVisible)}  				>  					<NotificationsIcon /> -					{gotNotifications && <div -						style={{ -							backgroundColor: 'var(--disk-a)', -							width: 8, -							height: 8, -							borderRadius: 4, -							position: 'absolute', -							top: 2, -							right: 2, -						}} -					/>} +					{gotNotifications && <div className='notificationDot posabs' />}  				</div>  				<NotificationsArea  					visible={notificationsAreaVisible} @@ -134,12 +86,12 @@ export function NavBar() {  					rerender={getNotifications}  				/>  			</a>} -			<a href={loggedIn ? '/user' : '/login'} style={NavBarItemStyle}> +			<a href={loggedIn ? '/user' : '/login'} className='item'>  				{loggedIn  					? <AccountAvatar size={24} round />  					: <PersonIcon />}  			</a> -			{loggedIn && <a href='/settings' style={NavBarItemStyle}> +			{loggedIn && <a href='/settings' className='item'>  				<SettingsIcon />  			</a>}  		</div> |