Last active
June 24, 2019 15:29
-
-
Save vitalyp/9456fcd721a19a00797909630b52adfb to your computer and use it in GitHub Desktop.
MAGIC_HTML_TEST (see line numbers on each row)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML generated using hilite.me --><div style="background: #000000; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><table><tr><td><pre style="margin: 0; line-height: 125%"> 1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34MAGIC! | |
35 | |
36 | |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87</pre></td><td><pre style="margin: 0; line-height: 125%"><span MAGIC!style="color: #ff0000">import</span> React, {Component} from <span style="color: #87ceeb">'react'</span>; | |
<span style="color: #ff0000">import</span> {withRouter} from <span style="color: #87ceeb">'react-router-dom'</span> | |
<span style="color: #ff0000">import</span> <span style="color: #87ceeb">'./style.styl'</span>; | |
<span style="color: #ff0000">import</span> Sign from <span style="color: #87ceeb">'../sign'</span>; | |
<span style="color: #ff0000">import</span> {Link} from <span style="color: #87ceeb">'react-router-dom'</span>; | |
<span style="color: #ff0000">const</span> RoundNumber = (props) => { | |
<span style="color: #ff0000">return</span> ( | |
<span className=<span style="color: #87ceeb">"sidebar__list--span"</span>>{props.number}</span> | |
) | |
}; | |
<span style="color: #ff0000">const</span> menu = [ | |
{ | |
path: <span style="color: #87ceeb">'/inbox-content'</span>, | |
icon: <span style="color: #87ceeb">'inbox'</span>, | |
name: <span style="color: #87ceeb">'main'</span> | |
}, | |
{ | |
path: <span style="color: #87ceeb">'/sent-content'</span>, | |
icon: <span style="color: #87ceeb">'send'</span>, | |
name: <span style="color: #87ceeb">'send'</span> | |
} | |
] | |
<span style="color: #ff0000">class</span> Listitems <span style="color: #ff0000">extends</span> Component<{}> { | |
renderMenuItem = (item) => { | |
<span style="color: #ff0000">const</span> {location: {pathname} = {}} = <span style="color: #ff0000">this</span>.props | |
<span style="color: #ff0000">const</span> {path, icon, name} = item | |
<span style="color: #ff0000">return</span> ( | |
<Link to={path} className=<span style="color: #87ceeb">"sidebar__list--link"</span>> | |
<li | |
className={pathname === path ? <span style="color: #87ceeb">'sidebar__list--item active'</span> : <span style="color: #87ceeb">'sidebar__list--item'</span>} | |
key={path} | |
> | |
<Sign name={icon}/> | |
{name} | |
{<span style="color: #00ff00">/*<RoundNumber number="3"/>*/</span>} | |
</li> | |
</Link> | |
) | |
} | |
render() { | |
<span style="color: #ff0000">const</span> {location: {pathname} = {}} = <span style="color: #ff0000">this</span>.props | |
<span style="color: #ff0000">return</span> ( | |
<div> | |
<div> | |
<ul className=<span style="color: #87ceeb">"sidebar__list"</span>> | |
{menu.map(<span style="color: #ff0000">this</span>.renderMenuItem, <span style="color: #ff0000">this</span>)} | |
{<span style="color: #00ff00">/* <li className={this.state.active ? 'sidebar__list--item active' : 'sidebar__list--item'}></span> | |
<span style="color: #00ff00"><Sign</span> | |
<span style="color: #00ff00">name="inbox"/></span> | |
<span style="color: #00ff00"><Link to="/inbox-content" className="sidebar__list--link">Inbox</span> | |
<span style="color: #00ff00"></Link></span> | |
<span style="color: #00ff00"><RoundNumber number="3"/></span> | |
<span style="color: #00ff00"></li></span> | |
<span style="color: #00ff00"><li className="sidebar__list--item"></span> | |
<span style="color: #00ff00"><Sign name="send"/></span> | |
<span style="color: #00ff00"><Link to="/sent-content" className="sidebar__list--link" ></span> | |
<span style="color: #00ff00">Sent</span> | |
<span style="color: #00ff00"></Link></span> | |
<span style="color: #00ff00"></li></span> | |
<span style="color: #00ff00"><li className="sidebar__list--item"></span> | |
<span style="color: #00ff00"><Sign name="report"/></span> | |
<span style="color: #00ff00"><Link to="/spam-content" className="sidebar__list--link"</span> | |
<span style="color: #00ff00">href="#">Spam</Link><RoundNumber number="2"/></span> | |
<span style="color: #00ff00"></li></span> | |
<span style="color: #00ff00"><li className="sidebar__list--item"></span> | |
<span style="color: #00ff00"><Sign name="delete"/></span> | |
<span style="color: #00ff00"><Link to="/trash-content" className="sidebar__list--link"></span> | |
<span style="color: #00ff00">Trash</span> | |
<span style="color: #00ff00"></Link></span> | |
<span style="color: #00ff00"></li>*/</span>} | |
</ul> | |
</div> | |
</div> | |
); | |
} | |
}; | |
<span style="color: #ff0000">export</span> <span style="color: #ff0000">default</span> withRouter(Listitems); | |
</pre></td></tr></table></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment