Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create navbar component with style #40 #74

Merged
merged 5 commits into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/src/asstes/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/asstes/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions client/src/components/Navbar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* eslint-disable no-unused-vars */
import React, { useState } from 'react';
import { Link as RouterLink } from 'react-router-dom';
import Link from '@mui/material/Link';
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
import {
ListItem, ListItemText, Button, Avatar, Container, List,
} from '@mui/material';
import './style.css';

import Logo from '../../asstes/logo.png';
import PresonImg from '../../asstes/avatar.png';

function NavBar() {
const [logged, setLogged] = useState(true);
return (
<Container maxWidth="xl">
<nav className="container">
<Link component={RouterLink} to="/">
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<img src={Logo} alt="logo-housy" className="img-logo" />
</Link>
{' '}
<List
className="list"
sx={{ justifyContent: 'space-between' }}
style={{
marginRight: '150px', alignSelf: 'center', color: '#797B7D',
}}
>
<Link component={RouterLink} to="/" style={{ color: '#797B7D', textDecoration: 'none' }}>
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<ListItem button style={{ textDecoration: 'none' }}>
<ListItemText primary="Home" />
</ListItem>
</Link>

<Link component={RouterLink} to="/signup" style={{ color: '#797B7D', textDecoration: 'none' }}>
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<ListItem button>
<ListItemText primary="About" />
</ListItem>
</Link>
<Link component={RouterLink} to="/" style={{ color: '#797B7D', textDecoration: 'none' }}>
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<ListItem button>
<ListItemText primary="Buy" />
</ListItem>
</Link>
<Link component={RouterLink} to="/" style={{ color: '#797B7D', textDecoration: 'none' }}>
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<ListItem button>
<ListItemText primary="Rent" />
</ListItem>
</Link>
</List>
{/* </Stack> */}
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved

<div className="agent">
<Button style={{
marginRight: '30px', alignSelf: 'center', backgroundColor: '#3781CB', color: '#FFFFFF', textTransform: 'none',
}}
>
{' '}
<Link component={RouterLink} to="/login" className="btn-host">
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<ListItemText primary="Host my House" style={{ color: '#fff' }} />
</Link>
</Button>
{logged ? (
<Link component={RouterLink} to="/">
Mu7ammadAbed marked this conversation as resolved.
Show resolved Hide resolved
<Avatar src={PresonImg} />
</Link>
) : (
''
)}
</div>

</nav>
</Container>

);
}
export default NavBar;
23 changes: 23 additions & 0 deletions client/src/components/Navbar/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.container{
display: flex;
flex-direction: row;
justify-content: space-around;

}
.img-logo{
width: 90px;
height: 80px;

}
.list{
display: flex ;
align-self: center;

}
.agent{

display: flex ;
flex-direction: row ;
align-self: center;

}
3 changes: 1 addition & 2 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
document.getElementById('root'),
);