MCPcopy Create free account
hub / github.com/clintonwoo/hackernews-react-graphql / render

Method render

src/components/comment.tsx:31–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30export class Comment extends React.Component<ICommentProps> {
31 render(): JSX.Element {
32 const { id, creationTime, indentationLevel, submitterId, text } = this.props;
33
34 const vote = (): void => {
35 return undefined;
36 };
37
38 const toggle = (): void => {
39 return undefined;
40 };
41
42 return (
43 <tr className="athing comtr " id="15238246">
44 <td>
45 <table style={{ border: '0' }}>
46 <tbody>
47 <tr>
48 <td className="ind">
49 <img
50 alt=""
51 src="/static/s.gif"
52 height="1"
53 width={indentationLevel * 40} /* Width varies depending on comment level */
54 />
55 </td>
56 <td style={{ verticalAlign: 'top' }} className="votelinks">
57 <div style={{ textAlign: 'center' }}>
58 <a
59 id="up_15238246"
60 onClick={vote}
61 href="vote?id=15238246&amp;how=up&amp;auth=4eb97bf0d2568aa743691210b904f0c5182bb0fc&amp;goto=item%3Fid%3D15237896#15238246"
62 >
63 <div className="votearrow" title="upvote" />
64 </a>
65 </div>
66 </td>
67 <td className="default">
68 <div style={{ marginTop: '2px', marginBottom: '-10px' }}>
69 <span className="comhead">
70 <Link href="/user?id=mstade">
71 <a className="hnuser">{submitterId}</a>
72 </Link>
73 <span className="age">
74 {' '}
75 <Link href={`/item?id=${id}`}>
76 <a>{convertNumberToTimeAgo(creationTime)}</a>
77 </Link>
78 </span>{' '}
79 <span id="unv_15238246" />
80 <span className="par" />{' '}
81 <a className="togg" id="24" onClick={toggle}>
82 [-]
83 </a>
84 <span className="storyon" />
85 </span>
86 </div>
87 <br />
88 <div className="comment">

Callers 1

server.tsFile · 0.45

Calls 1

convertNumberToTimeAgoFunction · 0.90

Tested by

no test coverage detected