diff --git a/client/src/components/Navbar/index.js b/client/src/components/Navbar/index.js index 4d2c5ca..9c9bf4f 100644 --- a/client/src/components/Navbar/index.js +++ b/client/src/components/Navbar/index.js @@ -2,15 +2,15 @@ import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { - ListItem, ListItemText, Button, Avatar, Container, List, + ListItemText, Button, Avatar, Container, List, } from '@mui/material'; import './style.css'; import Logo from '../../asstes/logo.png'; import PresonImg from '../../asstes/avatar.png'; +import LinkComponent from '../common/LinkComponent'; function NavBar() { - const [logged, setLogged] = useState(true); return ( diff --git a/client/src/components/common/LinkComponent/index.jsx b/client/src/components/common/LinkComponent/index.jsx new file mode 100644 index 0000000..88a619b --- /dev/null +++ b/client/src/components/common/LinkComponent/index.jsx @@ -0,0 +1,22 @@ +import { Link } from 'react-router-dom'; +import { ListItem, ListItemText } from '@mui/material'; +import PropTypes from 'prop-types'; + +const LinkComponent = ({ + to, styleList, name, +}) => ( +
+ + + + + +
+); +LinkComponent.propTypes = { + name: PropTypes.string.isRequired, + to: PropTypes.string.isRequired, + styleList: PropTypes.objectOf.isRequired, +}; + +export default LinkComponent;