|
| 1 | +import React, { useState } from 'react'; |
1 | 2 | import Avatar from '@mui/material/Avatar';
|
2 | 3 | import NavbarDropDown from './NavBarButtons';
|
3 |
| -import React from 'react'; |
4 | 4 | import { RootState } from '../../redux/store';
|
5 |
| -//commenting out the line below breaks the app |
6 | 5 | import logo from '../../public/icons/win/logo.png';
|
| 6 | +import NewExportButton from './NewExportButton'; |
7 | 7 | import { useSelector } from 'react-redux';
|
| 8 | +import Button from '@mui/material/Button'; |
| 9 | +import MoreVertIcon from '@mui/icons-material/MoreVert'; |
| 10 | +import NavBarButtons from './NavBarButtons'; |
8 | 11 |
|
9 |
| -const NavBar = (props) => { |
10 |
| - // for dropdown navbar |
11 |
| - const [dropMenu, setDropMenu] = React.useState(false); |
12 |
| - const isDarkMode = useSelector( |
13 |
| - (state: RootState) => state.darkMode.isDarkMode |
14 |
| - ); |
| 12 | +const NavBar = () => { |
| 13 | + const [dropMenu, setDropMenu] = useState(false); |
| 14 | + const isDarkMode = useSelector((state: RootState) => state.darkMode.isDarkMode); |
| 15 | + |
| 16 | + const buttonContainerStyle = { |
| 17 | + display: 'flex', |
| 18 | + alignItems: 'center', |
| 19 | + justifyContent: 'flex-start', |
| 20 | + }; |
| 21 | + |
| 22 | + const buttonStyle = { |
| 23 | + backgroundColor: '#333', |
| 24 | + border: 'none', |
| 25 | + color: isDarkMode ? 'lightgray' : 'white', |
| 26 | + fontSize: '12px', |
| 27 | + padding: '8px 12px', |
| 28 | + cursor: 'pointer', |
| 29 | + marginRight: '10px', |
| 30 | + marginLeft: '5px', |
| 31 | + borderRadius: '4px', |
| 32 | + }; |
| 33 | + |
| 34 | + const moreVertButtonStyle = { |
| 35 | + backgroundColor: '#333', |
| 36 | + border: '1px solid #333', |
| 37 | + padding: '0', |
| 38 | + cursor: 'pointer', |
| 39 | + display: 'flex', |
| 40 | + alignItems: 'center', |
| 41 | + justifyContent: 'flex-start', |
| 42 | + borderRadius: '4px', |
| 43 | + width: '30px', |
| 44 | + minWidth: '20px', |
| 45 | + marginLeft: '0px', |
| 46 | + marginRight: '10px', |
| 47 | + }; |
15 | 48 |
|
16 | 49 | return (
|
17 |
| - <nav |
18 |
| - className="main-navbar" |
19 |
| - style={ |
20 |
| - isDarkMode |
21 |
| - ? { backgroundColor: '#013365' } |
22 |
| - : { backgroundColor: '#151515' } |
23 |
| - } |
24 |
| - > |
| 50 | + <nav className="main-navbar" style={isDarkMode ? { backgroundColor: '#013365' } : { backgroundColor: 'white' }}> |
25 | 51 | <div className="main-logo">
|
26 | 52 | <Avatar src={logo}></Avatar>
|
27 |
| - <h1 style={isDarkMode ? { color: '#C6C6C6' } : { color: '#C6C6C6' }}> |
28 |
| - ReacType |
29 |
| - </h1> |
| 53 | + <h1 style={isDarkMode ? { color: 'white' } : { color: '#013365' }}>ReacType</h1> |
30 | 54 | </div>
|
31 |
| - <div onMouseLeave={() => setDropMenu(false)}> |
32 |
| - <svg |
33 |
| - xmlns="http://www.w3.org/2000/svg" |
34 |
| - width="16" |
35 |
| - height="16" |
36 |
| - fill="currentColor" |
37 |
| - className="bi bi-gear-wide-connected navbar-icon" |
38 |
| - viewBox="0 0 16 16" |
39 |
| - onMouseOver={() => setDropMenu(true)} |
| 55 | + <div style={buttonContainerStyle}> |
| 56 | + <button style={buttonStyle}>Share</button> |
| 57 | + <NewExportButton /> |
| 58 | + <Button |
| 59 | + style={moreVertButtonStyle} |
| 60 | + variant="contained" |
| 61 | + color="primary" |
| 62 | + onClick={() => setDropMenu((prevDropMenu) => !prevDropMenu)} |
40 | 63 | >
|
41 |
| - <path d="M7.068.727c.243-.97 1.62-.97 1.864 0l.071.286a.96.96 0 0 0 1.622.434l.205-.211c.695-.719 1.888-.03 1.613.931l-.08.284a.96.96 0 0 0 1.187 1.187l.283-.081c.96-.275 1.65.918.931 1.613l-.211.205a.96.96 0 0 0 .434 1.622l.286.071c.97.243.97 1.62 0 1.864l-.286.071a.96.96 0 0 0-.434 1.622l.211.205c.719.695.03 1.888-.931 1.613l-.284-.08a.96.96 0 0 0-1.187 1.187l.081.283c.275.96-.918 1.65-1.613.931l-.205-.211a.96.96 0 0 0-1.622.434l-.071.286c-.243.97-1.62.97-1.864 0l-.071-.286a.96.96 0 0 0-1.622-.434l-.205.211c-.695.719-1.888.03-1.613-.931l.08-.284a.96.96 0 0 0-1.186-1.187l-.284.081c-.96.275-1.65-.918-.931-1.613l.211-.205a.96.96 0 0 0-.434-1.622l-.286-.071c-.97-.243-.97-1.62 0-1.864l.286-.071a.96.96 0 0 0 .434-1.622l-.211-.205c-.719-.695-.03-1.888.931-1.613l.284.08a.96.96 0 0 0 1.187-1.186l-.081-.284c-.275-.96.918-1.65 1.613-.931l.205.211a.96.96 0 0 0 1.622-.434l.071-.286zM12.973 8.5H8.25l-2.834 3.779A4.998 4.998 0 0 0 12.973 8.5zm0-1a4.998 4.998 0 0 0-7.557-3.779l2.834 3.78h4.723zM5.048 3.967c-.03.021-.058.043-.087.065l.087-.065zm-.431.355A4.984 4.984 0 0 0 3.002 8c0 1.455.622 2.765 1.615 3.678L7.375 8 4.617 4.322zm.344 7.646.087.065-.087-.065z" /> |
42 |
| - </svg> |
43 |
| - <NavbarDropDown dropMenu={dropMenu}></NavbarDropDown> |
| 64 | + <MoreVertIcon style={{ color: 'white' }} /> |
| 65 | + </Button> |
| 66 | + <NavBarButtons dropMenu={dropMenu} setDropMenu={setDropMenu} style={{ color: 'white' }} /> |
44 | 67 | </div>
|
45 | 68 | </nav>
|
46 | 69 | );
|
|
0 commit comments