Revize 5bedee9e
Přidáno uživatelem plundrichov před více než 4 roky(ů)
client/src/Nav.js | ||
---|---|---|
5 | 5 |
function Nav(props) { |
6 | 6 |
|
7 | 7 |
return ( |
8 |
<nav className="top-nav"> |
|
9 |
<a className="link-nav" href="http://localhost:3000/"><h3>YOSO</h3></a> |
|
10 |
<div className="profile-comp"> |
|
11 |
<img src="https://cataas.com/cat/says/hello%20world!" className="img-avatar" alt="cat"></img> |
|
12 |
<h5>{props.userName.name}</h5> |
|
13 |
<ul> |
|
14 |
{props.userName.role === 'EMPLOYER' ? |
|
15 |
<li> |
|
16 |
<Link to="/setting"> |
|
17 |
<svg className="bi bi-gear-fill navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
|
18 |
<path fillRule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/> |
|
19 |
<path fillRule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/> |
|
20 |
</svg> |
|
21 |
</Link> |
|
22 |
</li> |
|
23 |
: null } |
|
24 |
<li> |
|
25 |
<Link to="/logout"> |
|
26 |
<svg className="bi bi-power navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
|
27 |
<path fillRule="evenodd" d="M5.578 4.437a5 5 0 1 0 4.922.044l.5-.866a6 6 0 1 1-5.908-.053l.486.875z"/> |
|
28 |
<path fillRule="evenodd" d="M7.5 8V1h1v7h-1z"/> |
|
29 |
</svg> |
|
30 |
</Link> |
|
31 |
</li> |
|
32 |
</ul> |
|
33 |
</div> |
|
34 |
</nav> |
|
35 |
) |
|
36 |
} |
|
8 |
props.currentUser === undefined |
|
9 |
? |
|
10 |
<nav className="top-nav"> |
|
11 |
<Link className="link-nav" to="/"><h1>YOSO</h1></Link> |
|
12 |
</nav> |
|
13 |
: |
|
14 |
<nav className="top-nav"> |
|
15 |
<Link className="link-nav" to="/"><h1>YOSO</h1></Link> |
|
16 |
<div className="profile-comp"> |
|
17 |
<img src={props.currentUser.photo} className="img-avatar" alt="profile_photo"></img> |
|
18 |
<h5>{props.currentUser.name}</h5> |
|
19 |
<ul> |
|
20 |
{props.currentUser.role === 'EMPLOYER' ? |
|
21 |
<li> |
|
22 |
<Link to="/setting"> |
|
23 |
<svg className="bi bi-gear-fill navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
|
24 |
<path fillRule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/> |
|
25 |
<path fillRule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/> |
|
26 |
</svg> |
|
27 |
</Link> |
|
28 |
</li> |
|
29 |
: null } |
|
30 |
<li> |
|
31 |
<Link to="/logout"> |
|
32 |
<svg className="bi bi-power navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
|
33 |
<path fillRule="evenodd" d="M5.578 4.437a5 5 0 1 0 4.922.044l.5-.866a6 6 0 1 1-5.908-.053l.486.875z"/> |
|
34 |
<path fillRule="evenodd" d="M7.5 8V1h1v7h-1z"/> |
|
35 |
</svg> |
|
36 |
</Link> |
|
37 |
</li> |
|
38 |
</ul> |
|
39 |
</div> |
|
40 |
</nav> |
|
41 |
) |
|
42 |
} |
|
37 | 43 |
|
38 |
export default Nav; |
|
39 | 44 |
|
40 |
|
|
41 |
|
|
42 |
/* |
|
43 |
useEffect(() => { |
|
44 |
const data = nactiData(); |
|
45 |
setName(data.user.name); |
|
46 |
}, []); |
|
47 |
|
|
48 |
function nactiData() { |
|
49 |
return { |
|
50 |
user: { |
|
51 |
name: 'Golstoj Hyhrenciv', |
|
52 |
}, |
|
53 |
}; |
|
54 |
} |
|
55 |
*/ |
|
45 |
export default Nav; |
Také k dispozici: Unified diff
re #58 Rewrited client app to React #58 // yoso internal app // in progress #60 // fixed